replace size_t casts to pointers with (u)intptr_t.

This commit is contained in:
Ozkan Sezer 2021-08-10 01:04:50 +03:00
parent 3c8611f604
commit 2d9eb310bc
2 changed files with 3 additions and 3 deletions

View File

@ -295,7 +295,7 @@ void Q_memset (void *dest, int fill, size_t count)
{
size_t i;
if ( (((size_t)dest | count) & 3) == 0)
if ( (((uintptr_t)dest | count) & 3) == 0)
{
count >>= 2;
fill = fill | (fill<<8) | (fill<<16) | (fill<<24);
@ -311,7 +311,7 @@ void Q_memcpy (void *dest, const void *src, size_t count)
{
size_t i;
if (( ( (size_t)dest | (size_t)src | count) & 3) == 0 )
if (( ( (uintptr_t)dest | (uintptr_t)src | count) & 3) == 0)
{
count >>= 2;
for (i = 0; i < count; i++)

View File

@ -109,7 +109,7 @@ COMPILE_TIME_ASSERT(enum, sizeof(THE_DUMMY_ENUM) == sizeof(int));
* This variant works on most (but not *all*) systems...
*/
#ifndef offsetof
#define offsetof(t,m) ((size_t)&(((t *)0)->m))
#define offsetof(t,m) ((intptr_t)&(((t *)0)->m))
#endif