Fix compiler warning in 32bits due to size mismatch in ptr cast (#3427)

Casting a ptr to an integer of a different size causes a warning - this is only noticeable on 32bits. Fix this by using `TO_VOIDP` and `TO_PTR` helper macros.
This commit is contained in:
Paulo Matos 2020-10-06 14:36:53 +02:00 committed by GitHub
parent da6fd94fe1
commit 8a14d31f06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -576,7 +576,7 @@ static void check_pointer(ptr *pp, IBOOL address_is_meaningful, ptr base, uptr s
}
if (address_is_meaningful) {
seginfo *ppsi = MaybeSegInfo(ptr_get_segment(pp));
seginfo *ppsi = MaybeSegInfo(ptr_get_segment(TO_PTR(pp)));
if ((ppsi != NULL)
&& (ppsi->generation > psi->generation)
/* space_data includes stacks, which are always swept */
@ -854,7 +854,7 @@ void S_check_heap(aftergc, mcg) IBOOL aftergc; IGEN mcg; {
pp1 = TO_VOIDP((ptr)((uptr)TO_PTR(pp1) + size_object(p)));
} else {
/* skip past unmarked */
pp1 = TO_VOIDP((ptr)((uptr)pp1 + byte_alignment));
pp1 = TO_VOIDP((ptr)((uptr)TO_PTR(pp1) + byte_alignment));
}
} else {
if (*pp1 == forward_marker)