libc/string/lib_vikmemcpy.c: fix 'casting pointer to integer of different size' compiler warnings

This commit is contained in:
Jussi Kivilinna 2017-05-31 09:33:44 -06:00 committed by Gregory Nutt
parent 1cc842794d
commit 705185be1e

View File

@ -240,9 +240,9 @@
#define COPY_SHIFT(shift) \ #define COPY_SHIFT(shift) \
{ \ { \
UIntN* dstN = (UIntN*)((((UIntN)dst8) PRE_LOOP_ADJUST) & \ UIntN* dstN = (UIntN*)((((uintptr_t)dst8) PRE_LOOP_ADJUST) & \
~(TYPE_WIDTH - 1)); \ ~(TYPE_WIDTH - 1)); \
UIntN* srcN = (UIntN*)((((UIntN)src8) PRE_LOOP_ADJUST) & \ UIntN* srcN = (UIntN*)((((uintptr_t)src8) PRE_LOOP_ADJUST) & \
~(TYPE_WIDTH - 1)); \ ~(TYPE_WIDTH - 1)); \
size_t length = count / TYPE_WIDTH; \ size_t length = count / TYPE_WIDTH; \
UIntN srcWord = INC_VAL(srcN); \ UIntN srcWord = INC_VAL(srcN); \
@ -324,13 +324,13 @@ FAR void *memcpy(FAR void *dest, FAR const void *src, size_t count)
START_VAL(dst8); START_VAL(dst8);
START_VAL(src8); START_VAL(src8);
while (((UIntN)dst8 & (TYPE_WIDTH - 1)) != WHILE_DEST_BREAK) while (((uintptr_t)dst8 & (TYPE_WIDTH - 1)) != WHILE_DEST_BREAK)
{ {
INC_VAL(dst8) = INC_VAL(src8); INC_VAL(dst8) = INC_VAL(src8);
count--; count--;
} }
switch ((((UIntN)src8) PRE_SWITCH_ADJUST) & (TYPE_WIDTH - 1)) switch ((((uintptr_t)src8) PRE_SWITCH_ADJUST) & (TYPE_WIDTH - 1))
{ {
case 0: COPY_NO_SHIFT(); break; case 0: COPY_NO_SHIFT(); break;
case 1: COPY_SHIFT(1); break; case 1: COPY_SHIFT(1); break;