projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
521303d
)
[project @ 1997-08-25 22:36:06 by sof]
author
sof
<unknown>
Mon, 25 Aug 1997 22:36:24 +0000
(22:36 +0000)
committer
sof
<unknown>
Mon, 25 Aug 1997 22:36:24 +0000
(22:36 +0000)
Changed to use PackBase
ghc/lib/required/System.lhs
patch
|
blob
|
history
ghc/lib/required/Time.lhs
patch
|
blob
|
history
diff --git
a/ghc/lib/required/System.lhs
b/ghc/lib/required/System.lhs
index
bdf6ad3
..
75d1fc7
100644
(file)
--- a/
ghc/lib/required/System.lhs
+++ b/
ghc/lib/required/System.lhs
@@
-14,7
+14,7
@@
import Prelude
import Foreign ( Addr )
import IOBase ( IOError(..), IOErrorType(..), thenIO_Prim, constructErrorAndFail )
import ArrBase ( indexAddrOffAddr )
import Foreign ( Addr )
import IOBase ( IOError(..), IOErrorType(..), thenIO_Prim, constructErrorAndFail )
import ArrBase ( indexAddrOffAddr )
-import PackedString ( unpackCString )
+import PackBase ( unpackCString )
\end{code}
\end{code}
diff --git
a/ghc/lib/required/Time.lhs
b/ghc/lib/required/Time.lhs
index
d605ad4
..
26920d0
100644
(file)
--- a/
ghc/lib/required/Time.lhs
+++ b/
ghc/lib/required/Time.lhs
@@
-32,9
+32,9
@@
import STBase
import UnsafeST ( unsafePerformPrimIO )
import ST
import Ix
import UnsafeST ( unsafePerformPrimIO )
import ST
import Ix
-import Foreign( Addr(..) )
-import Char (intToDigit)
-import PackedString (unpackPS, packCBytesST)
+import Foreign ( Addr(..) )
+import Char ( intToDigit )
+import PackBase ( unpackCString )
import Locale
\end{code}
import Locale
\end{code}
@@
-76,9
+76,7
@@
instance Show ClockTime where
allocChars 32 >>= \ buf ->
_ccall_ showTime (I# s#) (ByteArray bottom d#) buf
>>= \ str ->
allocChars 32 >>= \ buf ->
_ccall_ showTime (I# s#) (ByteArray bottom d#) buf
>>= \ str ->
- _ccall_ strlen str >>= \ len ->
- packCBytesST len str >>= \ ps ->
- return (unpackPS ps)
+ return (unpackCString str)
showList = showList__ (showsPrec 0)
\end{code}
showList = showList__ (showsPrec 0)
\end{code}
@@
-247,10
+245,11
@@
toCalendarTime (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO $
_casm_ ``%r = ((struct tm *)%0)->tm_isdst;'' tm >>= \ isdst ->
_ccall_ ZONE tm >>= \ zone ->
_ccall_ GMTOFF tm >>= \ tz ->
_casm_ ``%r = ((struct tm *)%0)->tm_isdst;'' tm >>= \ isdst ->
_ccall_ ZONE tm >>= \ zone ->
_ccall_ GMTOFF tm >>= \ tz ->
- _ccall_ strlen zone >>= \ len ->
- packCBytesST len zone >>= \ tzname ->
+ let
+ tzname = unpackCString zone
+ in
returnPrimIO (CalendarTime (1900+year) mon mday hour min sec psec
returnPrimIO (CalendarTime (1900+year) mon mday hour min sec psec
- (toEnum wday) yday (unpackPS tzname) tz (isdst /= 0))
+ (toEnum wday) yday tzname tz (isdst /= 0))
toUTCTime :: ClockTime -> CalendarTime
toUTCTime (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO (
toUTCTime :: ClockTime -> CalendarTime
toUTCTime (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO (