diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-10-20 00:33:18 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-10-20 00:40:08 +0300 |
commit | 16260f977ff75d60f547e2ffb9522a475e38a4da (patch) | |
tree | 5c47515f6f3421e7cdcd3e76d5ca0f6cdbf86c62 /os_dep.c | |
parent | 94d3d5cbb1face170c5687013184937c2efc9a5f (diff) | |
download | bdwgc-16260f977ff75d60f547e2ffb9522a475e38a4da.tar.gz |
Eliminate 'parameter can be declared as const pointer' cppcheck warnings
(refactoring)
* allchblk.c (free_list_index_of): Add const to pointer argument.
* backgraph.c (is_in_progress): Likewise.
* include/private/gc_priv.h [MSWIN32 || MSWINCE || CYGWIN32]
(GC_is_heap_base): Likewise.
* os_dep.c [USE_WINALLOC && !REDIRECT_MALLOC] (GC_is_malloc_heap_base):
Likewise.
* os_dep.c [MSWIN32 || MSWINCE || CYGWIN32] (GC_is_heap_base):
Likewise.
* os_dep.c [CHECKSUMS && (GWW_VDB || SOFT_VDB) || PROC_VDB]
(GC_or_pages): Likewise.
* finalize.c (GC_grow_table): Add const to entries_ptr argument.
* os_dep.c [USE_WINALLOC && !REDIRECT_MALLOC] (GC_is_malloc_heap_base):
Change while loop to for.
Diffstat (limited to 'os_dep.c')
-rw-r--r-- | os_dep.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1826,13 +1826,12 @@ void GC_register_data_segments(void) /* Is p the base of one of the malloc heap sections we already know */ /* about? */ - STATIC GC_bool GC_is_malloc_heap_base(void *p) + STATIC GC_bool GC_is_malloc_heap_base(const void *p) { - struct GC_malloc_heap_list *q = GC_malloc_heap_l; + struct GC_malloc_heap_list *q; - while (0 != q) { + for (q = GC_malloc_heap_l; q != NULL; q = q -> next) { if (q -> allocation_base == p) return TRUE; - q = q -> next; } return FALSE; } @@ -1901,7 +1900,7 @@ void GC_register_data_segments(void) /* Is p the start of either the malloc heap, or of one of our */ /* heap sections? */ - GC_INNER GC_bool GC_is_heap_base(void *p) + GC_INNER GC_bool GC_is_heap_base(const void *p) { int i; @@ -2946,7 +2945,7 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void) #if (defined(CHECKSUMS) && (defined(GWW_VDB) || defined(SOFT_VDB))) \ || defined(PROC_VDB) /* Add all pages in pht2 to pht1. */ - STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2) + STATIC void GC_or_pages(page_hash_table pht1, const word *pht2) { unsigned i; for (i = 0; i < PHT_SIZE; i++) pht1[i] |= pht2[i]; |