Re: [fpc-pascal] LongBool True = -1

2018-05-20 Thread Sven Barth via fpc-pascal
Dmitry Boyarintsev schrieb am So., 20. Mai 2018, 04:38: > On Thu, May 17, 2018 at 5:26 PM, Anthony Walter wrote: > >> I am working with some a glib library that expects gboolean to be >> positive 1 for true, yet FPC emits -1 for true. >> > > I'd

Re: [fpc-pascal] LongBool True = -1

2018-05-19 Thread Dmitry Boyarintsev
On Thu, May 17, 2018 at 5:26 PM, Anthony Walter wrote: > I am working with some a glib library that expects gboolean to be positive > 1 for true, yet FPC emits -1 for true. > I'd think that pascal defines true as true = not false; In case of unsigned integers "-1" is not an

Re: [fpc-pascal] LongBool True = -1

2018-05-19 Thread Sven Barth via fpc-pascal
Gerhard Scholz schrieb am Sa., 19. Mai 2018, 19:51: > Afaik, the bool types (longbool, wordbool, bytebool) come from the C > language and are mostly used to interface with C libraries (for example: > windows). The definitions there are: 0 means FALSE, anything else means > TRUE.

Re: [fpc-pascal] LongBool True = -1

2018-05-19 Thread Gerhard Scholz
lt;fpc-pascal@lists.freepascal.org> To: <fpc-pascal@lists.freepascal.org> Cc: "Sven Barth" <pascaldra...@googlemail.com> Sent: Friday, May 18, 2018 7:22 AM Subject: Re: [fpc-pascal] LongBool True = -1 Am 17.05.2018 um 23:26 schrieb Anthony Walter: I am working with som

Re: [fpc-pascal] LongBool True = -1

2018-05-17 Thread Sven Barth via fpc-pascal
Am 17.05.2018 um 23:26 schrieb Anthony Walter: I am working with some a glib library that expects gboolean to be positive 1 for true, yet FPC emits -1 for true. Is there a compiler flag to force boolean types to emit 1 instead of -1? If so, would there possibly be any side effects with other

[fpc-pascal] LongBool True = -1

2018-05-17 Thread Anthony Walter
I am working with some a glib library that expects gboolean to be positive 1 for true, yet FPC emits -1 for true. Is there a compiler flag to force boolean types to emit 1 instead of -1? If so, would there possibly be any side effects with other pascal code?