Prefix ALIGN macros with FFI_

This commit is contained in:
Gregory Pakosz
2017-04-27 13:20:36 +02:00
parent b841ae70a0
commit bd72848c7a
27 changed files with 106 additions and 106 deletions

View File

@@ -135,7 +135,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
break;
}
/* Allocate space for return value pointer. */
bytes += ALIGN (sizeof(void*), FFI_SIZEOF_ARG);
bytes += FFI_ALIGN (sizeof(void*), FFI_SIZEOF_ARG);
}
break;
case FFI_TYPE_COMPLEX:
@@ -173,10 +173,10 @@ ffi_prep_cif_machdep(ffi_cif *cif)
{
ffi_type *t = cif->arg_types[i];
bytes = ALIGN (bytes, t->alignment);
bytes += ALIGN (t->size, FFI_SIZEOF_ARG);
bytes = FFI_ALIGN (bytes, t->alignment);
bytes += FFI_ALIGN (t->size, FFI_SIZEOF_ARG);
}
cif->bytes = ALIGN (bytes, 16);
cif->bytes = FFI_ALIGN (bytes, 16);
return FFI_OK;
}
@@ -341,7 +341,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
}
else
{
size_t za = ALIGN (z, FFI_SIZEOF_ARG);
size_t za = FFI_ALIGN (z, FFI_SIZEOF_ARG);
size_t align = FFI_SIZEOF_ARG;
/* Alignment rules for arguments are quite complex. Vectors and
@@ -363,7 +363,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
}
else
{
argp = (char *)ALIGN (argp, align);
argp = (char *)FFI_ALIGN (argp, align);
memcpy (argp, valp, z);
argp += za;
}
@@ -467,7 +467,7 @@ ffi_closure_inner (struct closure_frame *frame, char *stack)
}
else
{
size_t za = ALIGN (z, FFI_SIZEOF_ARG);
size_t za = FFI_ALIGN (z, FFI_SIZEOF_ARG);
size_t align = FFI_SIZEOF_ARG;
/* See the comment in ffi_call_int. */
@@ -483,7 +483,7 @@ ffi_closure_inner (struct closure_frame *frame, char *stack)
}
else
{
argp = (char *)ALIGN (argp, align);
argp = (char *)FFI_ALIGN (argp, align);
valp = argp;
argp += za;
}
@@ -718,7 +718,7 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *avalue)
else
{
memcpy (argp, avalue, z);
z = ALIGN (z, FFI_SIZEOF_ARG);
z = FFI_ALIGN (z, FFI_SIZEOF_ARG);
argp += z;
}
avalue += z;

View File

@@ -243,7 +243,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
{
size_t num;
byte_offset = ALIGN (byte_offset, (*ptr)->alignment);
byte_offset = FFI_ALIGN (byte_offset, (*ptr)->alignment);
num = classify_argument (*ptr, subclasses, byte_offset % 8);
if (num == 0)
@@ -529,7 +529,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
if (align < 8)
align = 8;
bytes = ALIGN (bytes, align);
bytes = FFI_ALIGN (bytes, align);
bytes += cif->arg_types[i]->size;
}
else
@@ -542,7 +542,7 @@ ffi_prep_cif_machdep (ffi_cif *cif)
flags |= UNIX64_FLAG_XMM_ARGS;
cif->flags = flags;
cif->bytes = ALIGN (bytes, 8);
cif->bytes = FFI_ALIGN (bytes, 8);
return FFI_OK;
}
@@ -604,7 +604,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
align = 8;
/* Pass this argument in memory. */
argp = (void *) ALIGN (argp, align);
argp = (void *) FFI_ALIGN (argp, align);
memcpy (argp, avalue[i], size);
argp += size;
}
@@ -783,7 +783,7 @@ ffi_closure_unix64_inner(ffi_cif *cif,
align = 8;
/* Pass this argument in memory. */
argp = (void *) ALIGN (argp, align);
argp = (void *) FFI_ALIGN (argp, align);
avalue[i] = argp;
argp += arg_types[i]->size;
}