diff --git a/ext/ffi_c/Buffer.c b/ext/ffi_c/Buffer.c index faf4834d0..6863dda07 100644 --- a/ext/ffi_c/Buffer.c +++ b/ext/ffi_c/Buffer.c @@ -114,7 +114,7 @@ buffer_initialize(int argc, VALUE* argv, VALUE self) } /* ensure the memory is aligned on at least a 8 byte boundary */ - p->memory.address = (void *) (((uintptr_t) p->data.storage + 0x7) & (uintptr_t) ~0x7UL); + p->memory.address = (void *) (((uintptr_t) p->data.storage + 0x7) & (uintptr_t) ~0x7ULL); if (p->memory.size > 0 && (nargs < 3 || RTEST(rbClear))) { memset(p->memory.address, 0, p->memory.size); @@ -154,7 +154,7 @@ buffer_initialize_copy(VALUE self, VALUE other) return Qnil; } - dst->memory.address = (void *) (((uintptr_t) dst->data.storage + 0x7) & (uintptr_t) ~0x7UL); + dst->memory.address = (void *) (((uintptr_t) dst->data.storage + 0x7) & (uintptr_t) ~0x7ULL); dst->memory.size = src->size; dst->memory.typeSize = src->typeSize; diff --git a/ext/ffi_c/MemoryPointer.c b/ext/ffi_c/MemoryPointer.c index 0d91c35b7..9dc59bb57 100644 --- a/ext/ffi_c/MemoryPointer.c +++ b/ext/ffi_c/MemoryPointer.c @@ -112,7 +112,7 @@ memptr_malloc(VALUE self, long size, long count, bool clear) p->memory.typeSize = (int) size; p->memory.size = msize; /* ensure the memory is aligned on at least a 8 byte boundary */ - p->memory.address = (char *) (((uintptr_t) p->storage + 0x7) & (uintptr_t) ~0x7UL);; + p->memory.address = (char *) (((uintptr_t) p->storage + 0x7) & (uintptr_t) ~0x7ULL); p->allocated = true; if (clear && p->memory.size > 0) { diff --git a/ext/ffi_c/Pointer.c b/ext/ffi_c/Pointer.c index 1eee790db..e5f24a4dc 100644 --- a/ext/ffi_c/Pointer.c +++ b/ext/ffi_c/Pointer.c @@ -183,7 +183,7 @@ ptr_initialize_copy(VALUE self, VALUE other) dst->allocated = true; dst->autorelease = true; - dst->memory.address = (void *) (((uintptr_t) dst->storage + 0x7) & (uintptr_t) ~0x7UL); + dst->memory.address = (void *) (((uintptr_t) dst->storage + 0x7) & (uintptr_t) ~0x7ULL); dst->memory.size = src->size; dst->memory.typeSize = src->typeSize;