diff options
author | Bo Thorsen <bo@suse.de> | 2002-05-27 13:54:44 +0000 |
---|---|---|
committer | Bo Thorsen <bo@gcc.gnu.org> | 2002-05-27 15:54:44 +0200 |
commit | b86aa7b0487f06daa14d302950147b24edf1d478 (patch) | |
tree | a73c432d6339233c1f180b6e58b4e4443d00a053 /libffi | |
parent | d55bc081750ac5dba90e6043071408ff6d7f29ba (diff) | |
download | gcc-b86aa7b0487f06daa14d302950147b24edf1d478.zip gcc-b86aa7b0487f06daa14d302950147b24edf1d478.tar.gz gcc-b86aa7b0487f06daa14d302950147b24edf1d478.tar.bz2 |
ffi.c (ffi_prep_args): Remove unused variable and fix formatting.
2002-05-27 Bo Thorsen <bo@suse.de>
* src/x86/ffi.c (ffi_prep_args): Remove unused variable and
fix formatting.
From-SVN: r53926
Diffstat (limited to 'libffi')
-rw-r--r-- | libffi/ChangeLog | 5 | ||||
-rw-r--r-- | libffi/src/x86/ffi.c | 98 |
2 files changed, 51 insertions, 52 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 6835bdb..b510f51 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,8 @@ +2002-05-27 Bo Thorsen <bo@suse.de> + + * src/x86/ffi.c (ffi_prep_args): Remove unused variable and + fix formatting. + 2002-05-13 Andreas Tobler <a.tobler@schweiz.ch> * src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at diff --git a/libffi/src/x86/ffi.c b/libffi/src/x86/ffi.c index a6e73f7..b64265b 100644 --- a/libffi/src/x86/ffi.c +++ b/libffi/src/x86/ffi.c @@ -37,7 +37,6 @@ void ffi_prep_args(char *stack, extended_cif *ecif) { register unsigned int i; register int tmp; - register unsigned int avn; register void **p_argv; register char *argp; register ffi_type **p_arg; @@ -45,12 +44,12 @@ void ffi_prep_args(char *stack, extended_cif *ecif) tmp = 0; argp = stack; - if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) { - *(void **) argp = ecif->rvalue; - argp += 4; - } + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) + { + *(void **) argp = ecif->rvalue; + argp += 4; + } - avn = ecif->cif->nargs; p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; @@ -60,58 +59,53 @@ void ffi_prep_args(char *stack, extended_cif *ecif) size_t z; /* Align if necessary */ - if (((*p_arg)->alignment - 1) & (unsigned) argp) { + if (((*p_arg)->alignment - 1) & (unsigned) argp) argp = (char *) ALIGN(argp, (*p_arg)->alignment); - } - if (avn != 0) + z = (*p_arg)->size; + if (z < sizeof(int)) { - avn--; - z = (*p_arg)->size; - if (z < sizeof(int)) - { - z = sizeof(int); - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); - break; - - case FFI_TYPE_SINT32: - *(signed int *) argp = (signed int)*(SINT32 *)(* p_argv); - break; - - case FFI_TYPE_UINT32: - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - break; - - case FFI_TYPE_STRUCT: - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - break; - - default: - FFI_ASSERT(0); - } - } - else + z = sizeof(int); + switch ((*p_arg)->type) { - memcpy(argp, *p_argv, z); + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_SINT32: + *(signed int *) argp = (signed int)*(SINT32 *)(* p_argv); + break; + + case FFI_TYPE_UINT32: + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + break; + + case FFI_TYPE_STRUCT: + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + break; + + default: + FFI_ASSERT(0); } - p_argv++; - argp += z; } + else + { + memcpy(argp, *p_argv, z); + } + p_argv++; + argp += z; } return; |