diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-21 00:42:08 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-21 00:42:08 +0000 |
commit | e7d3e20912baa82965108997013710223152772c (patch) | |
tree | 02d4ed8e367319884582025cb1da2f4c45a05190 /sys/src/cmd/python | |
parent | 9adf75a7091c7bd2afefbeba62a2525d50df4404 (diff) |
remove keyboard stuff from other ports, make openssl and python compile on arm
Diffstat (limited to 'sys/src/cmd/python')
-rw-r--r-- | sys/src/cmd/python/Modules/_lsprof.c | 10 | ||||
-rw-r--r-- | sys/src/cmd/python/Modules/bz2module.c | 6 | ||||
-rw-r--r-- | sys/src/cmd/python/Modules/fcntlmodule.c | 14 | ||||
-rw-r--r-- | sys/src/cmd/python/Modules/posixmodule.c | 12 | ||||
-rw-r--r-- | sys/src/cmd/python/Modules/testcapi_long.h | 11 | ||||
-rw-r--r-- | sys/src/cmd/python/Objects/fileobject.c | 13 | ||||
-rw-r--r-- | sys/src/cmd/python/Python/marshal.c | 2 | ||||
-rw-r--r-- | sys/src/cmd/python/plan9.c | 2 |
8 files changed, 46 insertions, 24 deletions
diff --git a/sys/src/cmd/python/Modules/_lsprof.c b/sys/src/cmd/python/Modules/_lsprof.c index d35c894c5..962349829 100644 --- a/sys/src/cmd/python/Modules/_lsprof.c +++ b/sys/src/cmd/python/Modules/_lsprof.c @@ -156,9 +156,13 @@ static PY_LONG_LONG CallExternalTimer(ProfilerObject *pObj) return result; } -#define CALL_TIMER(pObj) ((pObj)->externalTimer ? \ - CallExternalTimer(pObj) : \ - hpTimer()) +static PY_LONG_LONG +CALL_TIMER(ProfilerObject *pObj) +{ + if(pObj->externalTimer) + return CallExternalTimer(pObj); + return hpTimer(); +} /*** ProfilerObject ***/ diff --git a/sys/src/cmd/python/Modules/bz2module.c b/sys/src/cmd/python/Modules/bz2module.c index 9d92cf6bb..dec7a987c 100644 --- a/sys/src/cmd/python/Modules/bz2module.c +++ b/sys/src/cmd/python/Modules/bz2module.c @@ -1007,8 +1007,10 @@ BZ2File_seek(BZ2FileObject *self, PyObject *args) #if !defined(HAVE_LARGEFILE_SUPPORT) offset = PyInt_AsLong(offobj); #else - offset = PyLong_Check(offobj) ? - PyLong_AsLongLong(offobj) : PyInt_AsLong(offobj); + if(PyLong_Check(offobj)) + offset = PyLong_AsLongLong(offobj); + else + offset = PyInt_AsLong(offobj); #endif if (PyErr_Occurred()) return NULL; diff --git a/sys/src/cmd/python/Modules/fcntlmodule.c b/sys/src/cmd/python/Modules/fcntlmodule.c index 5198baa5e..0b9a1cbd1 100644 --- a/sys/src/cmd/python/Modules/fcntlmodule.c +++ b/sys/src/cmd/python/Modules/fcntlmodule.c @@ -339,9 +339,10 @@ fcntl_lockf(PyObject *self, PyObject *args) #if !defined(HAVE_LARGEFILE_SUPPORT) l.l_start = PyInt_AsLong(startobj); #else - l.l_start = PyLong_Check(startobj) ? - PyLong_AsLongLong(startobj) : - PyInt_AsLong(startobj); + if(PyLong_Check(startobj)) + l.l_start = PyLong_AsLongLong(startobj); + else + l.l_start = PyInt_AsLong(startobj); #endif if (PyErr_Occurred()) return NULL; @@ -350,9 +351,10 @@ fcntl_lockf(PyObject *self, PyObject *args) #if !defined(HAVE_LARGEFILE_SUPPORT) l.l_len = PyInt_AsLong(lenobj); #else - l.l_len = PyLong_Check(lenobj) ? - PyLong_AsLongLong(lenobj) : - PyInt_AsLong(lenobj); + if(PyLong_Check(lenobj)) + l.l_len = PyLong_AsLongLong(lenobj); + else + l.l_len = PyInt_AsLong(lenobj); #endif if (PyErr_Occurred()) return NULL; diff --git a/sys/src/cmd/python/Modules/posixmodule.c b/sys/src/cmd/python/Modules/posixmodule.c index 958fb63d3..a42d2be21 100644 --- a/sys/src/cmd/python/Modules/posixmodule.c +++ b/sys/src/cmd/python/Modules/posixmodule.c @@ -6053,8 +6053,10 @@ posix_lseek(PyObject *self, PyObject *args) #if !defined(HAVE_LARGEFILE_SUPPORT) pos = PyInt_AsLong(posobj); #else - pos = PyLong_Check(posobj) ? - PyLong_AsLongLong(posobj) : PyInt_AsLong(posobj); + if(PyLong_Check(posobj)) + pos = PyLong_AsLongLong(posobj); + else + pos = PyInt_AsLong(posobj); #endif if (PyErr_Occurred()) return NULL; @@ -6384,8 +6386,10 @@ posix_ftruncate(PyObject *self, PyObject *args) #if !defined(HAVE_LARGEFILE_SUPPORT) length = PyInt_AsLong(lenobj); #else - length = PyLong_Check(lenobj) ? - PyLong_AsLongLong(lenobj) : PyInt_AsLong(lenobj); + if(PyLong_Check(lenobj)) + length = PyLong_AsLongLong(lenobj); + else + length = PyInt_AsLong(lenobj); #endif if (PyErr_Occurred()) return NULL; diff --git a/sys/src/cmd/python/Modules/testcapi_long.h b/sys/src/cmd/python/Modules/testcapi_long.h index 8ed6b021e..90d218c14 100644 --- a/sys/src/cmd/python/Modules/testcapi_long.h +++ b/sys/src/cmd/python/Modules/testcapi_long.h @@ -25,16 +25,19 @@ TESTNAME(PyObject *error(const char*)) base = 1; for (i = 0; i < NBITS + 1; /* on last, base overflows to 0 */ - ++i, base <<= 1) + ++i) { int j; + for (j = 0; j < 6; ++j) { TYPENAME in, out; unsigned TYPENAME uin, uout; /* For 0, 1, 2 use base; for 3, 4, 5 use -base */ - uin = j < 3 ? base - : (unsigned TYPENAME)(-(TYPENAME)base); + if(j < 3) + uin = base; + else + uin = (unsigned TYPENAME)(-(TYPENAME)base); /* For 0 & 3, subtract 1. * For 1 & 4, leave alone. @@ -71,6 +74,8 @@ TESTNAME(PyObject *error(const char*)) "signed output != input"); UNBIND(pyresult); } + + base <<= 1; } /* Overflow tests. The loop above ensured that all limit cases that diff --git a/sys/src/cmd/python/Objects/fileobject.c b/sys/src/cmd/python/Objects/fileobject.c index 869ded916..124767ccd 100644 --- a/sys/src/cmd/python/Objects/fileobject.c +++ b/sys/src/cmd/python/Objects/fileobject.c @@ -553,8 +553,10 @@ file_seek(PyFileObject *f, PyObject *args) #if !defined(HAVE_LARGEFILE_SUPPORT) offset = PyInt_AsLong(offobj); #else - offset = PyLong_Check(offobj) ? - PyLong_AsLongLong(offobj) : PyInt_AsLong(offobj); + if(PyLong_Check(offobj)) + offset = PyLong_AsLongLong(offobj); + else + offset = PyInt_AsLong(offobj); #endif if (PyErr_Occurred()) return NULL; @@ -610,9 +612,10 @@ file_truncate(PyFileObject *f, PyObject *args) #if !defined(HAVE_LARGEFILE_SUPPORT) newsize = PyInt_AsLong(newsizeobj); #else - newsize = PyLong_Check(newsizeobj) ? - PyLong_AsLongLong(newsizeobj) : - PyInt_AsLong(newsizeobj); + if(PyLong_Check(newsizeobj)) + newsize = PyLong_AsLongLong(newsizeobj); + else + newsize = PyInt_AsLong(newsizeobj); #endif if (PyErr_Occurred()) return NULL; diff --git a/sys/src/cmd/python/Python/marshal.c b/sys/src/cmd/python/Python/marshal.c index 776836e55..7940ce18a 100644 --- a/sys/src/cmd/python/Python/marshal.c +++ b/sys/src/cmd/python/Python/marshal.c @@ -971,7 +971,7 @@ PyMarshal_ReadLastObjectFromFile(FILE *fp) if (filesize <= SMALL_FILE_LIMIT) pBuf = buf; else if (filesize <= REASONABLE_FILE_LIMIT) - pBuf = (char *)PyMem_MALLOC(filesize); + pBuf = (char *)PyMem_MALLOC((int)filesize); if (pBuf != NULL) { PyObject* v; size_t n; diff --git a/sys/src/cmd/python/plan9.c b/sys/src/cmd/python/plan9.c index a19392db4..94228077e 100644 --- a/sys/src/cmd/python/plan9.c +++ b/sys/src/cmd/python/plan9.c @@ -6,6 +6,8 @@ #if defined(T386) #define FPINVAL (1<<0) +#elif defined(Tarm) +#define FPINVAL (1<<16) #else Error define FPINVAL for your arch. grep /$cputype/include/u.h #endif |