Re: [fpc-devel] Re: WinCE port patches

2005-07-06 Thread Yury Sidorov
From: "Florian Klaempfl" <[EMAIL PROTECTED]> 2. Define new types PSysChar/SysString to correspond either PChar/AnsiString or PWideChar/WideString depending from OS type. It's not a good idea to have String as WideString *without* reference counting on WinCE, and Wide or Ansi strings *with* r

Re: [fpc-devel] bug: Inc(v,i)/Dec(v,i)

2005-07-06 Thread C Western
Marco van de Voort wrote: var v : cardinal; begin v:=100; inc(v,-1); end. The reason is that -1 is in fact an addition of $ resulting in the carry flag being set and therefor an overflow. For cardinal IMHO not-a-bug? I think it's a bug for cardinals and other unsigned ints also (a

Re: [fpc-devel] bug: Inc(v,i)/Dec(v,i)

2005-07-06 Thread Marcel Martin
C Western a écrit : Marco van de Voort wrote: var v : cardinal; begin v:=100; inc(v,-1); end. The reason is that -1 is in fact an addition of $ resulting in the carry flag being set and therefor an overflow. For cardinal IMHO not-a-bug? I think it's a bug for cardinals and o

RE: [fpc-devel] bug: Inc(v,i)/Dec(v,i)

2005-07-06 Thread peter green
shouldn't it implement inv(v,-1) in exactly the same way it implements v:=v-1? > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Marcel > Martin > Sent: 06 July 2005 23:36 > To: FPC developers' list > Subject: Re: [fpc-devel] bug: Inc(v,i)/Dec(v,i) > > >

Re: [fpc-devel] bug: Inc(v,i)/Dec(v,i)

2005-07-06 Thread Marcel Martin
peter green a écrit : shouldn't it implement inv(v,-1) in exactly the same way it implements v:=v-1? Well, I am far to be an expert in compilers but I think no, it shouldn't. v := v + Longword(-1) is different from v := v - Longword(1). The resulting value v is the same but not the way to get i

RE: [fpc-devel] bug: Inc(v,i)/Dec(v,i)

2005-07-06 Thread Peter Vreman
> shouldn't it implement inv(v,-1) in exactly the same way it implements > v:=v-1? The problem is what type do you give to -1. In the old situation the -1 was converted to the same type as v -> longword. Resulting in $. Adding the $ gives an overflow. Note that the compiler doesn'