mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-03 01:12:51 +00:00
ntdll: Avoid comparing the result of pointer arithmetic to zero.
gcc warns about this: ../wine/dlls/ntdll/unix/virtual.c: In function ‘mmap_add_reserved_area’: ../wine/dlls/ntdll/unix/virtual.c:241:9: error: the comparison will always evaluate as ‘true’ for the pointer operand in ‘(char *)addr + (sizetype)size’ must not be NULL [-Werror=address] 241 | if (!((char *)addr + size)) size--; /* avoid wrap-around */ | ^
This commit is contained in:
parent
5965771a9c
commit
539ef7c462
|
@ -238,7 +238,7 @@ static void mmap_add_reserved_area( void *addr, SIZE_T size )
|
|||
struct reserved_area *area;
|
||||
struct list *ptr;
|
||||
|
||||
if (!((char *)addr + size)) size--; /* avoid wrap-around */
|
||||
if (!((intptr_t)addr + size)) size--; /* avoid wrap-around */
|
||||
|
||||
LIST_FOR_EACH( ptr, &reserved_areas )
|
||||
{
|
||||
|
@ -287,7 +287,7 @@ static void mmap_remove_reserved_area( void *addr, SIZE_T size )
|
|||
struct reserved_area *area;
|
||||
struct list *ptr;
|
||||
|
||||
if (!((char *)addr + size)) size--; /* avoid wrap-around */
|
||||
if (!((intptr_t)addr + size)) size--; /* avoid wrap-around */
|
||||
|
||||
ptr = list_head( &reserved_areas );
|
||||
/* find the first area covering address */
|
||||
|
|
Loading…
Reference in a new issue