
6 patches for repository http://code.haskell.org/c2hs: Mon Nov 8 23:46:25 GMT 2010 will@willthompson.co.uk * Convert an accented surname in a comment to UTF-8 hasktags makes the (reasonable) assumption that source files are UTF-8, and gets very upset if they're not. Tue Nov 9 06:02:13 GMT 2010 will@willthompson.co.uk * Fix generation of superclass instances Previously, specifying a superclass in a {# class #} rule would generate incorrect code. For instance, the 'pointer' test case includes the following:
{#pointer *Point as APoint newtype#} {#class APointClass APoint#}
{#pointer *ColourPoint as AColourPoint newtype#} {#class APointClass => AColourPointClass AColourPoint#}
This generates an incorrect instance of APointClass for AColourPoint, as follows:
instance APointClass AColourPoint where aColourPoint (AColourPoint p) = AColourPoint (castPtr p) fromAColourPoint (AColourPoint p) = AColourPoint (castPtr p)
This was due to the code generator using the name of the type being defined rather than the name of the superclass type, which was due to a missing apostrophe. This is my favourite kind of bug fix. Tue Nov 9 06:13:26 GMT 2010 will@willthompson.co.uk * Split collecting superclasses out of a where clause This would have prevented the bug I just fixed, since the mistaken type identifier would not have been in scope. Tue Nov 9 06:16:37 GMT 2010 will@willthompson.co.uk * Simplify generating class cast instances Tue Nov 9 16:37:47 GMT 2010 will@willthompson.co.uk * Squash an unused result warning Tue Nov 9 17:49:46 GMT 2010 will@willthompson.co.uk * Fix deprecation warnings and build trivia in test suite The test suite was passing -fffi to GHC; this patch adds LANGUAGE ForeignFunctionInterface to the relevant files instead. The test suite also used the deprecated C2HS module for converting between Int and CInt; this patch fixes all tests that were using these functions. Also, the Sizeof test didn't compile. It now compiles, but still fails due to bug #10. Finally, compilation errors would previously not cause `make` to fail in some cases.