Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define GC_uintptr_t unconditionally in gc.h
Issue #627 (bdwgc). * cord/cordprnt.c (CORD_vsprintf): Compare len (instead of res) to buf; cast len and buf values to GC_uintptr_t instead of casting res to word and then to char*. * cord/cordxtra.c (CORD_nul_func, CORD_chars, refill_cache, CORD_lf_func): Cast between pointer and char thru GC_uintptr_t instead of word. * include/private/dbg_mlc.h (MARKED_FOR_FINALIZATION, MARKED_FROM_REGISTER, NOT_MARKED): Likewise. * cord/tests/cordtest.c (test_fn, test_cord_x1, test_cord_x2): Likewise. * dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info_inner, GC_check_annotated_obj): Cast body, sz to GC_uintptr_t (instead of word); cast base/ohdr to GC_uintptr_t* instead of word*. * dbg_mlc.c (GC_print_backtrace): Remove out label; adjust indentation. * dbg_mlc.c (GET_OH_LINENUM): Add missing parentheses. * include/gc/gc.h (GC_PRE_INCR3, GC_POST_INCR3): Likewise. * dbg_mlc.c [!SHORT_DBG_HDRS] (GC_print_smashed_obj): Rename clobbered_addr argument to clobbered; reformat comment. * dbg_mlc.c (GC_FREED_MEM_MARKER): Move definition to dbg_mlc.h. * dbg_mlc.c (GC_debug_free): Cast sz and GC_size(base) to GC_uintptr_t; cast p to GC_uintptr_t* instead of word*. * dbg_mlc.c (GC_check_leaked): Cast base to GC_uintptr_t* instead of word*. * include/private/dbg_mlc.h [(KEEP_BACK_PTRS || MAKE_BACK_GRAPH) && !(PARALLEL_MARK || KEEP_BACK_PTRS)] (GC_HAS_DEBUG_INFO): Likewise. * dbg_mlc.c (GC_debug_invoke_finalizer): Change "fns" to "function" in comment. * dbg_mlc.c (store_old, GC_debug_register_finalizer, GC_debug_register_finalizer_no_order, GC_debug_register_finalizer_unreachable, GC_debug_register_finalizer_ignore_self): Store NULL (instead of 0) to *ocd. * gc.man (.TH): Update date. * gc.man (GC_set_warn_proc): Change arg type from GC_word to GC_uintptr_t. * include/gc/gc.h (GC_warn_proc, GC_ignore_warn_proc): Likewise. * misc.c (GC_default_warn_proc, GC_ignore_warn_proc): Likewise. * tests/cpp.cc (warn_proc): Likewise. * gcj_mlc.c (GC_gcj_fake_mark_proc, GC_init_gcj_malloc): Rename FUNCPTR_IS_WORD to FUNCPTR_IS_DATAPTR. * include/private/gc_priv.h (FUNCPTR_IS_WORD): Likewise. * misc.c [!CPPCHECK] (GC_init): Likewise. * pthread_support.c [GC_PTHREADS && !SN_TARGET_ORBIS && !SN_TARGET_PSP2 && DEBUG_THREADS] (GC_start_rtn_prepare_thread): Likewise. * include/gc/gc.h (GC_uintptr_t): Define unconditionally; move definition to the beginning of the file. * include/gc/gc.h (GC_general_register_disappearing_link, GC_malloc_many): Refine comment. * include/private/gc_priv.h (GC_PUSH_ALL_SYM): Likewise. * include/gc/gc.h (GC_hidden_pointer): Change type from GC_word to GC_uintptr_t. * include/private/gc_priv.h (GC_funcptr_uint): Likewise. * include/private/dbg_mlc.h (GC_FREED_MEM_MARKER, START_FLAG, END_FLAG): Cast to GC_uintptr_t instead of word. * include/private/dbg_mlc.h [ALIGNMENT==1] (HIDE_BACK_PTR): Likewise. * include/private/dbg_mlc.h (oh): Remove oh_dummy field; make oh_back_ptr and oh_bg_ptr field either present both or not; refine comment. * include/private/dbg_mlc.h [!SHORT_DBG_HDRS] (oh.oh_sz, oh.oh_sf): Change type from word to GC_uintptr_t. * include/private/gc_priv.h (GC_ASSERT): Move definition upper (to be right after include gc_locks.h). * include/private/gc_priv.h (WARN): Cast arg to GC_uintptr_t instead of word. * include/private/gc_priv.h (WARN_PRIdPTR): Change comment to TODO item. * mallocx.c [_FORTIFY_SOURCE && __GNUC__ && !__clang__] (GC_realloc): Change type of cleared_p local variable from word to GC_uintptr_t; reformat comment. * mallocx.c [!_FORTIFY_SOURCE || !__GNUC__ || __clang__] (GC_realloc): Define cleared_p as a macro (and undefine it at the end of function). * misc.c [!CPPCHECK] (GC_init): Change ptr_t to ptrdiff_t in comparison to sizeof word. * misc.c [!CPPCHECK && FUNCPTR_IS_DATAPTR] (GC_init): Change word to ptr_t in comparison to sizeof GC_funcptr_uint. * misc.c [!CPPCHECK] (GC_init): Add assertion that size of GC_uintptr_t matches size of ptr_t. * pthread_support.c [E2K] (GC_record_stack_base, GC_set_stackbottom): Cast sb->reg_base to GC_uintptr_t instead of ADDR() usage. * pthread_support.c [E2K] (GC_get_my_stackbottom): Cast crtn->ps_ofs to GC_uintptr_t instead of word; add comment. * tests/cpp.cc (Disguise): Change type or result from GC_word to GC_uintptr_t. * tests/cpp.cc (Undisguise): Rename i argument to v and change its type from GC_word to GC_uintptr_t. * tests/cpp.cc (main): Change type of as, bs local variables from GC_word[] to GC_uintptr_t[]. * tests/cpp.cc (INT_TO_SEXPR, SEXPR_TO_INT): Rename argument; cast thru GC_uintptr_t instead of GC_word. * tests/cpp.cc [TEST_WITH_SYSTEM_MALLOC] (reverse): Cast TEST_WITH_SYSTEM_MALLOC() result to GC_word. * tests/cpp.cc (reverse_test_inner, finalizer, mktree): Cast between pointer and int thru GC_uintptr_t instead GC_word. * thread_local_alloc.c (return_freelists, GC_init_thread_local): Likewise. * tests/cpp.cc (warn_proc): Rename argument from p to arg; remove cast of arg to unsigned long.
- Loading branch information