[MLton-commit] r5908
Ville Laurikari
ville at mlton.org
Mon Aug 20 22:47:27 PDT 2007
Eliminated remaining %zu formatters.
----------------------------------------------------------------------
U mlton/trunk/runtime/gc/generational.c
U mlton/trunk/runtime/gc/generational.h
U mlton/trunk/runtime/util/safe.h
----------------------------------------------------------------------
Modified: mlton/trunk/runtime/gc/generational.c
===================================================================
--- mlton/trunk/runtime/gc/generational.c 2007-08-21 05:17:14 UTC (rev 5907)
+++ mlton/trunk/runtime/gc/generational.c 2007-08-21 05:47:25 UTC (rev 5908)
@@ -28,8 +28,8 @@
fprintf (stderr, "crossMap trues\n");
for (i = 0; i < generational->crossMapLength; i++)
unless (CROSS_MAP_EMPTY == generational->crossMap[i])
- fprintf (stderr, "\t"FMTCMI" "FMTCME" "FMTCME"\n",
- i, generational->crossMap[i],
+ fprintf (stderr, "\t"PRIuMAX" "FMTCME" "FMTCME"\n",
+ (uintmax_t)i, generational->crossMap[i],
CROSS_MAP_OFFSET_SCALE * generational->crossMap[i]);
fprintf (stderr, "\n");
}
@@ -257,12 +257,12 @@
if (DEBUG_GENERATIONAL) {
fprintf (stderr,
"\tloopObjects:\n"
- "\t cardIndex = "FMTCMI"\n"
+ "\t cardIndex = %"PRIuMAX"\n"
"\t cardStart = "FMTPTR"\n"
"\t cardEnd = "FMTPTR"\n"
"\tobjectStart = "FMTPTR"\n"
"\t nextObject = "FMTPTR"\n",
- cardIndex, (uintptr_t)cardStart, (uintptr_t)cardEnd,
+ (uintmax_t)cardIndex, (uintptr_t)cardStart, (uintptr_t)cardEnd,
(uintptr_t)objectStart, (uintptr_t)nextObject);
}
if (nextObject > cardEnd) {
Modified: mlton/trunk/runtime/gc/generational.h
===================================================================
--- mlton/trunk/runtime/gc/generational.h 2007-08-21 05:17:14 UTC (rev 5907)
+++ mlton/trunk/runtime/gc/generational.h 2007-08-21 05:47:25 UTC (rev 5908)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
+/* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
* Copyright (C) 1997-2000 NEC Research Institute.
*
@@ -26,7 +26,6 @@
#define CROSS_MAP_ELEM_SIZE sizeof(GC_crossMapElem)
#define CROSS_MAP_EMPTY ((GC_crossMapElem)255)
#define CROSS_MAP_OFFSET_SCALE 4
-#define FMTCMI "%zu"
#define FMTCME "%"PRIu8
struct GC_generationalMaps {
Modified: mlton/trunk/runtime/util/safe.h
===================================================================
--- mlton/trunk/runtime/util/safe.h 2007-08-21 05:17:14 UTC (rev 5907)
+++ mlton/trunk/runtime/util/safe.h 2007-08-21 05:47:25 UTC (rev 5908)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
+/* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
* Copyright (C) 1997-2000 NEC Research Institute.
*
@@ -11,8 +11,8 @@
res = calloc (count, size);
if (NULL == res)
- die ("calloc (%zu, %zu) failed.\n",
- count, size);
+ die ("calloc (%"PRIuMAX", %"PRIuMAX") failed.\n",
+ (uintmax_t)count, (uintmax_t)size);
return res;
}
@@ -51,19 +51,22 @@
if (feof (f))
fprintf (stderr, "eof\n");
else
- fprintf (stderr, "errno = %d\n", ferror (f));
- diee ("fread ("FMTPTR", %zu, %zu, _) failed (only read %zu).\n",
- (uintptr_t)buf, size, count, res);
+ fprintf (stderr, "errno = %d\n", ferror (f));
+ diee ("fread ("FMTPTR", %"PRIuMAX", %"PRIuMAX", _) failed "
+ "(only read %"PRIuMAX").\n",
+ (uintptr_t)buf, (uintmax_t)size, (uintmax_t)count, (uintmax_t)res);
}
}
-static inline void fwrite_safe (const void *buf, size_t size, size_t count, FILE *f) {
+static inline void fwrite_safe (const void *buf, size_t size, size_t count,
+ FILE *f) {
size_t res;
res = fwrite (buf, size, count, f);
if (res != count)
- diee ("fwrite (_, %zu, %zu, _) failed (only wrote %zu).\n",
- size, count, res);
+ diee ("fwrite (_, %"PRIuMAX", %"PRIuMAX", _) failed "
+ "(only wrote %"PRIuMAX").\n",
+ (uintmax_t)size, (uintmax_t)count, (uintmax_t)res);
}
static inline void *malloc_safe (size_t size) {
@@ -71,7 +74,7 @@
res = malloc (size);
if (NULL == res)
- die ("malloc (%zu) failed.\n", size);
+ die ("malloc (%"PRIuMAX") failed.\n", (uintmax_t)size);
return res;
}
More information about the MLton-commit
mailing list