]> granicus.if.org Git - gc/commitdiff
Add 'const' qualifier for GC_make_descriptor bitmap argument
authorIvan Maidanski <ivmai@mail.ru>
Tue, 10 Jan 2012 10:16:26 +0000 (14:16 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 10 Jan 2012 10:16:26 +0000 (14:16 +0400)
* include/gc_typed.h (GC_make_descriptor): Make bm pointer const
(replace GC_bitmap type with "const GC_word*").
* typd_mlc.c (GC_add_ext_descriptor, GC_make_descriptor): Likewise.
* tests/test.c (bm_huge): Make array const to test updated
GC_make_descriptor declaration.

include/gc_typed.h
tests/test.c
typd_mlc.c

index a794fbbe4101550c4ad7a37e09e3f29454cd282c..0eeb25380bc135b18bdc158b8137f9bf89d42ea4 100644 (file)
@@ -48,7 +48,7 @@ typedef GC_word * GC_bitmap;
 
 typedef GC_word GC_descr;
 
-GC_API GC_descr GC_CALL GC_make_descriptor(GC_bitmap /* bm */,
+GC_API GC_descr GC_CALL GC_make_descriptor(const GC_word * /* GC_bitmap bm */,
                                            size_t /* len */);
                 /* Return a type descriptor for the object whose layout */
                 /* is described by the argument.                        */
index e51f74cf0c0d903e27e1ad33537b5fe58831c520..9125e75007aee08e429dcb30385648d3ad17a871 100644 (file)
@@ -924,7 +924,7 @@ void tree_test(void)
 
 unsigned n_tests = 0;
 
-GC_word bm_huge[10] = {
+const GC_word bm_huge[10] = {
     0xffffffff,
     0xffffffff,
     0xffffffff,
index e94171beaf855764e7633a37e96d4c547da3c6bb..aba8e64ae3e0b1f59dd91489a0d3104d6c9ac1d6 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(GC_bitmap bm, word nbits)
+STATIC signed_word GC_add_ext_descriptor(const GC_word * bm, word nbits)
 {
     size_t nwords = divWORDSZ(nbits + WORDSZ-1);
     signed_word result;
@@ -532,7 +532,7 @@ STATIC mse * GC_array_mark_proc(word * addr, mse * mark_stack_ptr,
     return new_mark_stack_ptr;
 }
 
-GC_API GC_descr GC_CALL GC_make_descriptor(GC_bitmap bm, size_t len)
+GC_API GC_descr GC_CALL GC_make_descriptor(const GC_word * bm, size_t len)
 {
     signed_word last_set_bit = len - 1;
     GC_descr result;