From 29d87a1e5eb59df0449d9a313de1f7cfee150f50 Mon Sep 17 00:00:00 2001
From: Jeff Shaw <shawjef3@gmial.com>
Date: Fri, 29 Mar 2013 17:33:33 0400
Subject: [PATCH] Change C arithmetic types to be integral types.

Foreign/C/Types.hs  20 ++++++++++++++++
1 file changed, 16 insertions(+), 4 deletions()
diff git a/Foreign/C/Types.hs b/Foreign/C/Types.hs
index 234b4ed..2a7e7e7 100644
a

b

INTEGRAL_TYPE(CSigAtomic,tyConCSigAtomic,"CSigAtomic",HTYPE_SIG_ATOMIC_T) 
201  201  #} 
202  202  
203  203    Haskell type representing the C @clock_t@ type. 
204   ARITHMETIC_TYPE(CClock,tyConCClock,"CClock",HTYPE_CLOCK_T) 
 204  INTEGRAL_TYPE(CClock,tyConCClock,"CClock",HTYPE_CLOCK_T) 
205  205    Haskell type representing the C @time_t@ type. 
206   ARITHMETIC_TYPE(CTime,tyConCTime,"CTime",HTYPE_TIME_T) 
 206  INTEGRAL_TYPE(CTime,tyConCTime,"CTime",HTYPE_TIME_T) 
207  207    Haskell type representing the C @useconds_t@ type. 
208   ARITHMETIC_TYPE(CUSeconds,tyConCUSeconds,"CUSeconds",HTYPE_USECONDS_T) 
 208  INTEGRAL_TYPE(CUSeconds,tyConCUSeconds,"CUSeconds",HTYPE_USECONDS_T) 
209  209    Haskell type representing the C @suseconds_t@ type. 
210   ARITHMETIC_TYPE(CSUSeconds,tyConCSUSeconds,"CSUSeconds",HTYPE_SUSECONDS_T) 
 210  INTEGRAL_TYPE(CSUSeconds,tyConCSUSeconds,"CSUSeconds",HTYPE_SUSECONDS_T) 
 211  
 212  {# RULES 
 213  "fromIntegral/a>CClock" fromIntegral = \x > CClock (fromIntegral x) 
 214  "fromIntegral/a>CTime" fromIntegral = \x > CClock (fromIntegral x) 
 215  "fromIntegral/a>CUSeconds" fromIntegral = \x > CUSeconds (fromIntegral x) 
 216  "fromIntegral/a>CSUSeconds" fromIntegral = \x > CSUSeconds (fromIntegral x) 
 217  
 218  "fromIntegral/CClock>a" fromIntegral = \(CClock x) > fromIntegral x 
 219  "fromIntegral/CTime>a" fromIntegral = \(CTime x) > fromIntegral x 
 220  "fromIntegral/CUSeconds>a" fromIntegral = \(CUSeconds x) > fromIntegral x 
 221  "fromIntegral/CSUSeconds>a" fromIntegral = \(CSUSeconds x) > fromIntegral x 
 222  #} 
211  223  
212  224   FIXME: Implement and provide instances for Eq and Storable 
213  225    Haskell type representing the C @FILE@ type. 