[fpc-devel] gtk2 bugfix gfloat

Florian Klaempfl florian at freepascal.org
Wed Jun 15 13:10:00 CEST 2005


Mattias Gaertner wrote:

> On Wed, 15 Jun 2005 09:20:48 +0200
> Micha Nelissen <micha at neli.hopto.org> wrote:
> 
> 
>>On Tue, 14 Jun 2005 23:33:17 +0200
>>Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
>>
>>
>>>On Tue, 14 Jun 2005 22:34:19 +0200
>>>Micha Nelissen <micha at neli.hopto.org> wrote:
>>>
>>>
>>>>On Tue, 14 Jun 2005 22:11:40 +0200
>>>>Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
>>>>
>>>>
>>>>>A c float is a fpc single, right?
>>
>>So why did you do:
>>
>>-   {$IFDEF KYLIX}
>>-     gfloat = single;   //  Don't know why, but some routines requires
>>this -   {$ELSE}
>>-     gfloat = double;
>>-   {$ENDIF}
>>+   gfloat = double;
>>
>>If you weren't using KYLIX, nothing has changed :S, shouldn't that be:
>>
>>+   gfloat = single;
>>
>>?
> 
> 
> You are right, I'm right, but my patch was insufficient.
> Of course it must be single.
> 
> Marko Peric pointed me to a strange bug with some gtk2 examples translated
> to pascal. After some debugging I saw, that with double it doesn't work, but
> with single it works. According to the gtk2 sources and docs, gfloat must be
> a c float. So definitely double is wrong and single works in my test cases.
> I tested it with gtk2forpascal. But at the moment I have some trouble
> building fpc and its rpms. Maybe the gfloat bug explains some of the strange
> lazarus gtk2 interface bugs.
> The reason, why this bug was not spotted before, is that the gtk2 always
> bounds all gfloat input. This results in most cases to no effect, not even a
> warning.

Changed again. The correct solution would be imo to use the ctypes unit and make
it a cfloat. Mattias, afaik you've write permissions to the fpc repository so
you can do further changes to the gtk2 interface units yourself :)




More information about the fpc-devel mailing list