I've just commited a change to the fptools repository, proposing a minor change in the FFI spec, see below. Comments welcome. Cheers, S. -------- Original Message -------- Subject: cvs commit: fptools/libraries/base/Foreign/C Types.hs fptools/libraries/base/System CPUTime.hsc Directory.hs Time.hsc fptools/libraries/base/System/Posix Types.hs fptools/libraries/base/include CTypes.h Date: Sun, 13 Jun 2004 14:03:47 -0700 From: Sven Panne <panne@glass.cse.ogi.edu> To: cvs-libraries@haskell.org panne 2004/06/13 14:03:47 PDT Modified files: libraries/base/Foreign/C Types.hs libraries/base/System CPUTime.hsc Directory.hs Time.hsc libraries/base/System/Posix Types.hs libraries/base/include CTypes.h Log: Changes related to arithmetic types: * Renamed macros NUMERIC_FOO to ARITHMETIC_FOO to match C99-speak * ARITHMETIC_TYPEs now have a Real instance, otherwise they are quite useless. Note that this differs from the FFI spec, but the spec should very probably changed in this respect. * Some changes to fix the wrong assumption that CTime/CClock are integral types, C99 in fact guarantees only that they are arithmetic types. This has been accomplished by using realToInteger = round . realToFrac :: Real a => a -> Integer instead of fromIntegral for CTime/CClock. I'm not sure if we could do better, going via Double seems to be overkill, but I couldn't think of a better way. GHC could e.g. use RULES here. Improvements welcome. Revision Changes Path 1.22 +2 -2 fptools/libraries/base/Foreign/C/Types.hs 1.15 +5 -4 fptools/libraries/base/System/CPUTime.hsc 1.25 +2 -1 fptools/libraries/base/System/Directory.hs 1.26 +7 -4 fptools/libraries/base/System/Time.hsc 1.14 +3 -3 fptools/libraries/base/System/Posix/Types.hs 1.8 +12 -13 fptools/libraries/base/include/CTypes.h _______________________________________________ Cvs-libraries mailing list Cvs-libraries@haskell.org http://www.haskell.org/mailman/listinfo/cvs-libraries