diff --git a/ghc/lib/std/Time.lhs b/ghc/lib/std/Time.lhs index 0b8d3c5821fe49b23c5825252b83a70a7fd2fade..d9a336f4ae9748a690d46d7053b4a74d929232fb 100644 --- a/ghc/lib/std/Time.lhs +++ b/ghc/lib/std/Time.lhs @@ -600,7 +600,7 @@ type MBytes = MutableByteArray RealWorld Int foreign import "libHS_cbits" "sizeof_time_t" sizeof_time_t :: Int -foreign import "libHS_cbits" "prim_SETZONE" unsafe prim_SETZONE :: MBytes -> MBytes -> IO Int +foreign import "libHS_cbits" "prim_SETZONE" unsafe prim_SETZONE :: MBytes -> MBytes -> IO () #ifdef __HUGS__ foreign import "libHS_cbits" "prim_toLocalTime" unsafe prim_toLocalTime :: Int64 -> MBytes -> IO Int foreign import "libHS_cbits" "prim_toUTCTime" unsafe prim_toUTCTime :: Int64 -> MBytes -> IO Int diff --git a/ghc/lib/std/cbits/Makefile b/ghc/lib/std/cbits/Makefile index 9132b6e4e5be7b0f964c712f98633f8b00692085..38549e7c63f8a26bd53ca0cbe3bc4e14637630df 100644 --- a/ghc/lib/std/cbits/Makefile +++ b/ghc/lib/std/cbits/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.11 1999/12/07 15:49:53 simonmar Exp $ +# $Id: Makefile,v 1.12 1999/12/08 15:47:07 simonmar Exp $ TOP = ../../.. include $(TOP)/mk/boilerplate.mk @@ -15,7 +15,7 @@ C_SRCS= $(wildcard *.c) C_OBJS = $(C_SRCS:.c=.$(way_)o) LIBOBJS = $(C_OBJS) -SRC_CC_OPTS += -O -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) $(GhcLibCcOpts) +SRC_CC_OPTS += -O -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) $(GhcLibCcOpts) -Wall ifneq "$(way)" "dll" SRC_CC_OPTS += -static @@ -36,7 +36,7 @@ SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lgmp -L. -L../../../rts/gmp - # # Compile the files using the Haskell compiler (ghc really). # -CC=$(GHC_INPLACE) +# CC=$(GHC_INPLACE) SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR) diff --git a/ghc/lib/std/cbits/fileGetc.c b/ghc/lib/std/cbits/fileGetc.c index 0be92e7a10e2c505c2876319a47698e4acc0acfd..3a74020f7364d3552dabe15455b33f5cb7c65055 100644 --- a/ghc/lib/std/cbits/fileGetc.c +++ b/ghc/lib/std/cbits/fileGetc.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: fileGetc.c,v 1.4 1999/11/26 16:25:55 simonmar Exp $ + * $Id: fileGetc.c,v 1.5 1999/12/08 15:47:07 simonmar Exp $ * * hGetChar Runtime Support */ @@ -17,7 +17,7 @@ fileGetc(ptr) StgForeignPtr ptr; { IOFileObject* fo = (IOFileObject*)ptr; - int l,rc=0; + int rc=0; unsigned char c; #if 0 diff --git a/ghc/lib/std/cbits/fileLookAhead.c b/ghc/lib/std/cbits/fileLookAhead.c index aa47301d6aa47107f5c4d731bb946b9a40d2e9f7..347853576b9243ae5c6f43eac8e1e06f4f1c5db3 100644 --- a/ghc/lib/std/cbits/fileLookAhead.c +++ b/ghc/lib/std/cbits/fileLookAhead.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: fileLookAhead.c,v 1.4 1999/11/25 16:54:14 simonmar Exp $ + * $Id: fileLookAhead.c,v 1.5 1999/12/08 15:47:07 simonmar Exp $ * * hLookAhead Runtime Support */ @@ -47,7 +47,7 @@ StgInt ungetChar(StgForeignPtr ptr, StgChar c) { IOFileObject* fo = (IOFileObject*)ptr; - int rc = 0, sz = 0; + int sz = 0; #if 0 fprintf(stderr, "ug: %d %d %c\n",fo->bufRPtr, fo->bufWPtr,(char)c, fo->flags); diff --git a/ghc/lib/std/cbits/filePosn.c b/ghc/lib/std/cbits/filePosn.c index 90949ea5c2da6e12158fa12c6373ad69b2d29b2f..c3832864db6f16b600865b69a1206c5b81c9ff5f 100644 --- a/ghc/lib/std/cbits/filePosn.c +++ b/ghc/lib/std/cbits/filePosn.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: filePosn.c,v 1.5 1999/09/20 08:36:35 panne Exp $ + * $Id: filePosn.c,v 1.6 1999/12/08 15:47:07 simonmar Exp $ * * hGetPosn and hSetPosn Runtime Support */ @@ -57,13 +57,10 @@ StgForeignPtr ptr; (this is ensured by making the Haskell file posn. type abstract.) */ StgInt -setFilePosn(ptr, size, d) -StgForeignPtr ptr; -StgInt size; -StgByteArray d; +setFilePosn(StgForeignPtr ptr, StgInt size, StgByteArray d) { IOFileObject* fo = (IOFileObject*)ptr; - int rc, mode; + int rc; off_t offset; /* diff --git a/ghc/lib/std/cbits/filePutc.c b/ghc/lib/std/cbits/filePutc.c index a95cbf1beacc2bfe9d043ac0cac8b009f6e76092..f9bacd60be70f214f9ef427bcb5aec9a8b5da77d 100644 --- a/ghc/lib/std/cbits/filePutc.c +++ b/ghc/lib/std/cbits/filePutc.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: filePutc.c,v 1.10 1999/11/26 16:25:56 simonmar Exp $ + * $Id: filePutc.c,v 1.11 1999/12/08 15:47:07 simonmar Exp $ * * hPutChar Runtime Support */ @@ -76,19 +76,19 @@ filePutc(StgForeignPtr ptr, StgChar c) } /* Unbuffered, write the character directly. */ - while (rc = ( + while ((rc = ( #ifdef USE_WINSOCK fo->flags & FILEOBJ_WINSOCK ? send(fo->fd, &c, 1, 0) : - write(fo->fd, &c, 1)) <= 0) { + write(fo->fd, &c, 1))) <= 0) { #else - write(fo->fd, &c, 1)) <= 0) { + write(fo->fd, &c, 1))) <= 0) { #endif if ( rc == -1 && errno == EAGAIN) { errno = 0; return FILEOBJ_BLOCKED_WRITE; - } else if (rc == 0 || rc == -1 && errno != EINTR) { + } else if (rc == 0 || (rc == -1 && errno != EINTR)) { cvtErrno(); stdErrno(); return -1; diff --git a/ghc/lib/std/cbits/getLock.c b/ghc/lib/std/cbits/getLock.c index 9d392c3ea74fc409e4a57924d6e790b68b4c1da3..748ff6562b537ed9094556a364c151d5bca3ba45 100644 --- a/ghc/lib/std/cbits/getLock.c +++ b/ghc/lib/std/cbits/getLock.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: getLock.c,v 1.6 1999/05/05 10:33:16 sof Exp $ + * $Id: getLock.c,v 1.7 1999/12/08 15:47:07 simonmar Exp $ * * stdin/stout/stderr Runtime Support */ @@ -134,7 +134,7 @@ int unlockFile(fd) int fd; { - int i, rc; + int i; for (i = 0; i < readLocks; i++) if (readLock[i].fd == fd) { diff --git a/ghc/lib/std/cbits/inputReady.c b/ghc/lib/std/cbits/inputReady.c index c1af5cc860fba4912c78eb43be5ab455e9060533..a7f1068ef03b37cf8cdb218b24385d171387bd3f 100644 --- a/ghc/lib/std/cbits/inputReady.c +++ b/ghc/lib/std/cbits/inputReady.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: inputReady.c,v 1.5 1999/09/12 16:24:46 sof Exp $ + * $Id: inputReady.c,v 1.6 1999/12/08 15:47:08 simonmar Exp $ * * hReady Runtime Support */ @@ -56,7 +56,7 @@ StgForeignPtr ptr; StgInt msecs; { IOFileObject* fo = (IOFileObject*)ptr; - int c, fd, maxfd, ready; + int fd, maxfd, ready; #ifndef mingw32_TARGET_OS fd_set rfd; struct timeval tv; diff --git a/ghc/lib/std/cbits/openFile.c b/ghc/lib/std/cbits/openFile.c index 5be41540e07d64dfbd191c1f5447e2d37e79dd92..718f04efd2c29b3f1634d237337b22eb95c6f044 100644 --- a/ghc/lib/std/cbits/openFile.c +++ b/ghc/lib/std/cbits/openFile.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: openFile.c,v 1.13 1999/12/08 14:04:32 simonmar Exp $ + * $Id: openFile.c,v 1.14 1999/12/08 15:47:08 simonmar Exp $ * * openFile Runtime Support */ @@ -33,9 +33,7 @@ #endif IOFileObject* -openStdFile(fd,rd) -StgInt fd; -StgInt rd; +openStdFile(StgInt fd, StgInt rd) { IOFileObject* fo; long fd_flags; @@ -69,12 +67,8 @@ StgInt rd; #define OPENFILE_READ_WRITE 3 IOFileObject* -openFile(file, how, binary) -StgByteArray file; -StgInt how; -StgInt binary; +openFile(StgByteArray file, StgInt how, StgInt binary) { - FILE *fp; int fd; int oflags; int for_writing; @@ -290,10 +284,9 @@ StgInt binary; /* `Lock' file descriptor and return file object. */ IOFileObject* -openFd(StgInt fd,StgInt oflags,StgInt flags) +openFd(StgInt fd, StgInt oflags, StgInt flags) { int for_writing; - FILE* fp; IOFileObject* fo; for_writing = ( ((oflags & O_WRONLY) || (oflags & O_RDWR)) ? 1 : 0); diff --git a/ghc/lib/std/cbits/readFile.c b/ghc/lib/std/cbits/readFile.c index c47b56cfd978921f39a2d882c5d623092776a49c..8c3be1437d7484df95445bd32db68e0de63545e1 100644 --- a/ghc/lib/std/cbits/readFile.c +++ b/ghc/lib/std/cbits/readFile.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: readFile.c,v 1.8 1999/09/16 13:14:43 simonmar Exp $ + * $Id: readFile.c,v 1.9 1999/12/08 15:47:08 simonmar Exp $ * * hGetContents Runtime Support */ @@ -211,7 +211,6 @@ readLine(ptr) StgForeignPtr ptr; { IOFileObject* fo = (IOFileObject*)ptr; - char *s; int rc=0, count; /* Check if someone hasn't zapped us */ diff --git a/ghc/lib/std/cbits/stgio.h b/ghc/lib/std/cbits/stgio.h index a80db36cad1ba326ee69b16c44a406bba864e552..fcda1810014ac132ae40d872e6386e17daebe071 100644 --- a/ghc/lib/std/cbits/stgio.h +++ b/ghc/lib/std/cbits/stgio.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: stgio.h,v 1.15 1999/11/26 16:25:56 simonmar Exp $ + * $Id: stgio.h,v 1.16 1999/12/08 15:47:08 simonmar Exp $ * * (c) The GRASP/AQUA Project, Glasgow University, 1994-1999 * @@ -199,22 +199,22 @@ StgInt showTime (StgInt, StgByteArray, StgInt, StgByteArray); StgInt systemCmd (StgByteArray); /* timezone.c */ -StgInt get_tm_sec ( StgAddr ); -StgInt get_tm_min ( StgAddr ); -StgInt get_tm_hour ( StgAddr ); -StgInt get_tm_mday ( StgAddr ); -StgInt get_tm_mon ( StgAddr ); -StgInt get_tm_year ( StgAddr ); -StgInt get_tm_wday ( StgAddr ); -StgInt get_tm_yday ( StgAddr ); -StgInt get_tm_isdst ( StgAddr ); -StgAddr prim_ZONE ( StgAddr ); -StgInt prim_GMTOFF ( StgAddr ); -StgInt prim_SETZONE ( StgAddr, StgAddr ); -StgInt sizeof_word ( void ); -StgInt sizeof_struct_tm ( void ); -StgInt sizeof_time_t ( void ); -char* get_ZONE ( StgAddr ); +StgInt get_tm_sec ( StgAddr ); +StgInt get_tm_min ( StgAddr ); +StgInt get_tm_hour ( StgAddr ); +StgInt get_tm_mday ( StgAddr ); +StgInt get_tm_mon ( StgAddr ); +StgInt get_tm_year ( StgAddr ); +StgInt get_tm_wday ( StgAddr ); +StgInt get_tm_yday ( StgAddr ); +StgInt get_tm_isdst ( StgAddr ); +StgAddr prim_ZONE ( StgAddr ); +StgInt prim_GMTOFF ( StgAddr ); +void prim_SETZONE ( StgAddr, StgAddr ); +StgInt sizeof_word ( void ); +StgInt sizeof_struct_tm ( void ); +StgInt sizeof_time_t ( void ); +char* get_ZONE ( StgAddr ); /* toLocalTime.c */ StgAddr toLocalTime (StgInt, StgByteArray, StgByteArray); diff --git a/ghc/lib/std/cbits/system.c b/ghc/lib/std/cbits/system.c index 2349ea7c3ca4cb4ddb1c0960a1a81beb66143abd..7779139b4b1d465cf0cb9fdc9b12f60e601cf9a5 100644 --- a/ghc/lib/std/cbits/system.c +++ b/ghc/lib/std/cbits/system.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: system.c,v 1.5 1999/03/01 08:57:57 sof Exp $ + * $Id: system.c,v 1.6 1999/12/08 15:47:08 simonmar Exp $ * * system Runtime Support */ @@ -28,8 +28,7 @@ #endif StgInt -systemCmd(cmd) -StgByteArray cmd; +systemCmd(StgByteArray cmd) { #if defined(mingw32_TARGET_OS) if (system(cmd) < 0) { diff --git a/ghc/lib/std/cbits/timezone.c b/ghc/lib/std/cbits/timezone.c index 2866508ca7dd30a49c824db12621833bae5c4bc5..a54bc1de49b0f19cae5542d4d47c21a72741b5b7 100644 --- a/ghc/lib/std/cbits/timezone.c +++ b/ghc/lib/std/cbits/timezone.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: timezone.c,v 1.5 1999/09/19 19:22:14 sof Exp $ + * $Id: timezone.c,v 1.6 1999/12/08 15:47:08 simonmar Exp $ * * Timezone Runtime Support */ @@ -22,7 +22,8 @@ StgInt get_tm_isdst ( StgAddr x ) { return ((struct tm*)x)->tm_isdst; } StgAddr prim_ZONE ( StgAddr x ) { return ZONE(x); } StgInt prim_GMTOFF ( StgAddr x ) { return GMTOFF(x); } -StgInt prim_SETZONE ( StgAddr x, StgAddr y ) +void +prim_SETZONE ( StgAddr x, StgAddr y ) { SETZONE(x,y); } diff --git a/ghc/lib/std/cbits/writeFile.c b/ghc/lib/std/cbits/writeFile.c index 108ce99229fa2641b608a074a8a05f91898b3550..5255ea91ebb3839eda8a0117e36a604ba7d4533e 100644 --- a/ghc/lib/std/cbits/writeFile.c +++ b/ghc/lib/std/cbits/writeFile.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: writeFile.c,v 1.11 1999/11/26 16:25:57 simonmar Exp $ + * $Id: writeFile.c,v 1.12 1999/12/08 15:47:08 simonmar Exp $ * * hPutStr Runtime Support */ @@ -23,8 +23,6 @@ writeFileObject(StgForeignPtr ptr, StgInt bytes) int rc=0; IOFileObject* fo = (IOFileObject*)ptr; - char *p = (char *) fo->buf; - /* If we've got a r/w file object in our hand, flush the (input) buffer contents first. */ @@ -40,7 +38,7 @@ writeFileObject(StgForeignPtr ptr, StgInt bytes) StgInt writeBuffer(StgForeignPtr ptr, StgInt bytes) { - int count, rc=0; + int count; IOFileObject* fo = (IOFileObject*)ptr; char *pBuf = (char *) fo->buf + fo->bufStart;