[m-rev.] diff: fix C compiler warnings

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Jan 7 03:02:13 AEDT 2011


Branches: main, 11.01

runtime/mercury_wrapper.c:
 	Fix incorrect conversion specifiers on 32-bit
 	machines.

 	MR_LL_PARALLEL_CONJ implies MR_THREAD_SAFE so
 	there is no need to specify both.

trace/mercury_event_parser.y:
 	Avoid a C compiler warning on Cygwin.

Julien.

Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.214
diff -u -r1.214 mercury_wrapper.c
--- runtime/mercury_wrapper.c	6 Jan 2011 13:40:12 -0000	1.214
+++ runtime/mercury_wrapper.c	6 Jan 2011 15:49:00 -0000
@@ -1802,8 +1802,8 @@
                  break;

              case MR_RUNTIME_GRANULAITY_WSDEQUE_LENGTH_FACTOR:
-#if defined(MR_THREAD_SAFE) && defined(MR_LL_PARALLEL_CONJ)
-                if (sscanf(MR_optarg, "%lu",
+#if defined(MR_LL_PARALLEL_CONJ)
+                if (sscanf(MR_optarg, "%"MR_INTEGER_LENGTH_MODIFIER"u",
                          &MR_granularity_wsdeque_length_factor) != 1)
                  {
                      MR_usage();
@@ -1816,7 +1816,9 @@

              case MR_WORKSTEAL_MAX_ATTEMPTS:
  #ifdef MR_LL_PARALLEL_CONJ
-                if (sscanf(MR_optarg, "%lu", &MR_worksteal_max_attempts) != 1) {
+                if (sscanf(MR_optarg, "%"MR_INTEGER_LENGTH_MODIFIER"u",
+			&MR_worksteal_max_attempts) != 1)
+		{
                      MR_usage();
                  }
  #endif
@@ -1824,7 +1826,9 @@

              case MR_WORKSTEAL_SLEEP_MSECS:
  #ifdef MR_LL_PARALLEL_CONJ
-                if (sscanf(MR_optarg, "%lu", &MR_worksteal_sleep_msecs) != 1) {
+                if (sscanf(MR_optarg, "%"MR_INTEGER_LENGTH_MODIFIER"u",
+			&MR_worksteal_sleep_msecs) != 1)
+		{
                      MR_usage();
                  }
  #endif
Index: trace/mercury_event_parser.y
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_event_parser.y,v
retrieving revision 1.5
diff -u -r1.5 mercury_event_parser.y
--- trace/mercury_event_parser.y	1 May 2007 06:31:26 -0000	1.5
+++ trace/mercury_event_parser.y	6 Jan 2011 15:49:03 -0000
@@ -257,7 +257,7 @@
          mercury_event_linenum--;
      } else if (mercury_event_text[0] == '\n' || mercury_event_text[0] == '\f') {
          sprintf(buf, "%s at end of line", s);
-    } else if (isprint(mercury_event_text[0])) {
+    } else if (isprint((int)mercury_event_text[0])) {
          sprintf(buf, "%s at symbol `%s'", s, mercury_event_text);
      } else {
          sprintf(buf, "%s at \\%o", s, mercury_event_text[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