Replace non-API occurrences of GC_word to word
authorIvan Maidanski <ivmai@mail.ru>
Tue, 28 Jul 2015 08:20:44 +0000 (11:20 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 28 Jul 2015 08:20:44 +0000 (11:20 +0300)
(code refactoring)

* finalize.c (last_finalizer_notification): Use "word" type instead of
GC_word.
* include/private/dbg_mlc.h (HIDE_BACK_PTR): Likewise.
* include/private/gc_priv.h (WARN): Likewise.
* include/private/gcconfig.h (POINTER_MASK): Likewise.
* mark.c (GC_push_marked): Likewise.
* misc.c (GC_init, GC_set_max_retries): Likewise.
* os_dep.c (GC_unmap, GC_remap, GC_unmap_gap): Likewise.
* typd_mlc.c (GC_add_ext_descriptor): Likewise.
* include/private/gcconfig.h (GC_amiga_get_mem, ps3_get_mem): Rename
argument to bytes.

finalize.c
include/private/dbg_mlc.h
include/private/gc_priv.h
include/private/gcconfig.h
mark.c
misc.c
os_dep.c
typd_mlc.c

index 26adb11..9b67224 100644 (file)
@@ -1033,7 +1033,7 @@ GC_API int GC_CALL GC_invoke_finalizers(void)
     return count;
 }
 
-static GC_word last_finalizer_notification = 0;
+static word last_finalizer_notification = 0;
 
 GC_INNER void GC_notify_or_invoke_finalizers(void)
 {
index deda69c..663de70 100644 (file)
@@ -78,7 +78,7 @@ typedef struct {
     /* We're careful never to overwrite a value with lsb 0.     */
 #   if ALIGNMENT == 1
       /* Fudge back pointer to be even. */
-#     define HIDE_BACK_PTR(p) GC_HIDE_POINTER(~1 & (GC_word)(p))
+#     define HIDE_BACK_PTR(p) GC_HIDE_POINTER(~1 & (word)(p))
 #   else
 #     define HIDE_BACK_PTR(p) GC_HIDE_POINTER(p)
 #   endif
index 1411b27..f3f0718 100644 (file)
@@ -532,7 +532,7 @@ typedef char * ptr_t;   /* A generic pointer to which we can add        */
 /* The argument (if any) format specifier should be:    */
 /* "%s", "%p" or "%"WARN_PRIdPTR.                       */
 #define WARN(msg, arg) (*GC_current_warn_proc)("GC Warning: " msg, \
-                                               (GC_word)(arg))
+                                               (word)(arg))
 GC_EXTERN GC_warn_proc GC_current_warn_proc;
 
 /* Print format type macro for decimal signed_word value passed WARN(). */
index f1aca2c..5714acd 100644 (file)
 #endif
 
 #if defined(POINTER_SHIFT) && !defined(POINTER_MASK)
-# define POINTER_MASK ((GC_word)(-1))
+# define POINTER_MASK ((word)(-1))
 #endif
 
 #if !defined(FIXUP_POINTER) && defined(POINTER_MASK)
     ptr_t GC_wince_get_mem(GC_word bytes);
 #   define GET_MEM(bytes) (struct hblk *)GC_wince_get_mem(bytes)
 # elif defined(AMIGA) && defined(GC_AMIGA_FASTALLOC)
-    void *GC_amiga_get_mem(size_t size);
+    void *GC_amiga_get_mem(size_t bytes);
 #   define GET_MEM(bytes) HBLKPTR((size_t) \
                           GC_amiga_get_mem((size_t)(bytes) + GC_page_size) \
                           + GC_page_size-1)
 # elif defined(SN_TARGET_PS3)
-    void *ps3_get_mem(size_t size);
+    void *ps3_get_mem(size_t bytes);
 #   define GET_MEM(bytes) (struct hblk*)ps3_get_mem(bytes)
 # else
     ptr_t GC_unix_get_mem(GC_word bytes);
diff --git a/mark.c b/mark.c
index 89f64cc..642dfeb 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -1805,7 +1805,7 @@ STATIC void GC_push_marked(struct hblk *h, hdr *hhdr)
 
     GC_mark_stack_top_reg = GC_mark_stack_top;
     for (p = h -> hb_body; (word)p <= (word)lim; p += sz)
-        if ((*(GC_word *)p & 0x3) != 0)
+        if ((*(word *)p & 0x3) != 0)
             PUSH_OBJ(p, hhdr, GC_mark_stack_top_reg, mark_stack_limit);
     GC_mark_stack_top = GC_mark_stack_top_reg;
   }
diff --git a/misc.c b/misc.c
index 344d7b8..8b87196 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1098,7 +1098,7 @@ GC_API void GC_CALL GC_init(void)
         if (space_divisor_string != NULL) {
           int space_divisor = atoi(space_divisor_string);
           if (space_divisor > 0)
-            GC_free_space_divisor = (GC_word)space_divisor;
+            GC_free_space_divisor = (word)space_divisor;
         }
     }
 #   ifdef USE_MUNMAP
@@ -2243,7 +2243,7 @@ GC_API GC_word GC_CALL GC_get_free_space_divisor(void)
 
 GC_API void GC_CALL GC_set_max_retries(GC_word value)
 {
-    GC_ASSERT(value != ~(GC_word)0);
+    GC_ASSERT(value != ~(word)0);
     GC_max_retries = value;
 }
 
index c79058d..d5bbc70 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -2371,7 +2371,7 @@ GC_INNER void GC_unmap(ptr_t start, size_t bytes)
 #   ifdef USE_WINALLOC
       while (len != 0) {
           MEMORY_BASIC_INFORMATION mem_info;
-          GC_word free_len;
+          word free_len;
 
           if (VirtualQuery(start_addr, &mem_info, sizeof(mem_info))
               != sizeof(mem_info))
@@ -2410,7 +2410,7 @@ GC_INNER void GC_remap(ptr_t start, size_t bytes)
 #   ifdef USE_WINALLOC
       while (len != 0) {
           MEMORY_BASIC_INFORMATION mem_info;
-          GC_word alloc_len;
+          word alloc_len;
           ptr_t result;
 
           if (VirtualQuery(start_addr, &mem_info, sizeof(mem_info))
@@ -2479,7 +2479,7 @@ GC_INNER void GC_unmap_gap(ptr_t start1, size_t bytes1, ptr_t start2,
 #   ifdef USE_WINALLOC
       while (len != 0) {
           MEMORY_BASIC_INFORMATION mem_info;
-          GC_word free_len;
+          word free_len;
 
           if (VirtualQuery(start_addr, &mem_info, sizeof(mem_info))
               != sizeof(mem_info))
index 30646a4..52fe61d 100644 (file)
@@ -110,7 +110,7 @@ STATIC void GC_push_typed_structures_proc(void)
 /* starting index.                                              */
 /* Returns -1 on failure.                                       */
 /* Caller does not hold allocation lock.                        */
-STATIC signed_word GC_add_ext_descriptor(const GC_word * bm, word nbits)
+STATIC signed_word GC_add_ext_descriptor(const word * bm, word nbits)
 {
     size_t nwords = divWORDSZ(nbits + WORDSZ-1);
     signed_word result;