aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/cffi/c/libffi_msvc
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/python/cffi/c/libffi_msvc
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/cffi/c/libffi_msvc')
-rw-r--r--contrib/python/cffi/c/libffi_msvc/ffi.c46
-rw-r--r--contrib/python/cffi/c/libffi_msvc/prep_cif.c8
2 files changed, 27 insertions, 27 deletions
diff --git a/contrib/python/cffi/c/libffi_msvc/ffi.c b/contrib/python/cffi/c/libffi_msvc/ffi.c
index 581d659982..4fe84f16b3 100644
--- a/contrib/python/cffi/c/libffi_msvc/ffi.c
+++ b/contrib/python/cffi/c/libffi_msvc/ffi.c
@@ -103,7 +103,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
}
}
#ifdef _WIN64
- else if (z != 1 && z != 2 && z != 4 && z != 8)
+ else if (z != 1 && z != 2 && z != 4 && z != 8)
{
/* On Win64, if a single argument takes more than 8 bytes,
then it is always passed by reference. */
@@ -144,11 +144,11 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
/* MSVC returns small structures in registers. Put in cif->flags
the value FFI_TYPE_STRUCT only if the structure is big enough;
otherwise, put the 4- or 8-bytes integer type. */
- if (cif->rtype->size == 1 ||
- cif->rtype->size == 2 ||
- cif->rtype->size == 4)
+ if (cif->rtype->size == 1 ||
+ cif->rtype->size == 2 ||
+ cif->rtype->size == 4)
cif->flags = FFI_TYPE_INT;
- else if (cif->rtype->size == 8)
+ else if (cif->rtype->size == 8)
cif->flags = FFI_TYPE_SINT64;
else
cif->flags = FFI_TYPE_STRUCT;
@@ -289,7 +289,7 @@ ffi_closure_SYSV (ffi_closure *closure, char *argp)
_asm fld DWORD PTR [eax] ;
// asm ("flds (%0)" : : "r" (resp) : "st" );
}
- else if (rtype == FFI_TYPE_DOUBLE || rtype == FFI_TYPE_LONGDOUBLE)
+ else if (rtype == FFI_TYPE_DOUBLE || rtype == FFI_TYPE_LONGDOUBLE)
{
_asm mov eax, resp ;
_asm fld QWORD PTR [eax] ;
@@ -305,10 +305,10 @@ ffi_closure_SYSV (ffi_closure *closure, char *argp)
// : : "r"(resp)
// : "eax", "edx");
}
- else if (rtype == FFI_TYPE_STRUCT)
- {
- _asm mov eax, resp ;
- }
+ else if (rtype == FFI_TYPE_STRUCT)
+ {
+ _asm mov eax, resp ;
+ }
#else
/* now, do a generic return based on the value of rtype */
if (rtype == FFI_TYPE_INT)
@@ -319,7 +319,7 @@ ffi_closure_SYSV (ffi_closure *closure, char *argp)
{
asm ("flds (%0)" : : "r" (resp) : "st" );
}
- else if (rtype == FFI_TYPE_DOUBLE || rtype == FFI_TYPE_LONGDOUBLE)
+ else if (rtype == FFI_TYPE_DOUBLE || rtype == FFI_TYPE_LONGDOUBLE)
{
asm ("fldl (%0)" : : "r" (resp) : "st", "st(1)" );
}
@@ -330,10 +330,10 @@ ffi_closure_SYSV (ffi_closure *closure, char *argp)
: : "r"(resp)
: "eax", "edx");
}
- else if (rtype == FFI_TYPE_STRUCT)
- {
- asm ("movl %0,%%eax" : : "r" (resp) : "eax");
- }
+ else if (rtype == FFI_TYPE_STRUCT)
+ {
+ asm ("movl %0,%%eax" : : "r" (resp) : "eax");
+ }
#endif
#endif
@@ -342,8 +342,8 @@ ffi_closure_SYSV (ffi_closure *closure, char *argp)
result types except for floats; we have to 'mov xmm0, rax' in the
caller to correct this.
*/
- if (rtype == FFI_TYPE_STRUCT)
- return resp;
+ if (rtype == FFI_TYPE_STRUCT)
+ return resp;
return *(void **)resp;
#endif
}
@@ -382,7 +382,7 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
/* because we're little endian, this is what it turns into. */
#ifdef _WIN64
- if (z != 1 && z != 2 && z != 4 && z != 8)
+ if (z != 1 && z != 2 && z != 4 && z != 8)
{
/* On Win64, if a single argument takes more than 8 bytes,
then it is always passed by reference. */
@@ -451,11 +451,11 @@ ffi_prep_closure_loc (ffi_closure* closure,
|| cif->arg_types[3]->type == FFI_TYPE_DOUBLE))
mask |= 8;
- /* if we return a non-small struct, then the first argument is a pointer
- * to the return area, and all real arguments are shifted by one */
- if (cif->flags == FFI_TYPE_STRUCT)
- mask = (mask & ~8) << 1;
-
+ /* if we return a non-small struct, then the first argument is a pointer
+ * to the return area, and all real arguments are shifted by one */
+ if (cif->flags == FFI_TYPE_STRUCT)
+ mask = (mask & ~8) << 1;
+
/* 41 BB ---- mov r11d,mask */
BYTES("\x41\xBB"); INT(mask);
diff --git a/contrib/python/cffi/c/libffi_msvc/prep_cif.c b/contrib/python/cffi/c/libffi_msvc/prep_cif.c
index df94a98875..5ee83a9f0d 100644
--- a/contrib/python/cffi/c/libffi_msvc/prep_cif.c
+++ b/contrib/python/cffi/c/libffi_msvc/prep_cif.c
@@ -117,10 +117,10 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif,
/* Make space for the return structure pointer */
if (cif->rtype->type == FFI_TYPE_STRUCT
#ifdef _WIN32
- && (cif->rtype->size != 1) /* MSVC returns small structs in registers */
- && (cif->rtype->size != 2)
- && (cif->rtype->size != 4)
- && (cif->rtype->size != 8)
+ && (cif->rtype->size != 1) /* MSVC returns small structs in registers */
+ && (cif->rtype->size != 2)
+ && (cif->rtype->size != 4)
+ && (cif->rtype->size != 8)
#endif
#ifdef SPARC
&& (cif->abi != FFI_V9 || cif->rtype->size > 32)