Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/80a3a15636ee7d3a951b8f257ccd1de9d78e2227 >--------------------------------------------------------------- commit 80a3a15636ee7d3a951b8f257ccd1de9d78e2227 Author: Ian Lynagh <i...@well-typed.com> Date: Fri Dec 14 01:06:05 2012 +0000 Remove a couple more FastBytes functions >--------------------------------------------------------------- compiler/basicTypes/Literal.lhs | 2 +- compiler/utils/FastString.lhs | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/compiler/basicTypes/Literal.lhs b/compiler/basicTypes/Literal.lhs index a590eae..8fc42db 100644 --- a/compiler/basicTypes/Literal.lhs +++ b/compiler/basicTypes/Literal.lhs @@ -470,7 +470,7 @@ Hash values should be zero or a positive integer. No negatives please. \begin{code} hashLiteral :: Literal -> Int hashLiteral (MachChar c) = ord c + 1000 -- Keep it out of range of common ints -hashLiteral (MachStr s) = hashFB s +hashLiteral (MachStr s) = hashByteString s hashLiteral (MachNullAddr) = 0 hashLiteral (MachInt i) = hashInteger i hashLiteral (MachInt64 i) = hashInteger i diff --git a/compiler/utils/FastString.lhs b/compiler/utils/FastString.lhs index 3ef92a4..faec292 100644 --- a/compiler/utils/FastString.lhs +++ b/compiler/utils/FastString.lhs @@ -33,7 +33,7 @@ module FastString fastStringToFastBytes, fastZStringToByteString, unsafeMkFastBytesString, - hashFB, + hashByteString, -- * FastZString FastZString, @@ -162,14 +162,11 @@ pokeCAString ptr str = in go str 0 -hashFB :: FastBytes -> Int -hashFB bs +hashByteString :: ByteString -> Int +hashByteString bs = inlinePerformIO $ BS.unsafeUseAsCStringLen bs $ \(ptr, len) -> return $ hashStr (castPtr ptr) len -hPutFB :: Handle -> FastBytes -> IO () -hPutFB = BS.hPut - -- ----------------------------------------------------------------------------- newtype FastZString = FastZString ByteString @@ -515,7 +512,7 @@ getFastStringTable = do -- |Outputs a 'FastString' with /no decoding at all/, that is, you -- get the actual bytes in the 'FastString' written to the 'Handle'. hPutFS :: Handle -> FastString -> IO () -hPutFS handle fs = hPutFB handle $ fastStringToFastBytes fs +hPutFS handle fs = BS.hPut handle $ fastStringToFastBytes fs -- ToDo: we'll probably want an hPutFSLocal, or something, to output -- in the current locale's encoding (for error messages and suchlike). _______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc