[MLton-commit] r6681

Wesley Terpstra wesley at mlton.org
Thu Jul 31 08:49:13 PDT 2008


Quell some warnings in the C codegen.

Vector is already defined in ml-types, so use NewVector.
Cast pointers to their correct types.


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

U   mlton/trunk/include/common-main.h
U   mlton/trunk/mlton/codegen/c-codegen/c-codegen.fun

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

Modified: mlton/trunk/include/common-main.h
===================================================================
--- mlton/trunk/include/common-main.h	2008-07-31 02:24:16 UTC (rev 6680)
+++ mlton/trunk/include/common-main.h	2008-07-31 15:49:11 UTC (rev 6681)
@@ -29,7 +29,7 @@
 #define EndIntInfs };
 
 #define BeginVectors static struct GC_vectorInit vectorInits[] = {
-#define Vector(a, b, c, d) { a, b, c, d },
+#define NewVector(a, b, c, d) { (pointer)a, b, c, d },
 #define EndVectors };
 
 #define LoadArray(a, f) if (fread (a, sizeof(*a), cardof(a), f) != cardof(a)) return -1;
@@ -38,13 +38,13 @@
 INTERNAL Pointer gcStateAddress;
 
 #define Initialize(al, mg, mfs, mmc, pk, ps)                            \
-        gcStateAddress = &gcState;                                      \
+        gcStateAddress = (pointer)&gcState;                             \
         gcState.alignment = al;                                         \
         gcState.atMLtons = atMLtons;                                    \
         gcState.atMLtonsLength = cardof(atMLtons);                      \
         gcState.frameLayouts = frameLayouts;                            \
         gcState.frameLayoutsLength = cardof(frameLayouts);              \
-        gcState.globals = globalObjptr;                                 \
+        gcState.globals = (objptr*)globalObjptr;                        \
         gcState.globalsLength = cardof(globalObjptr);                   \
         gcState.intInfInits = intInfInits;                              \
         gcState.intInfInitsLength = cardof(intInfInits);                \

Modified: mlton/trunk/mlton/codegen/c-codegen/c-codegen.fun
===================================================================
--- mlton/trunk/mlton/codegen/c-codegen/c-codegen.fun	2008-07-31 02:24:16 UTC (rev 6680)
+++ mlton/trunk/mlton/codegen/c-codegen/c-codegen.fun	2008-07-31 15:49:11 UTC (rev 6681)
@@ -279,7 +279,7 @@
          (print "BeginVectors\n"
           ; (List.foreach
              (vectors, fn (g, v) =>
-              (C.callNoSemi ("Vector",
+              (C.callNoSemi ("NewVector",
                              [C.string (WordXVector.toString v),
                               C.int (Bytes.toInt
                                      (WordSize.bytes




More information about the MLton-commit mailing list