Merge pull request #449 from gpakosz/align-macros

Prefix ALIGN_DOWN macro with FFI_
This commit is contained in:
Tom Tromey
2018-09-18 08:26:31 -06:00
committed by GitHub
4 changed files with 4 additions and 4 deletions

View File

@@ -77,7 +77,7 @@ void ffi_type_test(ffi_type *a, char *file, int line);
/* v cast to size_t and aligned up to a multiple of a */
#define FFI_ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1)
/* v cast to size_t and aligned down to a multiple of a */
#define ALIGN_DOWN(v, a) (((size_t) (v)) & -a)
#define FFI_ALIGN_DOWN(v, a) (((size_t) (v)) & -a)
/* Perform machine dependent cif processing */
ffi_status ffi_prep_cif_machdep(ffi_cif *cif);

View File

@@ -107,7 +107,7 @@ void *ffi_prep_args(char *stack, extended_cif *ecif)
count += z;
}
return (stack + ((count > 24) ? 24 : ALIGN_DOWN(count, 8)));
return (stack + ((count > 24) ? 24 : FFI_ALIGN_DOWN(count, 8)));
}
/* Perform machine dependent cif processing */

View File

@@ -61,7 +61,7 @@ unsigned int ffi_prep_args(char *stack, extended_cif *ecif)
argp -= z;
/* Align if necessary */
argp = (char *) ALIGN_DOWN(ALIGN_DOWN(argp, (*p_arg)->alignment), 4);
argp = (char *) FFI_ALIGN_DOWN(FFI_ALIGN_DOWN(argp, (*p_arg)->alignment), 4);
if (z < sizeof(int)) {
z = sizeof(int);

View File

@@ -100,7 +100,7 @@ void *ffi_prep_args(char *stack, extended_cif *ecif)
count += z;
}
return (stack + ((count > 24) ? 24 : ALIGN_DOWN(count, 8)));
return (stack + ((count > 24) ? 24 : FFI_ALIGN_DOWN(count, 8)));
}
/* Perform machine dependent cif processing */