From 33c46ce5680eea28d3437c8771ec1d137e226b45 Mon Sep 17 00:00:00 2001 From: Zachary Waldowski Date: Sat, 30 Nov 2013 04:13:42 -0500 Subject: [PATCH] Darwin/Mac: Fix 64/32 shortening warnings --- src/x86/ffi64.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c index bd917f07..bd241ef3 100644 --- a/src/x86/ffi64.c +++ b/src/x86/ffi64.c @@ -168,7 +168,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[], case FFI_TYPE_SINT64: case FFI_TYPE_POINTER: { - int size = byte_offset + type->size; + size_t size = byte_offset + type->size; if (size <= 4) { @@ -210,7 +210,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[], case FFI_TYPE_STRUCT: { const int UNITS_PER_WORD = 8; - int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + int words = ((int)type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; ffi_type **ptr; int i; enum x86_64_reg_class subclasses[MAX_CLASSES]; @@ -242,7 +242,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[], return 0; for (i = 0; i < num; i++) { - int pos = byte_offset / 8; + size_t pos = byte_offset / 8; classes[i + pos] = merge_classes (subclasses[i], classes[i + pos]); } @@ -411,7 +411,7 @@ ffi_prep_cif_machdep (ffi_cif *cif) if (ssecount) flags |= 1 << 11; cif->flags = flags; - cif->bytes = ALIGN (bytes, 8); + cif->bytes = (unsigned)ALIGN (bytes, 8); return FFI_OK; }