[m-rev.] diff: avoid C compiler warnings in .mm.debug grades

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Sep 19 00:15:09 AEST 2005


Estimated hours taken: 0.1
Branches: main

runtime/mercury_minimal_model.c:
	Eliminate warnings from the C compiler on 64-bit
	architectures in .mm.debug grades.

Julien.

Index: runtime/mercury_minimal_model.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_minimal_model.c,v
retrieving revision 1.18
diff -u -r1.18 mercury_minimal_model.c
--- runtime/mercury_minimal_model.c	10 Jun 2005 07:12:51 -0000	1.18
+++ runtime/mercury_minimal_model.c	18 Sep 2005 14:10:28 -0000
@@ -441,7 +441,8 @@
     }

     fprintf(fp, "\n");
-    fprintf(fp, "answers: %d\n", subgoal->MR_sg_num_ans);
+    fprintf(fp, "answers: %" MR_INTEGER_LENGTH_MODIFIER "d\n",
+        subgoal->MR_sg_num_ans);

     if (proc != NULL) {
         answer_list = subgoal->MR_sg_answer_list;
@@ -480,8 +481,9 @@
     if (consumer->MR_cns_subgoal != NULL) {
         fprintf(fp, ", of subgoal %s",
             MR_subgoal_addr_name(consumer->MR_cns_subgoal));
-        fprintf(fp, "\nreturned answers %d, remaining answers ptr %p\n",
-            consumer->MR_cns_num_returned_answers,
+        fprintf(fp, "\nreturned answers %" MR_INTEGER_LENGTH_MODIFIER "d,",
+            consumer->MR_cns_num_returned_answers);
+        fprintf(fp, " remaining answers ptr %p\n",
             consumer->MR_cns_remaining_answer_list_ptr);
         print_saved_state(fp, &consumer->MR_cns_saved_state);
     } else {
@@ -1558,13 +1560,16 @@
     fprintf(fp, "\nmaxfr:\t");
     MR_print_nondstackptr(fp, saved_state->MR_ss_max_fr);
     fprintf(fp, "\n");
-
-    fprintf(fp,
-        "slots saved: %d non, %d det, %d generator, %d cut, %d pneg\n",
-        saved_state->MR_ss_non_stack_block_size,
-        saved_state->MR_ss_det_stack_block_size,
-        saved_state->MR_ss_gen_stack_block_size,
-        saved_state->MR_ss_cut_next,
+
+    fprintf(fp, "slots saved: %" MR_INTEGER_LENGTH_MODIFIER "d non,",
+        saved_state->MR_ss_non_stack_block_size);
+    fprintf(fp, " %" MR_INTEGER_LENGTH_MODIFIER "d det,",
+        saved_state->MR_ss_det_stack_block_size);
+    fprintf(fp, " %" MR_INTEGER_LENGTH_MODIFIER "d generator,",
+        saved_state->MR_ss_gen_stack_block_size);
+    fprintf(fp, " %" MR_INTEGER_LENGTH_MODIFIER "d cut,",
+        saved_state->MR_ss_cut_next);
+    fprintf(fp, " %" MR_INTEGER_LENGTH_MODIFIER "d pneg\n",
         saved_state->MR_ss_pneg_next);

     if (saved_state->MR_ss_non_stack_block_size > 0) {
@@ -1610,9 +1615,9 @@
   #endif /* MR_TABLE_SEGMENT_DEBUG */

     if (saved_state->MR_ss_gen_stack_block_size > 0) {
-        fprintf(fp, "gen region from %d",
+        fprintf(fp, "gen region from %" MR_INTEGER_LENGTH_MODIFIER "d",
             saved_state->MR_ss_gen_stack_real_start);
-        fprintf(fp, " to %d",
+        fprintf(fp, " to %" MR_INTEGER_LENGTH_MODIFIER "d",
             saved_state->MR_ss_gen_stack_real_start +
                 saved_state->MR_ss_gen_stack_block_size - 1);
         fprintf(fp, " (both inclusive)\n");


--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list