Correction for older compilers
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
diff --git a/src/aarch64/ffi.c b/src/aarch64/ffi.c
index be87051..dc6338b 100644
--- a/src/aarch64/ffi.c
+++ b/src/aarch64/ffi.c
@@ -295,7 +295,7 @@ allocate_to_stack (struct arg_state *state, void *stack,
if (alignment < 8)
alignment = 8;
#endif
-
+
nsaa = FFI_ALIGN (nsaa, alignment);
state->nsaa = nsaa + size;
@@ -323,40 +323,55 @@ extend_integer_type (void *source, int type)
switch (type)
{
case FFI_TYPE_UINT8:
- UINT8 u8;
- memcpy (&u8, source, sizeof (u8));
- return u8;
+ {
+ UINT8 u8;
+ memcpy (&u8, source, sizeof (u8));
+ return u8;
+ }
case FFI_TYPE_SINT8:
- SINT8 s8;
- memcpy (&s8, source, sizeof (s8));
- return s8;
+ {
+ SINT8 s8;
+ memcpy (&s8, source, sizeof (s8));
+ return s8;
+ }
case FFI_TYPE_UINT16:
- UINT16 u16;
- memcpy (&u16, source, sizeof (u16));
- return u16;
+ {
+ UINT16 u16;
+ memcpy (&u16, source, sizeof (u16));
+ return u16;
+ }
case FFI_TYPE_SINT16:
- SINT8 s16;
- memcpy (&s16, source, sizeof (s16));
- return s16;
+ {
+ SINT8 s16;
+ memcpy (&s16, source, sizeof (s16));
+ return s16;
+ }
case FFI_TYPE_UINT32:
- UINT8 u32;
- memcpy (&u32, source, sizeof (u32));
- return u32;
+ {
+ UINT8 u32;
+ memcpy (&u32, source, sizeof (u32));
+ return u32;
+ }
case FFI_TYPE_INT:
case FFI_TYPE_SINT32:
- SINT8 s32;
- memcpy (&s32, source, sizeof (s32));
- return s32;
+ {
+ SINT8 s32;
+ memcpy (&s32, source, sizeof (s32));
+ return s32;
+ }
case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64:
- UINT64 u64;
- memcpy (&u64, source, sizeof (u64));
- return u64;
- break;
+ {
+ UINT64 u64;
+ memcpy (&u64, source, sizeof (u64));
+ return u64;
+ }
case FFI_TYPE_POINTER:
- uintptr_t uptr;
- memcpy (&uptr, source, sizeof (uptr));
- return uptr;
+ {
+ uintptr_t uptr;
+ memcpy (&uptr, source, sizeof (uptr));
+ return uptr;
+ }
default:
abort();
}
@@ -841,7 +856,7 @@ ffi_prep_closure_loc (ffi_closure *closure,
return FFI_BAD_ABI;
void (*start)(void);
-
+
if (cif->flags & AARCH64_FLAG_ARG_V)
start = ffi_closure_SYSV_V;
else
@@ -879,7 +894,7 @@ ffi_prep_closure_loc (ffi_closure *closure,
/* Initialize the dynamic trampoline. */
memcpy (tramp, trampoline, sizeof(trampoline));
-
+
*(UINT64 *)(tramp + 16) = (uintptr_t)start;
ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE);
@@ -1007,7 +1022,7 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
{
void *reg = &context->x[state.ngrn];
state.ngrn += (unsigned int)n;
-
+
/* Eeek! We need a pointer to the structure, however the
homogeneous float elements are being passed in individual
registers, therefore for float and double the structure