[MLton-commit] r4208

Matthew Fluet MLton@mlton.org
Sat, 12 Nov 2005 09:29:49 -0800


Fixed some warnings with  -m64  compilations.

Exclude -fomit-frame-pointer from debug libs; the debugger is almost
useless without the frame pointer.


----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U   mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/profile.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/Ptrace.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/mmap.c

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile	2005-11-12 16:25:21 UTC (rev 4207)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile	2005-11-12 17:29:46 UTC (rev 4208)
@@ -14,7 +14,8 @@
 GCC_VERSION = 							\
 	$(shell gcc -v 2>&1 | grep 'gcc version' | sed 's/.*gcc version \(.\).*/\1/')
 
-FLAGS = -fomit-frame-pointer
+FLAGS =
+OPTFLAGS = -fomit-frame-pointer
 
 ifeq ($(TARGET_ARCH), x86)
 ifneq ($(findstring $(GCC_VERSION), 3 4),)
@@ -25,15 +26,15 @@
 endif
 
 ifeq ($(TARGET_ARCH), amd64)
-FLAGS += -mtune=opteron -m32
+FLAGS += -m32 -mtune=opteron
 endif
 
 ifeq ($(TARGET_ARCH), sparc)
-FLAGS += -mcpu=v8 -m32
+FLAGS += -m32 -mcpu=v8 
 endif
 
 ifeq ($(TARGET_OS), solaris)
-FLAGS += -Wa,-xarch=v8plusa -funroll-all-loops -mcpu=ultrasparc
+FLAGS += -Wa,-xarch=v8plusa -mcpu=ultrasparc -funroll-all-loops
 endif
 
 ifeq ($(TARGET), self)
@@ -46,8 +47,9 @@
 endif
 
 CC = gcc -std=gnu99
-CFLAGS = -O2 -Wall -I. -Iplatform -D_FILE_OFFSET_BITS=64 $(FLAGS)
-DEBUGFLAGS = $(CFLAGS) -gstabs+ -g2
+CFLAGS = -Wall -I. -Iplatform -D_FILE_OFFSET_BITS=64 $(FLAGS)
+OPTCFLAGS = $(CFLAGS) -O2 $(OPTFLAGS)
+DEBUGCFLAGS = $(CFLAGS) -gstabs+ -g2 -O1 -DASSERT=1
 WARNFLAGS = -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function \
 	-Wformat-nonliteral \
 	-Wuninitialized -Winit-self \
@@ -65,7 +67,8 @@
 #	-Wshadow \
 #	-Wmissing-prototypes \
 #	-Wmissing-declarations 
-DEBUGWARNFLAGS = $(DEBUGFLAGS) $(WARNFLAGS) -Wunused
+OPTWARNFLAGS = $(WARNFLAGS)
+DEBUGWARNFLAGS = $(WARNFLAGS) -Wunused
 
 UTILCFILES =							\
 	$(shell find util -type f | grep '\.c$$')
@@ -124,7 +127,7 @@
 
 libgdtoa.a: gdtoa/arith.h
 	cd gdtoa && 					\
-		$(CC) $(CFLAGS) $(WARNFLAGS)		\
+		$(CC) $(OPTCFLAGS) $(OPTWARNFLAGS)	\
 			-Dstrtod=gdtoa_strtod		\
 			-Dstrtof=gdtoa_strtof		\
 			-w -O1 -c -DINFNAN_CHECK 	\
@@ -150,27 +153,28 @@
 	$(AR) libmlton-gdb.a $(DEBUG_OBJS)
 	$(RANLIB) libmlton-gdb.a
 
+
 runtime.c: $(CFILES)
 	cat $(CFILES) >runtime.c
 
 
 util/%-gdb.o: util/%.c util.h $(UTILHFILES)
-	$(CC) $(DEBUGFLAGS) $(DEBUGWARNFLAGS) -O1 -DASSERT=1 -c -o $@ $<
+	$(CC) $(DEBUGCFLAGS) $(DEBUGWARNFLAGS) -c -o $@ $<
 
 util/%.o: util/%.c util.h $(UTILHFILES)
-	$(CC) $(CFLAGS) $(WARNFLAGS) -c -o $@ $<
+	$(CC) $(OPTCFLAGS) $(OPTWARNFLAGS) -c -o $@ $<
 
 types.h: gen/gen-types.c util.h $(UTILOFILES)
 	rm -f types.h
-	$(CC) $(CFLAGS) $(WARNFLAGS) -o gen-types gen/gen-types.c $(UTILOFILES)
+	$(CC) $(OPTCFLAGS) $(OPTWARNFLAGS) -o gen-types gen/gen-types.c $(UTILOFILES)
 	./gen-types
 	rm -f gen-types
 
 gc-gdb.o: gc.c $(GCCFILES) $(HFILES) 
-	$(CC) $(DEBUGFLAGS) $(DEBUGWARNFLAGS) -O1 -DASSERT=1 -c -o $@ $<
+	$(CC) $(DEBUGCFLAGS) $(DEBUGWARNFLAGS) -c -o $@ $<
 
 gc.o: gc.c $(GCCFILES) $(HFILES) 
-	$(CC) $(CFLAGS) $(WARNFLAGS) -c -o $@ $<
+	$(CC) $(OPTCFLAGS) $(OPTWARNFLAGS) -c -o $@ $<
 
 # It looks like we don't follow the C spec w.r.t. aliasing.  And gcc
 # -O2 catches us on the code in Real/*.c where we treat a double as a
@@ -179,21 +183,21 @@
 # with -fno-strict-aliasing to prevent gcc from taking advantage of
 # this aspect of the C spec.
 basis/Real/%-gdb.o: basis/Real/%.c gdtoa/arith.h
-	$(CC) $(DEBUGFLAGS) $(WARNFLAGS) -O1 -DASSERT=1 -c -o $@ $<
+	$(CC) $(DEBUGCFLAGS) $(DEBUGWARNFLAGS) -c -o $@ $<
 basis/Real/%.o: basis/Real/%.c gdtoa/arith.h
-	$(CC) $(CFLAGS) $(DEBUGWARNFLAGS) -O1 -fno-strict-aliasing -c -o $@ $<
+	$(CC) $(OPTCFLAGS) $(OPTWARNFLAGS) -O1 -fno-strict-aliasing -c -o $@ $<
 
 %-gdb.o: %.c $(HFILES)
-	$(CC) $(DEBUGFLAGS) -O1 -DASSERT=1 -c -o $@ $<
+	$(CC) $(DEBUGCFLAGS) -c -o $@ $<
 
 %.o: %.c $(HFILES)
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(OPTCFLAGS) -c -o $@ $<
 
 %-gdb.o: %.S
-	$(CC) $(DEBUGFLAGS) -c -o $@ $<
+	$(CC) $(DEBUGCFLAGS) -c -o $@ $<
 
 %.o: %.S
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(OPTCFLAGS) -c -o $@ $<
 
 .PHONY: clean
 clean:

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c	2005-11-12 16:25:21 UTC (rev 4207)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/write.c	2005-11-12 17:29:46 UTC (rev 4208)
@@ -9,7 +9,7 @@
         
         res = (Ssize)(write (fd, (void *) ((char *) b + i), s));
         if (DEBUG_WRITE)
-                fprintf (stderr, "%d = Posix_IO_write (%d, 0x%08x, %d, %d)\n",
-                                (int)res, (int)fd, (uint)b, (int)i, (int)s);
+                fprintf (stderr, "%d = Posix_IO_write (%d, "FMTPTR", %d, %d)\n",
+                                (int)res, (int)fd, (uintptr_t)b, (int)i, (int)s);
         return res;
 }

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c	2005-11-12 16:25:21 UTC (rev 4207)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c	2005-11-12 17:29:46 UTC (rev 4208)
@@ -95,8 +95,8 @@
 void Date_localTime(Pointer p) {
         tmp = localtime((time_t*)p);
         if (DEBUG)
-                fprintf (stderr, "0x%08x = Date_localTime (0x%08x)\n", 
-                                (unsigned int)tmp, (unsigned int)p);
+                fprintf (stderr, FMTPTR" = Date_localTime ("FMTPTR")\n", 
+                                (uintptr_t)tmp, (uintptr_t)p);
 }
 
 Int Date_mkTime() {

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word.c	2005-11-12 16:25:21 UTC (rev 4207)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word.c	2005-11-12 17:29:46 UTC (rev 4208)
@@ -28,7 +28,7 @@
 #define DEBUG FALSE
 #endif
 
-#if ! (defined (__hppa__) || defined (__i386__) || defined (__ppc__) || defined (__powerpc__) || defined (__sparc__))
+#if ! (defined (__amd64__) || defined (__hppa__) || defined (__i386__) || defined (__ppc__) || defined (__powerpc__) || defined (__sparc__))
 #error check that C {/,%} correctly implement {quot,rem} from the basis library
 #endif
 

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c	2005-11-12 16:25:21 UTC (rev 4207)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c	2005-11-12 17:29:46 UTC (rev 4208)
@@ -20,16 +20,16 @@
 /*
  * Test if a intInf is a fixnum.
  */
-static inline uint isSmall (pointer arg) {
-        return ((uint)arg & 1);
+static inline bool isSmall (pointer arg) {
+        return ((uintptr_t)arg & 1);
 }
 
-static inline uint eitherIsSmall (pointer arg1, pointer arg2) {
-        return (1 & ((uint)arg1 | (uint)arg2));
+static inline bool eitherIsSmall (pointer arg1, pointer arg2) {
+        return (((uintptr_t)arg1 | (uintptr_t)arg2) & 1);
 }
 
-static inline uint areSmall (pointer arg1, pointer arg2) {
-        return ((uint)arg1 & (uint)arg2 & 1);
+static inline bool areSmall (pointer arg1, pointer arg2) {
+        return ((uintptr_t)arg1 & (uintptr_t)arg2 & 1);
 }
 
 /*
@@ -39,7 +39,7 @@
         GC_intInf bp;
 
         assert(not isSmall(arg));
-        bp = (GC_intInf)((uint)arg - offsetof(struct GC_intInf, isneg));
+        bp = (GC_intInf)(arg - offsetof(struct GC_intInf, isneg));
         if (DEBUG_INT_INF)
                 fprintf (stderr, "bp->header = 0x%08x\n", bp->header);
         assert (bp->header == GC_INTINF_HEADER);
@@ -54,8 +54,8 @@
         GC_intInf bp;
 
         if (DEBUG_INT_INF)
-                fprintf (stderr, "fill (0x%08x, 0x%08x, 0x%08x)\n",
-                                (uint)arg, (uint)res, (uint)space);
+                fprintf (stderr, "fill ("FMTPTR", "FMTPTR", "FMTPTR")\n",
+                                (uintptr_t)arg, (uintptr_t)res, (uintptr_t)space);
         if (isSmall(arg)) {
                 res->_mp_alloc = 2;
                 res->_mp_d = space;
@@ -185,50 +185,50 @@
 
 pointer IntInf_add (pointer lhs, pointer rhs, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_add (0x%08x, 0x%08x, %u)\n",
-                                (uint)lhs, (uint)rhs, bytes);
+                fprintf (stderr, "IntInf_add ("FMTPTR", "FMTPTR", %u)\n",
+                                (uintptr_t)lhs, (uintptr_t)rhs, bytes);
         return binary (lhs, rhs, bytes, &mpz_add);
 }
 
 pointer IntInf_gcd (pointer lhs, pointer rhs, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_gcd (0x%08x, 0x%08x, %u)\n",
-                                (uint)lhs, (uint)rhs, bytes);
+                fprintf (stderr, "IntInf_gcd ("FMTPTR", "FMTPTR", %u)\n",
+                                (uintptr_t)lhs, (uintptr_t)rhs, bytes);
         return binary (lhs, rhs, bytes, &mpz_gcd);
 }
 
 pointer IntInf_mul (pointer lhs, pointer rhs, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_mul (0x%08x, 0x%08x, %u)\n",
-                                (uint)lhs, (uint)rhs, bytes);
+                fprintf (stderr, "IntInf_mul ("FMTPTR", "FMTPTR", %u)\n",
+                                (uintptr_t)lhs, (uintptr_t)rhs, bytes);
         return binary (lhs, rhs, bytes, &mpz_mul);
 }
 
 pointer IntInf_sub (pointer lhs, pointer rhs, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_sub (0x%08x, 0x%08x, %u)\n",
-                                (uint)lhs, (uint)rhs, bytes);
+                fprintf (stderr, "IntInf_sub ("FMTPTR", "FMTPTR", %u)\n",
+                                (uintptr_t)lhs, (uintptr_t)rhs, bytes);
         return binary (lhs, rhs, bytes, &mpz_sub);
 }
 
 pointer IntInf_andb(pointer lhs, pointer rhs, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_andb (0x%08x, 0x%08x, %u)\n",
-                                (uint)lhs, (uint)rhs, bytes);
+                fprintf (stderr, "IntInf_andb ("FMTPTR", "FMTPTR", %u)\n",
+                                (uintptr_t)lhs, (uintptr_t)rhs, bytes);
         return binary(lhs, rhs, bytes, &mpz_and);
 }
 
 pointer IntInf_orb(pointer lhs, pointer rhs, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_orb (0x%08x, 0x%08x, %u)\n",
-                                (uint)lhs, (uint)rhs, bytes);
+                fprintf (stderr, "IntInf_orb ("FMTPTR", "FMTPTR", %u)\n",
+                                (uintptr_t)lhs, (uintptr_t)rhs, bytes);
         return binary(lhs, rhs, bytes, &mpz_ior);
 }
 
 pointer IntInf_xorb(pointer lhs, pointer rhs, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_xorb (0x%08x, 0x%08x, %u)\n",
-                                (uint)lhs, (uint)rhs, bytes);
+                fprintf (stderr, "IntInf_xorb ("FMTPTR", "FMTPTR", %u)\n",
+                                (uintptr_t)lhs, (uintptr_t)rhs, bytes);
         return binary(lhs, rhs, bytes, &mpz_xor);
 }
 
@@ -249,15 +249,15 @@
 
 pointer IntInf_neg(pointer arg, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_neg (0x%08x, %u)\n",
-                                (uint)arg, bytes);
+                fprintf (stderr, "IntInf_neg ("FMTPTR", %u)\n",
+                                (uintptr_t)arg, bytes);
         return unary(arg, bytes, &mpz_neg);
 }
 
 pointer IntInf_notb(pointer arg, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_notb (0x%08x, %u)\n",
-                                (uint)arg, bytes);
+                fprintf (stderr, "IntInf_notb ("FMTPTR", %u)\n",
+                                (uintptr_t)arg, bytes);
         return unary(arg, bytes, &mpz_com);
 }
 
@@ -279,15 +279,15 @@
 
 pointer IntInf_arshift(pointer arg, uint shift, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_arshift (0x%08x, %u, %u)\n",
-                                (uint)arg, shift, bytes);
+                fprintf (stderr, "IntInf_arshift ("FMTPTR", %u, %u)\n",
+                                (uintptr_t)arg, shift, bytes);
         return shary(arg, shift, bytes, &mpz_fdiv_q_2exp);
 }
 
 pointer IntInf_lshift(pointer arg, uint shift, uint bytes) {
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_lshift (0x%08x, %u, %u)\n",
-                                (uint)arg, shift, bytes);
+                fprintf (stderr, "IntInf_lshift ("FMTPTR", %u, %u)\n",
+                                (uintptr_t)arg, shift, bytes);
         return shary(arg, shift, bytes, &mpz_mul_2exp);
 }
 
@@ -312,8 +312,8 @@
                                 rhsspace[2];
 
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_compare (0x%08x, 0x%08x)\n",
-                                (uint)lhs, (uint)rhs);
+                fprintf (stderr, "IntInf_compare ("FMTPTR", "FMTPTR")\n",
+                                (uintptr_t)lhs, (uintptr_t)rhs);
         fill (lhs, &lhsmpz, lhsspace);
         fill (rhs, &rhsmpz, rhsspace);
         return mpz_cmp (&lhsmpz, &rhsmpz);
@@ -346,8 +346,8 @@
         char            c;
 
         if (DEBUG_INT_INF)
-                fprintf (stderr, "IntInf_toString (0x%08x, %d, %u)\n",
-                                (uint)arg, base, bytes);
+                fprintf (stderr, "IntInf_toString ("FMTPTR", %d, %u)\n",
+                                (uintptr_t)arg, base, bytes);
         assert (base == 2 || base == 8 || base == 10 || base == 16);
         fill (arg, &argmpz, argspace);
         sp = (GC_string)gcState.frontier;

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/profile.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/profile.c	2005-11-12 16:25:21 UTC (rev 4207)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/profile.c	2005-11-12 17:29:46 UTC (rev 4208)
@@ -7,35 +7,37 @@
 extern struct GC_state gcState;
 
 void MLton_Profile_Data_free (Pointer p) {
-        GC_profileFree (&gcState, (GC_profileData)p);
+  GC_profileFree (&gcState, (GC_profileData)p);
 }
 
 Pointer MLton_Profile_Data_malloc (void) {
-        return (Pointer)GC_profileNew (&gcState);
+  return (Pointer)GC_profileNew (&gcState);
 }
 
 void MLton_Profile_Data_write (Pointer p, Word fd) {
-        if (DEBUG_PROFILE)
-                fprintf (stderr, "MLton_Profile_Data_write (0x%08x)\n", (uint)p);
-        GC_profileWrite (&gcState, (GC_profileData)p, (int)fd);
+  if (DEBUG_PROFILE)
+    fprintf (stderr, "MLton_Profile_Data_write ("FMTPTR")\n", 
+             (uintptr_t)p);
+  GC_profileWrite (&gcState, (GC_profileData)p, (int)fd);
 }
 
 Pointer MLton_Profile_current (void) {
-        Pointer res;
-
-        res = (Pointer)(GC_getProfileCurrent (&gcState));
-        if (DEBUG_PROFILE)
-                fprintf (stderr, "0x%08x = MLton_Profile_current ()\n", 
-                                (uint)res);
-        return res;
+  Pointer res;
+  
+  res = (Pointer)(GC_getProfileCurrent (&gcState));
+  if (DEBUG_PROFILE)
+    fprintf (stderr, FMTPTR" = MLton_Profile_current ()\n", 
+             (uintptr_t)res);
+  return res;
 }
 
 void MLton_Profile_setCurrent (Pointer d) {
-        if (DEBUG_PROFILE)
-                fprintf (stderr, "MLton_Profile_setCurrent (0x%08x)\n", (uint)d);
-        GC_setProfileCurrent (&gcState, (GC_profileData)d);
+  if (DEBUG_PROFILE)
+    fprintf (stderr, "MLton_Profile_setCurrent ("FMTPTR")\n", 
+             (uintptr_t)d);
+  GC_setProfileCurrent (&gcState, (GC_profileData)d);
 }
 
 void MLton_Profile_done () {
-        GC_profileDone (&gcState);
+  GC_profileDone (&gcState);
 }

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c	2005-11-12 16:25:21 UTC (rev 4207)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c	2005-11-12 17:29:46 UTC (rev 4208)
@@ -3,52 +3,55 @@
 extern struct GC_state gcState;
 
 enum {
-        DEBUG_THREAD = FALSE,
+  DEBUG_THREAD = FALSE,
 };
 
 Pointer Thread_current () {
-        Pointer t;
-
-        t = (Pointer)(GC_getCurrentThread (&gcState));
-        if (DEBUG_THREAD)
-                fprintf (stderr, "0x%08x = Thread_current ()\n", (uint)t);
-        return t;
+  Pointer t;
+  
+  t = (Pointer)(GC_getCurrentThread (&gcState));
+  if (DEBUG_THREAD)
+    fprintf (stderr, FMTPTR" = Thread_current ()\n", 
+             (uintptr_t)t);
+  return t;
 }
 
 void Thread_finishSignalHandler () {
-        GC_finishSignalHandler (&gcState);
+  GC_finishSignalHandler (&gcState);
 }
 
 Pointer Thread_saved () {
-        Pointer t;
-
-        t = (Pointer)(GC_getSavedThread (&gcState));
-        if (DEBUG_THREAD)
-                fprintf (stderr, "0x%08x = Thread_saved ()\n", (uint)t);
-        return t;
+  Pointer t;
+  
+  t = (Pointer)(GC_getSavedThread (&gcState));
+  if (DEBUG_THREAD)
+    fprintf (stderr, FMTPTR" = Thread_saved ()\n", 
+             (uintptr_t)t);
+  return t;
 }
 
 void Thread_setCallFromCHandler (Pointer t) {
-        GC_setCallFromCHandlerThread (&gcState, (GC_thread)t);
+  GC_setCallFromCHandlerThread (&gcState, (GC_thread)t);
 }
 
 void Thread_setSaved (Pointer t) {
-        if (DEBUG_THREAD)
-                fprintf (stderr, "Thread_setSaved (0x%08x)\n", (uint)t);
-        GC_setSavedThread (&gcState, (GC_thread)t);
+  if (DEBUG_THREAD)
+    fprintf (stderr, "Thread_setSaved ("FMTPTR")\n", 
+             (uintptr_t)t);
+  GC_setSavedThread (&gcState, (GC_thread)t);
 }
 
 void Thread_setSignalHandler (Pointer t) {
-        GC_setSignalHandlerThread (&gcState, (GC_thread)t);
+  GC_setSignalHandlerThread (&gcState, (GC_thread)t);
 }
 
 void Thread_startSignalHandler () {
-        GC_startSignalHandler (&gcState);
+  GC_startSignalHandler (&gcState);
 }
 
 void Thread_switchTo (Pointer t, Word ensureBytesFree) {
-        if (DEBUG_THREAD)
-                fprintf (stderr, "Thread_switchTo (0x%08x, %u)\n",
-                                (uint)t, (uint)ensureBytesFree);
-        GC_switchToThread (&gcState, (GC_thread)t, ensureBytesFree);
+  if (DEBUG_THREAD)
+    fprintf (stderr, "Thread_switchTo ("FMTPTR", %u)\n",
+             (uintptr_t)t, (uint)ensureBytesFree);
+  GC_switchToThread (&gcState, (GC_thread)t, ensureBytesFree);
 }

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Ptrace.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Ptrace.c	2005-11-12 16:25:21 UTC (rev 4207)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Ptrace.c	2005-11-12 17:29:46 UTC (rev 4208)
@@ -3,11 +3,11 @@
 #if HAS_PTRACE
 
 Int Ptrace_ptrace2 (Int request, Int pid) {
-        return ptrace (request, pid, 0, 0);
+        return ptrace (request, pid, NULL, NULL);
 }
 
 Int Ptrace_ptrace4 (Int request, Int pid, Word addr, Pointer data) {
-        return ptrace (request, pid, (int) addr, (int) data);
+        return ptrace (request, pid, (void *) addr, (void *) data);
 }
 
 #endif

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mmap.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mmap.c	2005-11-12 16:25:21 UTC (rev 4207)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mmap.c	2005-11-12 17:29:46 UTC (rev 4208)
@@ -5,8 +5,8 @@
 
 static void munmap_safe (void *base, size_t length) {
         if (DEBUG_MEM)
-                fprintf (stderr, "munmap_safe (0x%08x, %s)\n",
-                                (uint)base,
+                fprintf (stderr, "munmap_safe ("FMTPTR", %s)\n",
+                                (uintptr_t)base,
                                 uintmaxToCommaString (length));
         assert (base != NULL);
         if (0 == length)