From 416b03bba5ba3b2e90bd234239b9350714fd6de1 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 10 Jan 2012 14:16:26 +0400 Subject: [PATCH] Add 'const' qualifier for GC_make_descriptor bitmap argument * 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 | 2 +- tests/test.c | 2 +- typd_mlc.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/gc_typed.h b/include/gc_typed.h index a794fbbe..0eeb2538 100644 --- a/include/gc_typed.h +++ b/include/gc_typed.h @@ -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. */ diff --git a/tests/test.c b/tests/test.c index e51f74cf..9125e750 100644 --- a/tests/test.c +++ b/tests/test.c @@ -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, diff --git a/typd_mlc.c b/typd_mlc.c index e94171be..aba8e64a 100644 --- a/typd_mlc.c +++ b/typd_mlc.c @@ -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; -- 2.40.0