diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-07-11 00:22:20 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-07-11 11:52:45 +0300 |
commit | 0ea46164887d647eefac6b15f178880f1cd17314 (patch) | |
tree | 01797ef9b027e4db0fd1d9dd41f7c0fdfb1c18ea | |
parent | 76dcd13dd225ea144268abf8acbb1d1c1be26581 (diff) | |
download | bdwgc-0ea46164887d647eefac6b15f178880f1cd17314.tar.gz |
Eliminate 'condition is always true' cppcheck warning in init_gcj_malloc
* gcj_mlc.c (GC_init_gcj_malloc): Define ignore_gcj_info as macro
if GC_IGNORE_GCJ_INFO; undefine ignore_gcj_info at the end of the
function.
-rw-r--r-- | gcj_mlc.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -67,7 +67,9 @@ STATIC struct GC_ms_entry * GC_gcj_fake_mark_proc(word * addr GC_ATTR_UNUSED, GC_API void GC_CALL GC_init_gcj_malloc(int mp_index, void * /* really GC_mark_proc */mp) { - GC_bool ignore_gcj_info; +# ifndef GC_IGNORE_GCJ_INFO + GC_bool ignore_gcj_info; +# endif DCL_LOCK_STATE; if (mp == 0) /* In case GC_DS_PROC is unused. */ @@ -82,7 +84,7 @@ GC_API void GC_CALL GC_init_gcj_malloc(int mp_index, GC_gcj_malloc_initialized = TRUE; # ifdef GC_IGNORE_GCJ_INFO /* This is useful for debugging on platforms with missing getenv(). */ - ignore_gcj_info = 1; +# define ignore_gcj_info TRUE # else ignore_gcj_info = (0 != GETENV("GC_IGNORE_GCJ_INFO")); # endif @@ -119,6 +121,7 @@ GC_API void GC_CALL GC_init_gcj_malloc(int mp_index, FALSE, TRUE); } UNLOCK(); +# undef ignore_gcj_info } #define GENERAL_MALLOC_INNER(lb,k) \ |