Darwin/Mac: Fix 64/32 shortening warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c
index bd917f0..bd241ef 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;
}