[m-rev.] diff: fix untagged trail implementation

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Jan 21 14:34:46 AEDT 2008


Estimated hours taken: 0.1
Branches: main

Fix some bitrot in the untagged trail implementation.

runtime/mercury_trail.h:
 	s/MR_kind/MR_entry_kind/ for the initial field of the
 	MR_TrailEntry_Struct structure.

 	Use the #if defined(...) form of conditional inclusion
 	throughout.

Julien.

Index: mercury_trail.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_trail.h,v
retrieving revision 1.26
diff -u -r1.26 mercury_trail.h
--- mercury_trail.h	10 May 2007 05:24:16 -0000	1.26
+++ mercury_trail.h	21 Jan 2008 03:31:11 -0000
@@ -214,7 +214,7 @@
  typedef void MR_untrail_func_type(void *datum, MR_untrail_reason);

  struct MR_TrailEntry_Struct {
-#if !(MR_USE_TAGGED_TRAIL)
+#if !defined(MR_USE_TAGGED_TRAIL)
      MR_trail_entry_kind MR_entry_kind;
  #endif
      union {
@@ -234,7 +234,7 @@
  ** DO NOT ACCESS THE FIELDS DIRECTLY.
  */

-#if MR_USE_TAGGED_TRAIL
+#if defined(MR_USE_TAGGED_TRAIL)
    #define MR_func_trail_tag MR_mktag(MR_func_entry)
    #define MR_value_trail_tag    MR_mktag(MR_val_entry)

@@ -285,7 +285,7 @@
          (entry)->MR_union.MR_func.MR_datum = (datum);                       \
        } while (0)
  #else /* !MR_USE_TAGGED_TRAIL */
-  #define MR_get_trail_entry_kind(entry) ((entry)->MR_kind)
+  #define MR_get_trail_entry_kind(entry) ((entry)->MR_entry_kind)

    #define MR_get_trail_entry_address(entry)                                 \
      ((entry)->MR_union.MR_val.MR_address)
@@ -299,7 +299,7 @@
    */
    #define MR_store_value_trail_entry(entry, address, value)                 \
        do {                                                                  \
-        (entry)->MR_kind = MR_val_entry;                                    \
+        (entry)->MR_entry_kind = MR_val_entry;                              \
          (entry)->MR_union.MR_val.MR_address = (address);                    \
          (entry)->MR_union.MR_val.MR_value = (value);                        \
        } while (0)
@@ -310,7 +310,7 @@
    */
    #define MR_store_function_trail_entry(entry, func, datum)                 \
        do {                                                                  \
-        (entry)->MR_kind = MR_func_entry;                                   \
+        (entry)->MR_entry_kind = MR_func_entry;                             \
          (entry)->MR_union.MR_func.MR_untrail_func = (func);                 \
          (entry)->MR_union.MR_func.MR_datum = (datum);                       \
        } 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