Darwin/Mac: Fix 64/32 shortening warnings

This commit is contained in:
Zachary Waldowski
2013-11-30 04:13:42 -05:00
parent 0612081e6c
commit 33c46ce568

View File

@@ -168,7 +168,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
case FFI_TYPE_SINT64: case FFI_TYPE_SINT64:
case FFI_TYPE_POINTER: case FFI_TYPE_POINTER:
{ {
int size = byte_offset + type->size; size_t size = byte_offset + type->size;
if (size <= 4) if (size <= 4)
{ {
@@ -210,7 +210,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
case FFI_TYPE_STRUCT: case FFI_TYPE_STRUCT:
{ {
const int UNITS_PER_WORD = 8; 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; ffi_type **ptr;
int i; int i;
enum x86_64_reg_class subclasses[MAX_CLASSES]; 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; return 0;
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
int pos = byte_offset / 8; size_t pos = byte_offset / 8;
classes[i + pos] = classes[i + pos] =
merge_classes (subclasses[i], classes[i + pos]); merge_classes (subclasses[i], classes[i + pos]);
} }
@@ -411,7 +411,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
if (ssecount) if (ssecount)
flags |= 1 << 11; flags |= 1 << 11;
cif->flags = flags; cif->flags = flags;
cif->bytes = ALIGN (bytes, 8); cif->bytes = (unsigned)ALIGN (bytes, 8);
return FFI_OK; return FFI_OK;
} }