Darwin: Silence Clang warnings.

This commit is contained in:
Zachary Waldowski
2012-04-11 23:26:04 -04:00
parent ac75368893
commit 16ba1b8002
3 changed files with 57 additions and 53 deletions

View File

@@ -122,6 +122,7 @@ static size_t ffi_put_arg(ffi_type **arg_type, void **arg, char *stack)
value is cif->vfp_used (word bitset of VFP regs used for passing value is cif->vfp_used (word bitset of VFP regs used for passing
arguments). These are only used for the VFP hard-float ABI. arguments). These are only used for the VFP hard-float ABI.
*/ */
int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space);
int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space) int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space)
{ {
register unsigned int i; register unsigned int i;
@@ -149,6 +150,7 @@ int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space)
return 0; return 0;
} }
int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space);
int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space) int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
{ {
// make sure we are using FFI_VFP // make sure we are using FFI_VFP
@@ -160,7 +162,7 @@ int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
register ffi_type **p_arg; register ffi_type **p_arg;
char stack_used = 0; char stack_used = 0;
char done_with_regs = 0; char done_with_regs = 0;
char is_vfp_type; int is_vfp_type;
/* the first 4 words on the stack are used for values passed in core /* the first 4 words on the stack are used for values passed in core
* registers. */ * registers. */
@@ -346,9 +348,9 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
FFI_ASSERT(0); FFI_ASSERT(0);
break; break;
} }
if (small_struct) if (small_struct && rvalue != NULL)
memcpy (rvalue, &temp, cif->rtype->size); memcpy (rvalue, &temp, cif->rtype->size);
else if (vfp_struct) else if (vfp_struct && rvalue != NULL)
memcpy (rvalue, ecif.rvalue, cif->rtype->size); memcpy (rvalue, ecif.rvalue, cif->rtype->size);
} }
@@ -366,6 +368,7 @@ void ffi_closure_VFP (ffi_closure *);
/* This function is jumped to by the trampoline */ /* This function is jumped to by the trampoline */
unsigned int ffi_closure_inner (ffi_closure *closure, void **respp, void *args, void *vfp_args);
unsigned int unsigned int
ffi_closure_inner (ffi_closure *closure, ffi_closure_inner (ffi_closure *closure,
void **respp, void *args, void *vfp_args) void **respp, void *args, void *vfp_args)
@@ -447,7 +450,7 @@ ffi_prep_incoming_args_VFP(char *stack, void **rvalue,
register ffi_type **p_arg; register ffi_type **p_arg;
char done_with_regs = 0; char done_with_regs = 0;
char stack_used = 0; char stack_used = 0;
char is_vfp_type; int is_vfp_type;
FFI_ASSERT(cif->abi == FFI_VFP); FFI_ASSERT(cif->abi == FFI_VFP);
regp = stack; regp = stack;
@@ -881,7 +884,7 @@ static int place_vfp_arg (ffi_cif *cif, ffi_type *t)
} }
/* Found regs to allocate. */ /* Found regs to allocate. */
cif->vfp_used |= new_used; cif->vfp_used |= new_used;
cif->vfp_args[cif->vfp_nargs++] = reg; cif->vfp_args[cif->vfp_nargs++] = (typeof(*(cif->vfp_args)))reg;
/* Update vfp_reg_free. */ /* Update vfp_reg_free. */
if (cif->vfp_used & (1 << cif->vfp_reg_free)) if (cif->vfp_used & (1 << cif->vfp_reg_free))
@@ -889,7 +892,7 @@ static int place_vfp_arg (ffi_cif *cif, ffi_type *t)
reg += nregs; reg += nregs;
while (cif->vfp_used & (1 << reg)) while (cif->vfp_used & (1 << reg))
reg += 1; reg += 1;
cif->vfp_reg_free = reg; cif->vfp_reg_free = (typeof(cif->vfp_reg_free))reg;
} }
return 0; return 0;
next_reg: ; next_reg: ;

View File

@@ -3388,7 +3388,7 @@ static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) {
*ss = m->seg; /* Push current record */ *ss = m->seg; /* Push current record */
m->seg.base = tbase; m->seg.base = tbase;
m->seg.size = tsize; m->seg.size = tsize;
set_segment_flags(&m->seg, mmapped); (void)set_segment_flags(&m->seg, mmapped);
m->seg.next = ss; m->seg.next = ss;
/* Insert trailing fenceposts */ /* Insert trailing fenceposts */
@@ -3548,7 +3548,7 @@ static void* sys_alloc(mstate m, size_t nb) {
if (!is_initialized(m)) { /* first-time initialization */ if (!is_initialized(m)) { /* first-time initialization */
m->seg.base = m->least_addr = tbase; m->seg.base = m->least_addr = tbase;
m->seg.size = tsize; m->seg.size = tsize;
set_segment_flags(&m->seg, mmap_flag); (void)set_segment_flags(&m->seg, mmap_flag);
m->magic = mparams.magic; m->magic = mparams.magic;
init_bins(m); init_bins(m);
if (is_global(m)) if (is_global(m))

View File

@@ -42,6 +42,7 @@
/* ffi_prep_args is called by the assembly routine once stack space /* ffi_prep_args is called by the assembly routine once stack space
has been allocated for the function's arguments */ has been allocated for the function's arguments */
void ffi_prep_args(char *stack, extended_cif *ecif);
void ffi_prep_args(char *stack, extended_cif *ecif) void ffi_prep_args(char *stack, extended_cif *ecif)
{ {
register unsigned int i; register unsigned int i;