[m-rev.] trivial diff: avoid gcc warnings in runtime

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Nov 30 15:13:40 AEDT 2006


Estimated hours taken: 0.5
Branches: main

Shut up some gcc warnings in runtime.

runtime/mercury_table_type_body.h:
runtime/mercury_tabling_macros.h:
 	Cast some values to longs in order to avoid gcc warnings in
 	some of the table debugging code on platforms where
 	sizeof(MR_Word) == sizeof(long).

Julien.

Index: mercury_table_type_body.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_table_type_body.h,v
retrieving revision 1.1
diff -u -r1.1 mercury_table_type_body.h
--- mercury_table_type_body.h	8 Jun 2006 08:20:00 -0000	1.1
+++ mercury_table_type_body.h	30 Nov 2006 04:06:40 -0000
@@ -22,8 +22,8 @@
      type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info);

      if (DEBUG && MR_tabledebug) {
-        printf("ENTRY %p %x, data rep: %d\n",
-            table, data, MR_type_ctor_rep(type_ctor_info));
+        printf("ENTRY %p %lx, data rep: %d\n",
+            table, (long) data, MR_type_ctor_rep(type_ctor_info));
      }

      if (! MR_type_ctor_has_valid_rep(type_ctor_info)) {
Index: mercury_tabling_macros.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling_macros.h,v
retrieving revision 1.13
diff -u -r1.13 mercury_tabling_macros.h
--- mercury_tabling_macros.h	8 Jun 2006 08:20:01 -0000	1.13
+++ mercury_tabling_macros.h	30 Nov 2006 04:12:36 -0000
@@ -111,8 +111,8 @@
              (t) = MR_RAW_TABLE_ANY((t0), (type_info), (value));             \
          }                                                                   \
          if (debug && MR_tabledebug) {                                       \
-            printf("TABLE %p: any %x type %p => %p\n",                      \
-                (t0), (value), (type_info), (t));                           \
+            printf("TABLE %p: any %lx type %p => %p\n",                     \
+                (t0), (long) (value), (type_info), (t));                    \
          }                                                                   \
      } while (0)

@@ -125,8 +125,8 @@
              (t) = MR_RAW_TABLE_ANY_ADDR((t0), (type_info), (value));        \
          }                                                                   \
          if (debug && MR_tabledebug) {                                       \
-            printf("TABLE %p: any %x type %p => %p\n",                      \
-                (t0), (value), (type_info), (t));                           \
+            printf("TABLE %p: any %lx type %p => %p\n",                     \
+                (t0), (long) (value), (type_info), (t));                    \
          }                                                                   \
      } while (0)

@@ -151,8 +151,8 @@
              (t) = MR_RAW_TABLE_ENUM((t0), (count), (value));                \
          }                                                                   \
          if (debug && MR_tabledebug) {                                       \
-            printf("TABLE %p: enum %d of %d => %p\n",                       \
-                (t0), (value), (count), (t));                               \
+            printf("TABLE %p: enum %ld of %ld => %p\n",                     \
+                (t0), (long) (value), (long) (count), (t));                 \
          }                                                                   \
      } while (0)

@@ -165,8 +165,8 @@
              (t) = MR_RAW_TABLE_START_INT((t0), (start), (value));           \
          }                                                                   \
          if (debug && MR_tabledebug) {                                       \
-            printf("TABLE %p: int %d - %d => %p\n",                         \
-                (t0), (value), (start), (t));                               \
+            printf("TABLE %p: int %ld - %ld => %p\n",                       \
+                (t0), (long) (value), (long) (start), (t));                 \
          }                                                                   \
      } while (0)

@@ -178,8 +178,8 @@
              (t) = MR_RAW_TABLE_WORD((t0), (value));                         \
          }                                                                   \
          if (debug && MR_tabledebug) {                                       \
-            printf("TABLE %p: word %d => %p\n",                             \
-                (t0), (value), (t));                                        \
+            printf("TABLE %p: word %ld => %p\n",                            \
+                (t0), (long) (value), (t));                                 \
          }                                                                   \
      } while (0)

@@ -191,8 +191,8 @@
              (t) = MR_RAW_TABLE_INT((t0), (value));                          \
          }                                                                   \
          if (MR_tabledebug) {                                                \
-            printf("TABLE %p: int %d => %p\n",                              \
-                (t0), (value), (t));                                        \
+            printf("TABLE %p: int %ld => %p\n",                             \
+                (t0), (long) (value), (t));                                 \
          }                                                                   \
      } while (0)


--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list