Add several new record features
[ghc-hetmet.git] / compiler / utils / StringBuffer.lhs
index a1eddb0..69caf0e 100644 (file)
@@ -33,7 +33,7 @@ module StringBuffer
         lexemeToFastString,
 
         -- * Parsing integers
-       parseInteger,
+       parseUnsignedInteger,
        ) where
 
 #include "HsVersions.h"
@@ -208,8 +208,8 @@ byteOff (StringBuffer buf _ cur) i =
     return (unsafeChr (fromIntegral (w::Word8)))
 
 -- | XXX assumes ASCII digits only (by using byteOff)
-parseInteger :: StringBuffer -> Int -> Integer -> (Char->Int) -> Integer
-parseInteger buf len radix char_to_int 
+parseUnsignedInteger :: StringBuffer -> Int -> Integer -> (Char->Int) -> Integer
+parseUnsignedInteger buf len radix char_to_int 
   = go 0 0
   where
     go i x | i == len  = x
@@ -224,19 +224,4 @@ parseInteger buf len radix char_to_int
 inlinePerformIO :: IO a -> a
 inlinePerformIO (IO m) = case m realWorld# of (# _, r #)   -> r
 
-#if __GLASGOW_HASKELL__ < 600
-mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a)
-mallocForeignPtrArray  = doMalloc undefined
-  where
-    doMalloc            :: Storable b => b -> Int -> IO (ForeignPtr b)
-    doMalloc dummy size  = mallocForeignPtrBytes (size * sizeOf dummy)
-
-mallocForeignPtrBytes :: Int -> IO (ForeignPtr a)
-mallocForeignPtrBytes n = do
-  r <- mallocBytes n
-  newForeignPtr r (finalizerFree r)
-
-foreign import ccall unsafe "stdlib.h free" 
-  finalizerFree :: Ptr a -> IO ()
-#endif
 \end{code}