[m-rev.] for review: use MR_Unsigned in trace code

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Oct 2 11:03:54 AEST 2007


For review by Zoltan or Ian.

Estimated hours taken: 5
Branches: main

Fix up some places in the trace directory where there were (potential)
mismatches between the sizes of types used to represent natural numbers.
Much of the existing code in the trace directory assumed that 
sizeof(int) == sizeof(MR_Unsigned), which is not true on our 64-bit
machines.  Zoltan's recent change to MR_trace_is_natural_number() broke
that assumption in a lot of places.  (I committed a workaround for that
yesterday.)

This diff addresses the above problem by changing the types of many of
things that represent natural numbers from int to MR_Unsigned.
This should make the trace code more robust on 64-bit machines and
help avoid a recurrence of problems like the above.

NOTE: this change does not change slot numbers into unsigned values since
they still use negative values as sentinels.  I will address slot numbers
in as part of a separate change.

trace/mercury_trace.h:
 	Add typedefs for MR_Unsigned for several commonly used quantities
 	within the trace code.  For I/O action numbers we just re-use
 	the type MR_IoActionNum from the runtime, rather than defining
 	a adding a new typedef here.

trace/mercury_trace_tables.h:
 	Change the type of the `match_proc_max' and `match_proc_next' fields
 	of the MR_MatchesInfo structure into MR_Unsigned instead of int.

trace/mercury_trace_cmd_parameter.[ch]:
 	Change the type of the global variables, MR_scroll_{limit,next}
 	and MR_num_context_lines into MR_Unsigned instead of int.

trace/mercury_trace_util.[ch]:
 	Restore Zoltan's change that made the type of the second argument of
 	MR_trace_is_natural_number() into MR_Unsigned.  The places that
 	caused this to break on 64-bit machines have now been fixed.

 	Update the documentation of MR_trace_is_natural_number();

 	Delete MR_trace_is_unsigned() since that now duplicates
 	MR_trace_is_natural_number().

 	Add a new function MR_trace_is_nonneg_int() which is similar
 	to the above functions except that it stores its result in
 	an int.  (This is needed for handling slot numbers which are
 	still represented using ints.)

trace/mercury_trace_cmd_developer.c:
 	Refactor some code so that we don't need to use -1 as a sentinel
 	value.

trace/mercury_trace_cmd_help.c:
 	Use MR_trace_is_nonneg_int() instead of MR_trace_is_natural_number()
 	to handle slot numbers.

runtime/mercury_trace_base.[ch]:
 	Change the type of the first argument of MR_trace_get_action()
 	from int to MR_IoActionNum.

trace/mercury_trace_alias.c:
trace/mercury_trace_cmd_backward.c:
trace/mercury_trace_cmd_breakpoint.c:
trace/mercury_trace_cmd_browsing.c:
trace/mercury_trace_cmd_dd.c:
trace/mercury_trace_cmd_exp.c:
trace/mercury_trace_cmd_forward.c:
trace/mercury_stack_trace.c:
trace/mercury_trace_internal.c:
trace/mercury_trace_spy.[ch]:
trace/mercury_trace_vars.[ch]:
 	Use MR_Unsigned instead of int to represent natural numbers.

Julien.

Index: runtime/mercury_stack_trace.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_stack_trace.c,v
retrieving revision 1.78
diff -u -r1.78 mercury_stack_trace.c
--- runtime/mercury_stack_trace.c	3 Jan 2007 05:17:17 -0000	1.78
+++ runtime/mercury_stack_trace.c	1 Oct 2007 06:22:19 -0000
@@ -369,7 +369,7 @@

  void
  MR_dump_nondet_stack_from_layout(FILE *fp, MR_Word *limit_addr,
-    int frame_limit, int line_limit,
+    MR_FrameLimit frame_limit, MR_SpecLineLimit line_limit,
      MR_Word *base_maxfr, const MR_LabelLayout *top_layout,
      MR_Word *base_sp, MR_Word *base_curfr)
  {
Index: runtime/mercury_trace_base.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_trace_base.c,v
retrieving revision 1.84
diff -u -r1.84 mercury_trace_base.c
--- runtime/mercury_trace_base.c	27 Sep 2007 07:28:22 -0000	1.84
+++ runtime/mercury_trace_base.c	1 Oct 2007 06:44:04 -0000
@@ -986,7 +986,7 @@
  */

  MR_bool
-MR_trace_get_action(int action_number, MR_ConstString *proc_name_ptr,
+MR_trace_get_action(MR_IoActionNum action_number, MR_ConstString *proc_name_ptr,
      MR_Word *is_func_ptr, MR_Word *arg_list_ptr)
  {
      const MR_TableIoDecl    *table_io_decl;
Index: runtime/mercury_trace_base.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_trace_base.h,v
retrieving revision 1.62
diff -u -r1.62 mercury_trace_base.h
--- runtime/mercury_trace_base.h	27 Sep 2007 07:28:22 -0000	1.62
+++ runtime/mercury_trace_base.h	1 Oct 2007 06:44:31 -0000
@@ -520,7 +520,7 @@
  ** function will return MR_FALSE, otherwise it will return MR_TRUE.
  */

-extern	MR_bool	MR_trace_get_action(int action_number,
+extern	MR_bool	MR_trace_get_action(MR_IoActionNum action_number,
  			MR_ConstString *proc_name_ptr, MR_Word *is_func_ptr,
  			MR_Word *arg_list_ptr);

Index: trace/mercury_trace.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace.c,v
retrieving revision 1.105
diff -u -r1.105 mercury_trace.c
--- trace/mercury_trace.c	19 Jan 2007 04:42:50 -0000	1.105
+++ trace/mercury_trace.c	1 Oct 2007 06:51:53 -0000
@@ -642,7 +642,7 @@

  MR_RetryResult
  MR_trace_retry(MR_EventInfo *event_info,
-    int ancestor_level, MR_RetryAcrossIo across_io,
+    MR_AncestorLevel ancestor_level, MR_RetryAcrossIo across_io,
      MR_bool assume_all_io_is_tabled, const char *retry_interactive_message,
      MR_bool *unsafe_retry, const char **problem,
      FILE *in_fp, FILE *out_fp, MR_Code **jumpaddr)
Index: trace/mercury_trace.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace.h,v
retrieving revision 1.36
diff -u -r1.36 mercury_trace.h
--- trace/mercury_trace.h	3 Jan 2007 05:17:20 -0000	1.36
+++ trace/mercury_trace.h	1 Oct 2007 13:21:21 -0000
@@ -25,9 +25,15 @@
  #define MERCURY_TRACE_H

  #include "mercury_memory_zones.h"   /* for MR_MAX_FAKE_REG */
-#include "mercury_types.h"      /* for MR_Unsigned etc */
-#include "mercury_trace_base.h"     /* for MR_TracePort   */
-#include "mercury_std.h"        /* for MR_bool            */
+#include "mercury_types.h"          /* for MR_Unsigned etc */
+#include "mercury_trace_base.h"     /* for MR_TracePort    */
+#include "mercury_std.h"            /* for MR_bool         */
+
+
+typedef MR_Unsigned MR_AncestorLevel;
+typedef MR_Unsigned MR_FrameLimit;
+typedef MR_Unsigned MR_SpecLineLimit;
+typedef MR_Unsigned MR_IgnoreCount;

  /*
  ** MR_EventInfo is used to hold the information for a trace event.  One
@@ -141,7 +147,8 @@
  } MR_RetryResult;

  extern  MR_RetryResult  MR_trace_retry(MR_EventInfo *event_info,
-                            int ancestor_level, MR_RetryAcrossIo across_io,
+                            MR_AncestorLevel ancestor_level,
+                            MR_RetryAcrossIo across_io,
                              MR_bool assume_all_io_is_tabled,
                              const char *retry_interactive_message,
                              MR_bool *unsafe_retry, const char **problem,
Index: trace/mercury_trace_alias.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_alias.c,v
retrieving revision 1.11
diff -u -r1.11 mercury_trace_alias.c
--- trace/mercury_trace_alias.c	29 Nov 2006 05:18:33 -0000	1.11
+++ trace/mercury_trace_alias.c	1 Oct 2007 06:51:53 -0000
@@ -193,7 +193,7 @@
      int         alias_word_count;
      int         alias_copy_start;
      int         i;
-    int         n;
+    MR_Unsigned n;

      if (*word_count == 0) {
          alias_key = "EMPTY";
Index: trace/mercury_trace_cmd_backward.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_backward.c,v
retrieving revision 1.2
diff -u -r1.2 mercury_trace_cmd_backward.c
--- trace/mercury_trace_cmd_backward.c	29 Nov 2006 05:18:34 -0000	1.2
+++ trace/mercury_trace_cmd_backward.c	1 Oct 2007 06:51:53 -0000
@@ -51,8 +51,8 @@
  MR_trace_cmd_retry(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int                 n;
-    int                 ancestor_level;
+    MR_AncestorLevel    n;
+    MR_AncestorLevel    ancestor_level;
      MR_RetryAcrossIo    across_io;
      const char          *problem;
      MR_RetryResult      result;
Index: trace/mercury_trace_cmd_breakpoint.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_breakpoint.c,v
retrieving revision 1.5
diff -u -r1.5 mercury_trace_cmd_breakpoint.c
--- trace/mercury_trace_cmd_breakpoint.c	15 Jun 2007 08:26:46 -0000	1.5
+++ trace/mercury_trace_cmd_breakpoint.c	1 Oct 2007 07:04:28 -0000
@@ -49,7 +49,8 @@

  static  MR_bool     MR_trace_options_when_action_multi_ignore(MR_SpyWhen *when,
                          MR_SpyAction *action, MR_MultiMatch *multi_match,
-                        MR_SpyIgnore_When *ignore_when, int *ignore_count,
+                        MR_SpyIgnore_When *ignore_when,
+                        MR_IgnoreCount *ignore_count,
                          MR_SpyPrintList *print_list,
                          char ***words, int *word_count);
  static  MR_bool     MR_trace_options_condition(int *break_num,
@@ -57,7 +58,8 @@
                          char ***words, int *word_count);
  static  MR_bool     MR_trace_options_ignore_count(
                          MR_SpyIgnore_When *ignore_when,
-                        int *ignore_count, char ***words, int *word_count);
+                        MR_IgnoreCount *ignore_count, char ***words,
+                        int *word_count);
  static  MR_bool     MR_trace_options_break_print(int *break_num,
                          MR_BrowseFormat *format, MR_bool *at_start,
                          MR_bool *warn, char ***words, int *word_count);
@@ -76,11 +78,11 @@
      MR_SpyAction            action;
      MR_MultiMatch           multi_match;
      MR_SpyIgnore_When       ignore_when;
-    int                     ignore_count;
+    MR_IgnoreCount          ignore_count;
      MR_SpyPrintList         print_list;
      const char              *file;
      int                     line;
-    int                     breakline;
+    MR_Unsigned             breakline;
      const char              *problem;

      layout = event_info->MR_event_sll;
@@ -312,9 +314,9 @@
                  MR_maybe_print_spy_point(slot, problem);
              }
          } else {
-            char    buf[80];
-            int     i;
-            char    *line2;
+            char        buf[80];
+            MR_Unsigned i;
+            char        *line2;

              fprintf(MR_mdb_out,
                  "Ambiguous procedure specification. The matches are:\n");
@@ -369,7 +371,7 @@
          const MR_LabelLayout    **matching_labels;
          int                     matching_port_count;
          int                     slot;
-        int                     i;
+        MR_Unsigned             i;

          if (multi_match == MR_MULTIMATCH_ALL) {
              fprintf(MR_mdb_err, "Warning: "
@@ -689,9 +691,9 @@
  MR_trace_cmd_ignore(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int                 n;
+    MR_Unsigned         n;
      MR_SpyIgnore_When   ignore_when;
-    int                 ignore_count;
+    MR_Unsigned         ignore_count;
      const char          *problem;

      ignore_when = MR_SPY_IGNORE_ENTRY;
@@ -817,7 +819,7 @@
  MR_trace_cmd_enable(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int n;
+    MR_Unsigned n;

      if (word_count == 2 && MR_trace_is_natural_number(words[1], &n)) {
          if (0 <= n && n < MR_spy_point_next &&
@@ -867,7 +869,7 @@
  MR_trace_cmd_disable(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int n;
+    MR_Unsigned n;

      if (word_count == 2 && MR_trace_is_natural_number(words[1], &n)) {
          if (0 <= n && n < MR_spy_point_next &&
@@ -918,7 +920,7 @@
  MR_trace_cmd_delete(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int n;
+    MR_Unsigned n;

      if (word_count == 2 && MR_trace_is_natural_number(words[1], &n)) {
          if (0 <= n && n < MR_spy_point_next &&
@@ -1170,7 +1172,7 @@
  static MR_bool
  MR_trace_options_when_action_multi_ignore(MR_SpyWhen *when,
      MR_SpyAction *action, MR_MultiMatch *multi_match,
-    MR_SpyIgnore_When *ignore_when, int *ignore_count,
+    MR_SpyIgnore_When *ignore_when, MR_Unsigned *ignore_count,
      MR_SpyPrintList *print_list, char ***words, int *word_count)
  {
      int             c;
@@ -1277,8 +1279,8 @@
  MR_trace_options_condition(int *break_num, MR_bool *require_var,
      MR_bool *require_path, char ***words, int *word_count)
  {
-    int c;
-    int n;
+    int         c;
+    MR_Unsigned n;

      MR_optind = 0;
      while ((c = MR_getopt_long(*word_count, *words, "b:vp",
@@ -1329,7 +1331,7 @@

  static MR_bool
  MR_trace_options_ignore_count(MR_SpyIgnore_When *ignore_when,
-    int *ignore_count, char ***words, int *word_count)
+    MR_Unsigned *ignore_count, char ***words, int *word_count)
  {
      int c;

@@ -1390,8 +1392,8 @@
  MR_trace_options_break_print(int *break_num, MR_BrowseFormat *format,
      MR_bool *at_start, MR_bool *warn, char ***words, int *word_count)
  {
-    int c;
-    int n;
+    int         c;
+    MR_Unsigned n;

      *break_num = MR_most_recent_spy_point;
      *format = MR_BROWSE_FORMAT_FLAT;
Index: trace/mercury_trace_cmd_browsing.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_browsing.c,v
retrieving revision 1.9
diff -u -r1.9 mercury_trace_cmd_browsing.c
--- trace/mercury_trace_cmd_browsing.c	1 Oct 2007 02:06:45 -0000	1.9
+++ trace/mercury_trace_cmd_browsing.c	1 Oct 2007 06:57:06 -0000
@@ -57,7 +57,8 @@
                          MR_BrowseCallerType caller, MR_BrowseFormat format);

  static  void        MR_trace_cmd_stack_2(MR_EventInfo *event_info,
-                        MR_bool detailed, int frame_limit, int line_limit);
+                        MR_bool detailed, MR_FrameLimit frame_limit,
+                        int line_limit);

  static  const char  *MR_trace_new_source_window(const char *window_cmd,
                          const char *server_cmd, const char *server_name,
@@ -67,16 +68,17 @@
  static  MR_bool     MR_trace_options_detailed(MR_bool *detailed, char ***words,
                          int *word_count);
  static  MR_bool     MR_trace_options_stack_trace(MR_bool *detailed,
-                        int *frame_limit, char ***words, int *word_count);
+                        MR_FrameLimit *frame_limit, char ***words,
+                        int *word_count);
  static  MR_bool     MR_trace_options_format(MR_BrowseFormat *format,
                          MR_bool *xml, char ***words, int *word_count);
  static  MR_bool     MR_trace_options_view(const char **window_cmd,
                          const char **server_cmd, const char **server_name,
-                        int *timeout, MR_bool *force, MR_bool *verbose,
+                        MR_Unsigned *timeout, MR_bool *force, MR_bool *verbose,
                          MR_bool *split, MR_bool *close_window, char ***words,
                          int *word_count);
-static  MR_bool     MR_trace_options_diff(int *start, int *max,
-                        char ***words, int *word_count);
+static  MR_bool     MR_trace_options_diff(MR_Unsigned *start,
+                        MR_Unsigned *max, char ***words, int *word_count);
  static  MR_bool     MR_trace_options_dump(MR_bool *xml,
                          char ***words, int *word_count);

@@ -86,8 +88,8 @@
  MR_trace_cmd_level(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int n;
-    MR_bool detailed;
+    MR_Unsigned n;
+    MR_bool     detailed;

      detailed = MR_FALSE;
      if (! MR_trace_options_detailed(&detailed, &words, &word_count)) {
@@ -105,8 +107,8 @@
  MR_trace_cmd_up(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int     n;
-    MR_bool detailed;
+    MR_Unsigned n;
+    MR_bool     detailed;

      detailed = MR_FALSE;
      if (! MR_trace_options_detailed(&detailed, &words, &word_count)) {
@@ -128,8 +130,8 @@
  MR_trace_cmd_down(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int     n;
-    MR_bool detailed;
+    MR_Unsigned n;
+    MR_bool     detailed;

      detailed = MR_FALSE;
      if (! MR_trace_options_detailed(&detailed, &words, &word_count)) {
@@ -322,7 +324,7 @@
                  "%" MR_INTEGER_LENGTH_MODIFIER "u.\n",
                  MR_io_tabling_start, MR_io_tabling_counter_hwm - 1);
              fflush(MR_mdb_out);
-        } else if (MR_trace_is_unsigned(words[2], &action)) {
+        } else if (MR_trace_is_natural_number(words[2], &action)) {
              problem = MR_trace_browse_action(MR_mdb_out, action,
                  MR_trace_browse_goal_internal,
                  MR_BROWSE_CALLER_PRINT, format);
@@ -392,7 +394,7 @@
  {
      MR_BrowseFormat     format;
      MR_bool             xml;
-    int                 action;
+    MR_IoActionNum      action;
      MR_GoalBrowser      goal_browser;
      MR_Browser          browser;
      const char          *problem;
@@ -459,10 +461,10 @@
  MR_trace_cmd_stack(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    MR_bool     detailed;
-    int         frame_limit = 0;
-    int         line_limit = MR_stack_default_line_limit;
-    int         spec_line_limit;
+    MR_bool             detailed;
+    MR_FrameLimit       frame_limit = 0;
+    int                 line_limit = MR_stack_default_line_limit;
+    MR_SpecLineLimit    spec_line_limit;

      detailed = MR_FALSE;
      if (! MR_trace_options_stack_trace(&detailed, &frame_limit,
@@ -503,7 +505,7 @@
      const char      *window_cmd = NULL;
      const char      *server_cmd = NULL;
      const char      *server_name = NULL;
-    int             timeout = 8;    /* seconds */
+    MR_Unsigned     timeout = 8;    /* seconds */
      MR_bool         force = MR_FALSE;
      MR_bool         verbose = MR_FALSE;
      MR_bool         split = MR_FALSE;
@@ -589,8 +591,8 @@
  MR_trace_cmd_diff(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int         start;
-    int         max;
+    MR_Unsigned start;
+    MR_Unsigned max;
      char        *name1;
      char        *name2;
      MR_TypeInfo type_info1;
@@ -748,7 +750,7 @@
      int                     lineno;
      MR_Word                 *base_sp_ptr;
      MR_Word                 *base_curfr_ptr;
-    MR_bool                 num = MR_num_context_lines;
+    MR_Unsigned             num = MR_num_context_lines;
      MR_String               aligned_filename;

      if (word_count > 2) {
@@ -934,7 +936,7 @@

  static void
  MR_trace_cmd_stack_2(MR_EventInfo *event_info, MR_bool detailed,
-    int frame_limit, int line_limit)
+    MR_FrameLimit frame_limit, int line_limit)
  {
      const MR_LabelLayout    *layout;
      MR_Word                 *saved_regs;
@@ -1132,7 +1134,7 @@
  }

  static MR_bool
-MR_trace_options_stack_trace(MR_bool *detailed, int *frame_limit,
+MR_trace_options_stack_trace(MR_bool *detailed, MR_FrameLimit *frame_limit,
      char ***words, int *word_count)
  {
      int c;
@@ -1235,7 +1237,7 @@

  static MR_bool
  MR_trace_options_view(const char **window_cmd, const char **server_cmd,
-    const char **server_name, int *timeout, MR_bool *force,
+    const char **server_name, MR_Unsigned *timeout, MR_bool *force,
      MR_bool *verbose, MR_bool *split, MR_bool *close_window,
      char ***words, int *word_count)
  {
@@ -1345,7 +1347,8 @@
  };

  static MR_bool
-MR_trace_options_diff(int *start, int *max, char ***words, int *word_count)
+MR_trace_options_diff(MR_Unsigned *start, MR_Unsigned *max,
+    char ***words, int *word_count)
  {
      int c;

Index: trace/mercury_trace_cmd_dd.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_dd.c,v
retrieving revision 1.4
diff -u -r1.4 mercury_trace_cmd_dd.c
--- trace/mercury_trace_cmd_dd.c	27 Sep 2007 07:28:28 -0000	1.4
+++ trace/mercury_trace_cmd_dd.c	1 Oct 2007 06:58:08 -0000
@@ -171,9 +171,9 @@
                  fprintf(MR_mdb_out, "Trusting ");
                  MR_print_pred_id_and_nl(MR_mdb_out, matches.match_procs[0]);
              } else {
-                int     i;
-                char    buf[80];
-                char    *line2;
+                MR_Unsigned i;
+                char        buf[80];
+                char        *line2;

                  fprintf(MR_mdb_out, "Ambiguous predicate or function"
                      " specification. The matches are:\n");
@@ -234,7 +234,7 @@
  MR_trace_cmd_untrust(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int i;
+    MR_Unsigned i;

      if (word_count == 2 && MR_trace_is_natural_number(words[1], &i)) {
          if (!MR_decl_remove_trusted(i)) {
@@ -308,7 +308,7 @@
                  break;

              case 'd':
-                if (! MR_trace_is_unsigned(MR_optarg, default_depth)) {
+                if (! MR_trace_is_natural_number(MR_optarg, default_depth)) {
                      MR_trace_usage_cur_cmd();
                      return MR_FALSE;
                  }
@@ -319,7 +319,7 @@
                  break;

              case 'n':
-                if (! MR_trace_is_unsigned(MR_optarg, num_nodes)) {
+                if (! MR_trace_is_natural_number(MR_optarg, num_nodes)) {
                      MR_trace_usage_cur_cmd();
                      return MR_FALSE;
                  }
Index: trace/mercury_trace_cmd_developer.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_developer.c,v
retrieving revision 1.6
diff -u -r1.6 mercury_trace_cmd_developer.c
--- trace/mercury_trace_cmd_developer.c	3 Jan 2007 05:17:20 -0000	1.6
+++ trace/mercury_trace_cmd_developer.c	1 Oct 2007 06:51:53 -0000
@@ -38,7 +38,8 @@
  /****************************************************************************/

  static  void        MR_trace_cmd_nondet_stack_2(MR_EventInfo *event_info,
-                        MR_bool detailed, int frame_limit, int line_limit);
+                        MR_bool detailed, MR_FrameLimit frame_limit,
+                        MR_SpecLineLimit line_limit);

  static  const MR_ProcLayout
                      *MR_find_single_matching_proc(MR_ProcSpec *spec,
@@ -227,7 +228,8 @@
  /****************************************************************************/

  static  MR_bool     MR_trace_options_nondet_stack(MR_bool *detailed,
-                        int *frame_limit, char ***words, int *word_count);
+                        MR_FrameLimit *frame_limit, char ***words,
+                        int *word_count);
  static  MR_bool     MR_trace_options_stats(char **filename, char ***words,
                          int *word_count);
  static  MR_bool     MR_trace_options_type_ctor(MR_bool *print_rep,
@@ -562,10 +564,10 @@
  MR_trace_cmd_nondet_stack(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    MR_bool     detailed;
-    int         frame_limit = 0;
-    int         line_limit = MR_stack_default_line_limit;
-    int         spec_line_limit;
+    MR_bool             detailed;
+    MR_FrameLimit       frame_limit = 0;
+    int                 line_limit = MR_stack_default_line_limit;
+    MR_SpecLineLimit    spec_line_limit;

      detailed = MR_FALSE;
      if (! MR_trace_options_nondet_stack(&detailed, &frame_limit,
@@ -1049,7 +1051,7 @@
  {
      const char      *module_name;
      const char      *name;
-    int             arity;
+    MR_Unsigned     arity;
      MR_bool         print_rep;
      MR_bool         print_functors;
      MR_TypeCtorInfo type_ctor_info;
@@ -1087,7 +1089,7 @@
  {
      const char              *module_name;
      const char              *name;
-    int                     arity;
+    MR_Unsigned             arity;
      MR_bool                 print_methods;
      MR_bool                 print_instances;
      MR_TypeClassDeclInfo    *type_class_decl_info;
@@ -1344,7 +1346,7 @@

  static void
  MR_trace_cmd_nondet_stack_2(MR_EventInfo *event_info, MR_bool detailed,
-    int frame_limit, int line_limit)
+    MR_FrameLimit frame_limit, MR_SpecLineLimit line_limit)
  {
      const MR_LabelLayout    *layout;
      MR_Word                 *saved_regs;
@@ -1371,7 +1373,7 @@
  MR_find_single_matching_proc(MR_ProcSpec *spec, MR_bool verbose)
  {
      MR_MatchesInfo      matches;
-    int                 n;
+    MR_Unsigned         n;
      int                 i;

      MR_register_all_modules_and_procs(MR_mdb_out, verbose);
@@ -1397,23 +1399,18 @@
          sprintf(buf, "\nWhich procedure's table do you want to print (0-%d)? ",
              matches.match_proc_next - 1);
          line2 = MR_trace_getline(buf, MR_mdb_in, MR_mdb_out);
-        n = -1;
          if (line2 == NULL || !MR_trace_is_natural_number(line2, &n)) {
-            n = -1;
              fprintf(MR_mdb_out, "none of them\n");
-        } else if (n < 0 || n >= matches.match_proc_next) {
-            n = -1;
+            return NULL;
+        } else if (n >= matches.match_proc_next) {
              fprintf(MR_mdb_out, "invalid choice\n");
-        }
-
-        if (line2 != NULL) {
-            MR_free(line2);
-        }
-
-        if (n >= 0) {
-            return matches.match_procs[n];
-        } else {
              return NULL;
+        } else {
+ 
+            if (line2 != NULL) {
+                MR_free(line2);
+            }
+            return matches.match_procs[n];
          }
      }
  }
@@ -2044,7 +2041,7 @@
  };

  static MR_bool
-MR_trace_options_nondet_stack(MR_bool *detailed, int *frame_limit,
+MR_trace_options_nondet_stack(MR_bool *detailed, MR_FrameLimit *frame_limit,
      char ***words, int *word_count)
  {
      int c;
Index: trace/mercury_trace_cmd_exp.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_exp.c,v
retrieving revision 1.3
diff -u -r1.3 mercury_trace_cmd_exp.c
--- trace/mercury_trace_cmd_exp.c	31 Jul 2007 05:48:20 -0000	1.3
+++ trace/mercury_trace_cmd_exp.c	1 Oct 2007 06:51:53 -0000
@@ -47,8 +47,8 @@

  static  MR_bool     MR_trace_options_dice(char **pass_trace_counts_file,
                          char **fail_trace_count_file, char **sort_str,
-                        int *number_of_lines, char **out_file, char **module,
-                        char ***words, int *word_count);
+                        MR_Unsigned *number_of_lines, char **out_file,
+                        char **module, char ***words, int *word_count);

  /****************************************************************************/

@@ -158,12 +158,12 @@
  MR_trace_cmd_dice(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    char    *pass_trace_counts_file;
-    char    *fail_trace_counts_file;
-    char    *sort_str;
-    char    *out_file;
-    char    *module;
-    int     number_of_lines;
+    char        *pass_trace_counts_file;
+    char        *fail_trace_counts_file;
+    char        *sort_str;
+    char        *out_file;
+    char        *module;
+    MR_Unsigned number_of_lines;

      sort_str = NULL;
      out_file = NULL;
@@ -295,8 +295,8 @@

  static MR_bool
  MR_trace_options_dice(char **pass_trace_counts_file,
-    char **fail_trace_counts_file, char **sort_str, int *n, char **out_file,
-    char **module, char ***words, int *word_count)
+    char **fail_trace_counts_file, char **sort_str, MR_Unsigned *n,
+    char **out_file, char **module, char ***words, int *word_count)
  {
      int c;

Index: trace/mercury_trace_cmd_forward.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_forward.c,v
retrieving revision 1.4
diff -u -r1.4 mercury_trace_cmd_forward.c
--- trace/mercury_trace_cmd_forward.c	3 Jan 2007 05:17:20 -0000	1.4
+++ trace/mercury_trace_cmd_forward.c	1 Oct 2007 06:58:28 -0000
@@ -40,7 +40,7 @@
  MR_trace_cmd_step(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int n;
+    MR_Unsigned n;

      cmd->MR_trace_strict = MR_FALSE;
      cmd->MR_trace_print_level = MR_default_print_level;
@@ -73,7 +73,7 @@
      MR_init_trace_check_integrity(cmd);
      if (! MR_trace_options_movement_cmd(cmd, &words, &word_count)) {
          ; /* the usage message has already been printed */
-    } else if (word_count == 2 && MR_trace_is_unsigned(words[1], &n)) {
+    } else if (word_count == 2 && MR_trace_is_natural_number(words[1], &n)) {
          generator_name = NULL;
          if (MR_trace_event_number < n
              || !MR_cur_generator_is_named(generator_name))
@@ -88,7 +88,7 @@
              fprintf(MR_mdb_err, "The debugger cannot go to a past event.\n");
          }
  #ifdef  MR_USE_MINIMAL_MODEL_OWN_STACKS
-    } else if (word_count == 3 && MR_trace_is_unsigned(words[1], &n)) {
+    } else if (word_count == 3 && MR_trace_is_natural_number(words[1], &n)) {
          generator_name = words[2];
          if (MR_trace_event_number < n
              || !MR_cur_generator_is_named(generator_name))
@@ -118,9 +118,9 @@
  MR_trace_cmd_next(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    MR_Unsigned depth;
-    int         stop_depth;
-    int         n;
+    MR_Unsigned     depth;
+    MR_Unsigned     stop_depth;
+    MR_Unsigned     n;

      depth = event_info->MR_call_depth;
      cmd->MR_trace_strict = MR_TRUE;
@@ -154,8 +154,8 @@
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
      MR_Unsigned depth;
-    int         stop_depth;
-    int         n;
+    MR_Unsigned stop_depth;
+    MR_Unsigned n;

      depth = event_info->MR_call_depth;
      cmd->MR_trace_strict = MR_TRUE;
@@ -190,8 +190,8 @@
  {
      MR_Determinism  detism;
      MR_Unsigned     depth;
-    int             stop_depth;
-    int             n;
+    MR_Unsigned     stop_depth;
+    MR_Unsigned     n;

      detism = event_info->MR_event_sll->MR_sll_entry->MR_sle_detism;
      depth = event_info->MR_call_depth;
@@ -334,7 +334,7 @@
  MR_trace_cmd_mindepth(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int newdepth;
+    MR_Unsigned newdepth;

      cmd->MR_trace_strict = MR_TRUE;
      cmd->MR_trace_print_level = MR_default_print_level;
@@ -358,7 +358,7 @@
  MR_trace_cmd_maxdepth(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int newdepth;
+    MR_Unsigned newdepth;

      cmd->MR_trace_strict = MR_TRUE;
      cmd->MR_trace_print_level = MR_default_print_level;
Index: trace/mercury_trace_cmd_help.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_help.c,v
retrieving revision 1.2
diff -u -r1.2 mercury_trace_cmd_help.c
--- trace/mercury_trace_cmd_help.c	29 Nov 2006 05:18:35 -0000	1.2
+++ trace/mercury_trace_cmd_help.c	1 Oct 2007 13:45:58 -0000
@@ -50,7 +50,7 @@
      help_text = MR_trace_read_help_text();
      if (word_count != 3) {
          MR_trace_usage_cur_cmd();
-    } else if (! MR_trace_is_natural_number(words[1], &slot)) {
+    } else if (! MR_trace_is_nonneg_int(words[1], &slot)) {
          MR_trace_usage_cur_cmd();
      } else {
          msg = MR_trace_add_cat(words[2], slot, help_text);
@@ -75,7 +75,7 @@
      help_text = MR_trace_read_help_text();
      if (word_count != 4) {
          MR_trace_usage_cur_cmd();
-    } else if (! MR_trace_is_natural_number(words[2], &slot)) {
+    } else if (! MR_trace_is_nonneg_int(words[2], &slot)) {
          MR_trace_usage_cur_cmd();
      } else {
          msg = MR_trace_add_item(words[1], words[3], slot, help_text);
Index: trace/mercury_trace_cmd_parameter.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_parameter.c,v
retrieving revision 1.6
diff -u -r1.6 mercury_trace_cmd_parameter.c
--- trace/mercury_trace_cmd_parameter.c	5 Dec 2006 03:51:20 -0000	1.6
+++ trace/mercury_trace_cmd_parameter.c	1 Oct 2007 06:51:53 -0000
@@ -44,8 +44,8 @@
  MR_TracePrintLevel      MR_default_print_level = MR_PRINT_LEVEL_SOME;

  MR_bool                 MR_scroll_control = MR_TRUE;
-int                     MR_scroll_limit = 24;
-int                     MR_scroll_next = 0;
+MR_Unsigned             MR_scroll_limit = 24;
+MR_Unsigned             MR_scroll_next = 0;

  int                     MR_stack_default_line_limit = 0;

@@ -64,7 +64,7 @@

  MR_Word                 MR_listing_path;

-int                     MR_num_context_lines = 2;
+MR_Unsigned             MR_num_context_lines = 2;

  MR_SpyWhen              MR_default_breakpoint_scope = MR_SPY_INTERFACE;

@@ -158,7 +158,7 @@
  MR_trace_cmd_scroll(char **words, int word_count, MR_TraceCmdInfo *cmd,
      MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int n;
+    MR_Unsigned n;

      if (word_count == 2) {
          if (MR_streq(words[1], "off")) {
@@ -199,7 +199,7 @@
  MR_trace_cmd_stack_default_limit(char **words, int word_count,
      MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int n;
+    MR_Unsigned n;

      if (word_count == 2) {
          if (MR_trace_is_natural_number(words[1], &n)) {
@@ -479,7 +479,7 @@
  MR_trace_cmd_list_context_lines(char **words, int word_count,
      MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int                 n;
+    MR_Unsigned n;

      if (word_count == 2 && MR_trace_is_natural_number(words[1], &n)) {
          MR_num_context_lines = n;
@@ -640,7 +640,7 @@
  MR_trace_cmd_max_io_actions(char **words, int word_count,
      MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
  {
-    int num_io_actions;
+    MR_Unsigned num_io_actions;

      if (word_count == 2 &&
              MR_trace_is_natural_number(words[1], &num_io_actions)) {
@@ -792,7 +792,7 @@
      MR_Word             raw_pretty;
      MR_Word             verbose;
      MR_Word             pretty;
-    int                 n;
+    MR_Unsigned         n;

      if (! MR_trace_options_cmd_format_param(&print, &browse, &print_all,
          &flat, &raw_pretty, &verbose, &pretty, &words, &word_count))
Index: trace/mercury_trace_cmd_parameter.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_cmd_parameter.h,v
retrieving revision 1.3
diff -u -r1.3 mercury_trace_cmd_parameter.h
--- trace/mercury_trace_cmd_parameter.h	5 Dec 2006 03:51:20 -0000	1.3
+++ trace/mercury_trace_cmd_parameter.h	1 Oct 2007 06:51:53 -0000
@@ -35,8 +35,8 @@
  */

  extern  MR_bool             MR_scroll_control;
-extern  int                 MR_scroll_limit;
-extern  int                 MR_scroll_next;
+extern  MR_Unsigned         MR_scroll_limit;
+extern  MR_Unsigned         MR_scroll_next;

  /*
  ** This variable controls the number of stack frame lines printed by the stack
@@ -108,7 +108,7 @@
  ** printed before and after the current callee/caller's file context.
  */

-extern  int                 MR_num_context_lines;
+extern  MR_Unsigned         MR_num_context_lines;

  extern  MR_SpyWhen          MR_default_breakpoint_scope;

Index: trace/mercury_trace_internal.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.237
diff -u -r1.237 mercury_trace_internal.c
--- trace/mercury_trace_internal.c	27 Sep 2007 07:28:28 -0000	1.237
+++ trace/mercury_trace_internal.c	1 Oct 2007 06:51:53 -0000
@@ -293,7 +293,7 @@

      if (! MR_trace_internal_initialized) {
          char        *env;
-        int         n;
+        MR_Unsigned n;
          int         i;

          if (MR_mdb_benchmark_silent) {
@@ -971,7 +971,7 @@
      int         raw_word_count;
      static char count_buf[MR_NUMBER_LEN + 1];
      char        *s;
-    int         i;
+    MR_Unsigned i;
      const char  *problem;

      /*
Index: trace/mercury_trace_spy.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_spy.c,v
retrieving revision 1.32
diff -u -r1.32 mercury_trace_spy.c
--- trace/mercury_trace_spy.c	15 Jun 2007 08:26:47 -0000	1.32
+++ trace/mercury_trace_spy.c	1 Oct 2007 07:06:26 -0000
@@ -678,7 +678,7 @@

  int
  MR_add_proc_spy_point(MR_SpyWhen when, MR_SpyAction action,
-    MR_SpyIgnore_When ignore_when, int ignore_count,
+    MR_SpyIgnore_When ignore_when, MR_IgnoreCount ignore_count,
      const MR_ProcLayout *entry, const MR_LabelLayout *label,
      MR_SpyPrintList print_list, const char **problem)
  {
@@ -727,7 +727,7 @@

  int
  MR_add_line_spy_point(MR_SpyAction action, MR_SpyIgnore_When ignore_when,
-    int ignore_count, const char *orig_filename, int linenumber,
+    MR_IgnoreCount ignore_count, const char *orig_filename, int linenumber,
      MR_SpyPrintList print_list, const char **problem)
  {
      MR_SpyPoint     *point;
@@ -826,7 +826,7 @@

  int
  MR_add_user_event_spy_point(MR_SpyAction action,
-    MR_SpyIgnore_When ignore_when, int ignore_count,
+    MR_SpyIgnore_When ignore_when, MR_IgnoreCount ignore_count,
      const char *user_event_set, const char *user_event_name,
      MR_SpyPrintList print_list, const char **problem)
  {
@@ -956,7 +956,7 @@

  const char *
  MR_ignore_spy_point(int point_slot, MR_SpyIgnore_When ignore_when,
-    int ignore_count)
+    MR_IgnoreCount ignore_count)
  {
      switch (MR_spy_points[point_slot]->MR_spy_when) {
          case MR_SPY_ENTRY:
Index: trace/mercury_trace_spy.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_spy.h,v
retrieving revision 1.15
diff -u -r1.15 mercury_trace_spy.h
--- trace/mercury_trace_spy.h	15 Jun 2007 08:26:47 -0000	1.15
+++ trace/mercury_trace_spy.h	1 Oct 2007 07:07:36 -0000
@@ -95,7 +95,7 @@
      MR_SpyWhen              MR_spy_when;
      MR_SpyAction            MR_spy_action;
      MR_SpyIgnore_When       MR_spy_ignore_when;
-    int                     MR_spy_ignore_count;
+    MR_IgnoreCount          MR_spy_ignore_count;
      MR_SpyCond              *MR_spy_cond;
      MR_SpyPrintList         MR_spy_print_list;
      const MR_ProcLayout     *MR_spy_proc;           /* if not LINENO */
@@ -141,7 +141,8 @@

  extern  int             MR_add_proc_spy_point(MR_SpyWhen when,
                              MR_SpyAction action, MR_SpyIgnore_When ignore_when,
-                            int ignore_count, const MR_ProcLayout *entry,
+                            MR_IgnoreCount ignore_count,
+                            const MR_ProcLayout *entry,
                              const MR_LabelLayout *label,
                              MR_SpyPrintList print_list, const char **problem);

@@ -152,7 +153,8 @@
  */

  extern  int             MR_add_line_spy_point(MR_SpyAction action,
-                            MR_SpyIgnore_When ignore_when, int ignore_count,
+                            MR_SpyIgnore_When ignore_when,
+                            MR_IgnoreCount ignore_count,
                              const char *filename, int linenumber,
                              MR_SpyPrintList print_list, const char **problem);

@@ -163,7 +165,8 @@
  */

  extern  int             MR_add_user_event_spy_point(MR_SpyAction action,
-                            MR_SpyIgnore_When ignore_when, int ignore_count,
+                            MR_SpyIgnore_When ignore_when,
+                            MR_IgnoreCount ignore_count,
                              const char *user_event_set,
                              const char *user_event_name,
                              MR_SpyPrintList print_list, const char **problem);
@@ -191,7 +194,8 @@
  */

  extern  const char      *MR_ignore_spy_point(int point_slot,
-                            MR_SpyIgnore_When ignore_when, int ignore_count);
+                            MR_SpyIgnore_When ignore_when,
+                            MR_IgnoreCount ignore_count);

  /*
  ** Delete a spy point from the table.
Index: trace/mercury_trace_tables.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_tables.h,v
retrieving revision 1.29
diff -u -r1.29 mercury_trace_tables.h
--- trace/mercury_trace_tables.h	19 Jan 2007 04:42:52 -0000	1.29
+++ trace/mercury_trace_tables.h	1 Oct 2007 06:51:53 -0000
@@ -201,8 +201,8 @@

  typedef struct {
      const MR_ProcLayout     **match_procs;
-    int                     match_proc_max;
-    int                     match_proc_next;
+    MR_Unsigned             match_proc_max;
+    MR_Unsigned             match_proc_next;
  } MR_MatchesInfo;

  extern  MR_MatchesInfo MR_search_for_matching_procedures(MR_ProcSpec *spec);
Index: trace/mercury_trace_util.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_util.c,v
retrieving revision 1.24
diff -u -r1.24 mercury_trace_util.c
--- trace/mercury_trace_util.c	1 Oct 2007 02:06:45 -0000	1.24
+++ trace/mercury_trace_util.c	1 Oct 2007 13:45:30 -0000
@@ -29,7 +29,7 @@
  }

  MR_bool
-MR_trace_is_natural_number(const char *word, int *value)
+MR_trace_is_natural_number(const char *word, MR_Unsigned *value)
  {
      if (word != NULL && MR_isdigit(*word)) {
          *value = *word - '0';
@@ -81,7 +81,7 @@
  }

  MR_bool
-MR_trace_is_unsigned(const char *word, MR_Unsigned *value)
+MR_trace_is_nonneg_int(const char *word, int *value)
  {
      if (word != NULL && MR_isdigit(*word)) {
          *value = *word - '0';
Index: trace/mercury_trace_util.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_util.h,v
retrieving revision 1.20
diff -u -r1.20 mercury_trace_util.h
--- trace/mercury_trace_util.h	1 Oct 2007 02:06:45 -0000	1.20
+++ trace/mercury_trace_util.h	1 Oct 2007 13:45:08 -0000
@@ -36,13 +36,14 @@
  /*
  ** MR_trace_is_natural_number checks whether the given word contains a natural
  ** number, i.e. a sequence of digits. If yes, it puts the value of the number
-** in *value (an int) and returns MR_TRUE, otherwise it returns MR_FALSE.
+** in location of type MR_Unsigned and returns MR_TRUE, otherwise it returns
+** MR_FALSE.
  **
  ** MR_trace_is_natural_number_pair looks for a pair of natural numbers
  ** separated by a '-' character.
  **
-** MR_trace_is_unsigned is similar, but puts the value of the number in a
-** location of type MR_Unsigned.
+** MR_trace_is_nonneg_int is similar, but puts the value of the number in a
+** location of type int.
  **
  ** MR_trace_is_integer is similar, but it also allows an initial minus sign
  ** to denote a negative number.  It puts the value of the number in a location
@@ -56,12 +57,12 @@
  */

  extern  MR_bool MR_trace_is_natural_number(const char *word,
-                    int *value);
+                    MR_Unsigned *value);

  extern  MR_bool MR_trace_is_natural_number_pair(const char *word,
                      MR_Unsigned *value1, MR_Unsigned *value2);

-extern  MR_bool MR_trace_is_unsigned(const char *word, MR_Unsigned *value);
+extern  MR_bool MR_trace_is_nonneg_int(const char *word, int *value);

  extern  MR_bool MR_trace_is_integer(const char *word, MR_Integer *value);

Index: trace/mercury_trace_vars.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_vars.c,v
retrieving revision 1.77
diff -u -r1.77 mercury_trace_vars.c
--- trace/mercury_trace_vars.c	19 Jan 2007 04:42:52 -0000	1.77
+++ trace/mercury_trace_vars.c	1 Oct 2007 13:22:56 -0000
@@ -1097,7 +1097,7 @@
  void
  MR_convert_arg_to_var_spec(const char *word_spec, MR_VarSpec *var_spec)
  {
-    int n;
+    MR_Unsigned n;

      if (MR_trace_is_natural_number(word_spec, &n)) {
          var_spec->MR_var_spec_kind = MR_VAR_SPEC_NUMBER;
@@ -1273,8 +1273,8 @@
  }

  const char *
-MR_trace_browse_action(FILE *out, int action_number, MR_GoalBrowser browser,
-    MR_BrowseCallerType caller, MR_BrowseFormat format)
+MR_trace_browse_action(FILE *out, MR_IoActionNum action_number,
+    MR_GoalBrowser browser, MR_BrowseCallerType caller, MR_BrowseFormat format)
  {
      MR_ConstString  proc_name;
      MR_Word         is_func;
Index: trace/mercury_trace_vars.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_vars.h,v
retrieving revision 1.33
diff -u -r1.33 mercury_trace_vars.h
--- trace/mercury_trace_vars.h	19 Jan 2007 04:42:52 -0000	1.33
+++ trace/mercury_trace_vars.h	1 Oct 2007 06:51:53 -0000
@@ -75,7 +75,7 @@

  typedef struct {
      MR_VarSpecKind      MR_var_spec_kind;
-    int                 MR_var_spec_number; /* valid if NUMBER */
+    MR_Unsigned         MR_var_spec_number; /* valid if NUMBER */
      const char          *MR_var_spec_name;  /* valid if NAME, HELD_NAME */
                                              /* or ATTRIBUTE */
  } MR_VarSpec;
@@ -183,7 +183,8 @@
  ** XXX Actually, the "out" parameter is currently ignored.
  */

-extern  const char  *MR_trace_browse_action(FILE *out, int action_number,
+extern  const char  *MR_trace_browse_action(FILE *out,
+                        MR_IoActionNum action_number,
                          MR_GoalBrowser browser, MR_BrowseCallerType caller,
                          MR_BrowseFormat format);


--------------------------------------------------------------------------
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