summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-27 18:55:54 +0000
committerChristian Heimes <christian@cheimes.de>2008-01-27 18:55:54 +0000
commit412dc9c88f040abf4b23017c5e5e4d8b880d247d (patch)
treee10dee1ac8404c0d3362c48a4350d8e8389b7789 /Modules
parent661b0a15d78b8e86ea4b458550b1cb04f0988424 (diff)
downloadcpython-git-412dc9c88f040abf4b23017c5e5e4d8b880d247d.tar.gz
Merged revisions 60350-60363 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r60355 | neal.norwitz | 2008-01-27 18:10:14 +0100 (Sun, 27 Jan 2008) | 1 line Whitespace cleanup ........ r60356 | neal.norwitz | 2008-01-27 18:10:29 +0100 (Sun, 27 Jan 2008) | 1 line Add assertion that we do not blow out newl ........ r60357 | neal.norwitz | 2008-01-27 18:10:35 +0100 (Sun, 27 Jan 2008) | 1 line Initialize variable to prevent warning on some platform/config. ........ r60358 | neal.norwitz | 2008-01-27 18:10:43 +0100 (Sun, 27 Jan 2008) | 1 line Update to newer version of ffi. Fixes crashes and test failures of longdouble ........ r60359 | neal.norwitz | 2008-01-27 18:10:50 +0100 (Sun, 27 Jan 2008) | 1 line Add a tiny sleep and additional flush to force the file to really be synced. ........ r60360 | neal.norwitz | 2008-01-27 18:10:58 +0100 (Sun, 27 Jan 2008) | 1 line Retry connection in case it fails to reduce flakiness ........ r60361 | neal.norwitz | 2008-01-27 18:11:11 +0100 (Sun, 27 Jan 2008) | 4 lines Catch socket errors that are often the cause of transient failures. Many of these exceptions are due to resource unavailable, so the existing code should be able to handle many more spurious errors. ........ r60362 | neal.norwitz | 2008-01-27 18:12:15 +0100 (Sun, 27 Jan 2008) | 1 line Reduce buffer size since we do not need 1k ........ r60363 | neal.norwitz | 2008-01-27 18:13:07 +0100 (Sun, 27 Jan 2008) | 1 line Print periodic "still working" messages since this suite is slow. ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/libffi/src/alpha/ffi.c54
-rw-r--r--Modules/_ctypes/libffi/src/alpha/osf.S10
-rw-r--r--Modules/_ssl.c2
3 files changed, 49 insertions, 17 deletions
diff --git a/Modules/_ctypes/libffi/src/alpha/ffi.c b/Modules/_ctypes/libffi/src/alpha/ffi.c
index cd34d8bf77..3afc9fd010 100644
--- a/Modules/_ctypes/libffi/src/alpha/ffi.c
+++ b/Modules/_ctypes/libffi/src/alpha/ffi.c
@@ -25,11 +25,22 @@
#include <ffi.h>
#include <ffi_common.h>
-
#include <stdlib.h>
-extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)(void));
-extern void ffi_closure_osf(void);
+/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE;
+ all further uses in this file will refer to the 128-bit type. */
+#if defined(__LONG_DOUBLE_128__)
+# if FFI_TYPE_LONGDOUBLE != 4
+# error FFI_TYPE_LONGDOUBLE out of date
+# endif
+#else
+# undef FFI_TYPE_LONGDOUBLE
+# define FFI_TYPE_LONGDOUBLE 4
+#endif
+
+extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)(void))
+ FFI_HIDDEN;
+extern void ffi_closure_osf(void) FFI_HIDDEN;
ffi_status
@@ -49,6 +60,11 @@ ffi_prep_cif_machdep(ffi_cif *cif)
cif->flags = cif->rtype->type;
break;
+ case FFI_TYPE_LONGDOUBLE:
+ /* 128-bit long double is returned in memory, like a struct. */
+ cif->flags = FFI_TYPE_STRUCT;
+ break;
+
default:
cif->flags = FFI_TYPE_INT;
break;
@@ -57,6 +73,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
return FFI_OK;
}
+
void
ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{
@@ -64,8 +81,6 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
long i, avn;
ffi_type **arg_types;
- FFI_ASSERT (cif->abi == FFI_OSF);
-
/* If the return value is a struct and we don't have a return
value address then we need to make one. */
if (rvalue == NULL && cif->flags == FFI_TYPE_STRUCT)
@@ -84,6 +99,8 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
while (i < avn)
{
+ size_t size = (*arg_types)->size;
+
switch ((*arg_types)->type)
{
case FFI_TYPE_SINT8:
@@ -129,6 +146,12 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
*(double *) argp = *(double *)(* avalue);
break;
+ case FFI_TYPE_LONGDOUBLE:
+ /* 128-bit long double is passed by reference. */
+ *(long double **) argp = (long double *)(* avalue);
+ size = sizeof (long double *);
+ break;
+
case FFI_TYPE_STRUCT:
memcpy(argp, *avalue, (*arg_types)->size);
break;
@@ -137,7 +160,7 @@ ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
FFI_ASSERT(0);
}
- argp += ALIGN((*arg_types)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+ argp += ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
i++, arg_types++, avalue++;
}
@@ -153,8 +176,6 @@ ffi_prep_closure (ffi_closure* closure,
{
unsigned int *tramp;
- FFI_ASSERT (cif->abi == FFI_OSF);
-
tramp = (unsigned int *) &closure->tramp[0];
tramp[0] = 0x47fb0401; /* mov $27,$1 */
tramp[1] = 0xa77b0010; /* ldq $27,16($27) */
@@ -177,7 +198,8 @@ ffi_prep_closure (ffi_closure* closure,
return FFI_OK;
}
-int
+
+long FFI_HIDDEN
ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp)
{
ffi_cif *cif;
@@ -205,6 +227,8 @@ ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp)
/* Grab the addresses of the arguments from the stack frame. */
while (i < avn)
{
+ size_t size = arg_types[i]->size;
+
switch (arg_types[i]->type)
{
case FFI_TYPE_SINT8:
@@ -236,16 +260,22 @@ ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp)
avalue[i] = &argp[argn - (argn < 6 ? 6 : 0)];
break;
+ case FFI_TYPE_LONGDOUBLE:
+ /* 128-bit long double is passed by reference. */
+ avalue[i] = (long double *) argp[argn];
+ size = sizeof (long double *);
+ break;
+
default:
- FFI_ASSERT(0);
+ abort ();
}
- argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+ argn += ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
i++;
}
/* Invoke the closure. */
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
+ closure->fun (cif, rvalue, avalue, closure->user_data);
/* Tell ffi_closure_osf how to perform return type promotions. */
return cif->rtype->type;
diff --git a/Modules/_ctypes/libffi/src/alpha/osf.S b/Modules/_ctypes/libffi/src/alpha/osf.S
index 95b30fae84..aba6782e79 100644
--- a/Modules/_ctypes/libffi/src/alpha/osf.S
+++ b/Modules/_ctypes/libffi/src/alpha/osf.S
@@ -1,10 +1,8 @@
/* -----------------------------------------------------------------------
- osf.S - Copyright (c) 1998, 2001 Red Hat
+ osf.S - Copyright (c) 1998, 2001, 2007 Red Hat
Alpha/OSF Foreign Function Interface
- $Id: osf.S,v 1.2 2006/03/03 20:24:26 theller Exp $
-
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
``Software''), to deal in the Software without restriction, including
@@ -42,6 +40,8 @@
.align 3
.globl ffi_call_osf
.ent ffi_call_osf
+ FFI_HIDDEN(ffi_call_osf)
+
ffi_call_osf:
.frame $15, 32, $26, 0
.mask 0x4008000, -32
@@ -129,6 +129,8 @@ $LFE1:
.align 3
.globl ffi_closure_osf
.ent ffi_closure_osf
+ FFI_HIDDEN(ffi_closure_osf)
+
ffi_closure_osf:
.frame $30, 16*8, $26, 0
.mask 0x4000000, -16*8
@@ -265,7 +267,7 @@ $load_table:
.gprel32 $load_32 # FFI_TYPE_INT
.gprel32 $load_float # FFI_TYPE_FLOAT
.gprel32 $load_double # FFI_TYPE_DOUBLE
- .gprel32 $load_double # FFI_TYPE_LONGDOUBLE
+ .gprel32 $load_none # FFI_TYPE_LONGDOUBLE
.gprel32 $load_u8 # FFI_TYPE_UINT8
.gprel32 $load_s8 # FFI_TYPE_SINT8
.gprel32 $load_u16 # FFI_TYPE_UINT16
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 13d27cc3df..331bffafac 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -684,7 +684,7 @@ _get_peer_alt_names (X509 *certificate) {
}
p = ext->value->data;
- if(method->it)
+ if (method->it)
names = (GENERAL_NAMES*)
(ASN1_item_d2i(NULL,
&p,