[fpc-pascal] working witg UCS4Char

Tomas Hajny XHajT03 at hajny.biz
Sat Nov 10 12:52:28 CET 2012


On 10 Nov 12, at 0:28, ik wrote:
> On Fri, Nov 9, 2012 at 6:56 PM, Tomas Hajny <XHajT03 at hajny.biz> wrote:
> > On Fri, November 9, 2012 17:38, ik wrote:
> >> On Fri, Nov 9, 2012 at 6:12 PM, Tomas Hajny <XHajT03 at hajny.biz> wrote:
> >>> On Fri, November 9, 2012 17:01, ik wrote:
 .
 .
> >>>> Cardinal is a bit problematic type, you mean longword. :)
> >>>
> >>> Why do you see cardinal as a "problematic type"? At least for FPC it is
> >>> a
> >>> simple alias to longword (and it has actually existed even before
> >>> longword
> >>> in FPC).
> >>
> >> At least with Delphi it has unclear what exactly the size of it.
> >> And the following code:
> >> https://github.com/ik5/fp-msgpack/blob/master/src/msgpack.pas#L528
> >>
> >> Used to be with Cardinal (the only difference), and It never acted as
> >> expected.
> >> The only thing I changed was from cardinal to longword, and it acts as
> >> expected.
> >
> > With Delphi or with FPC? As already mentioned, FPC defines cardinal as an
> > alias to longword (and UInt32 mentioned in your reference as an alias to
> > cardinal) so there should be no difference between cardinal, longword and
> > UInt32 (and in the past, cardinal was even the primary type in FPC
> > directly known by the compiler).
 .
 .
> With FPC. The value was saved wrong.
> The only thing that I changed in my code was moving from Cardinal to LongWord.
 .
 .

Sorry, but I cannot imagine how this could happen considering that 
one of them is alias to the other and thus they cannot be treated 
differently by the compiler (you can even interchange them for actual 
parameters and the compiler wouldn't notice it). If you have a short 
test showing otherwise, please post a bug report.

Tomas




More information about the fpc-pascal mailing list