Darwin/Mac: Fix 64/32 shortening warnings
authorZachary Waldowski <zwaldowski@gmail.com>
Sat, 30 Nov 2013 09:13:42 +0000 (04:13 -0500)
committerZachary Waldowski <zwaldowski@gmail.com>
Sat, 30 Nov 2013 09:14:10 +0000 (04:14 -0500)
src/x86/ffi64.c

index bd917f0..bd241ef 100644 (file)
@@ -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;
 }