Peter Gavin wrote:
> Bertram Felgenhauer wrote:
>> Some comments about your patches:
>> [snip]
>>> [add HAVE_NEW_CONTROL_EXCEPTION define to configure.ac; modify several 
>>> files to import OldException when it's defined
>>> hunk ./configure.ac 221
>> +GTKHS_PROG_CHECK_VERSION($PKG_BASE_VERSION, -ge, 4.0,
>> is missing here; it ended up in the wrong patch. (Which means that,
>> right now, the HEAD configure.ac is broken)
>>> +AC_DEFINE(HAVE_NEW_CONTROL_EXCEPTION,[1],[Define if you have the new 
>>> Control.Exception module (from GHC 6.10)]))
>
> Oops, your right :)  I made a bunch of different changes and when I was 
> cherry picking them to put into individual patches I must have missed that.
>
> I'll just go ahead and push the patch, so configure.ac won't be broken any 
> more.
>
>> gnomevfs/System/Gnome/VFS/Error.hs is missing from this patch.
>
> I've amended the patch to include that as well.
>
>> [snip]
>>> [update tools/c2hs/base/general/Binary.hs to work with GHC 6.10
>>> hunk ./tools/c2hs/base/general/Binary.hs 75
>>> +# if __GLASGOW_HASKELL__<610
>>> hunk ./tools/c2hs/base/general/Binary.hs 77
>>> +# else
>>> +import Control.OldException        ( throwDyn )
>>> +# endif
>> That should be in the Control.Exception patch.
>>> hunk ./tools/c2hs/base/general/Binary.hs 483
>>> +#if __GLASGOW_HASKELL__<610
>> Is there any reason to keep the old instance? Performance doesn't appear
>> to be an issue.
>
> For posterity. :)  That could be removed, I suppose.  I left it in for 
> older versions just to make sure I had the same behavior while I was 
> testing it.
>
>>> hunk ./tools/c2hs/base/general/Binary.hs 559
>>> +
>>> +#else
>>> +
>>> +instance Binary Integer where
[snip]
>
> Your version doesn't seem to handle negative numbers, is that correct? 

The latest version handles negative numbers just fine.

The encoding used is a base 2^32 number with digits from -2^31 to 2^31-1:

        0 = 0               -> [] :: [Int32]
        1 = 1               -> [1]
       -1 = -1              -> [-1]
     2^31 = 2^32 * 1 - 2^31 -> [-2^31, 1]
    -2^32 = 2^32 * -1       -> [-1, 0]

The bug that I fixed was that in put_, I used
    (i `shiftR` 32)
instead of
    ((i - fromIntegral j) `shiftR` 32)

In other words, I did the division by 2^32 as if I were using digits
0 to 2^32-1.

regards,

Bertram

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gtk2hs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to