diff options
author | Michael W. Hudson <mwh@python.net> | 2002-11-21 14:17:51 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-11-21 14:17:51 (GMT) |
commit | 2100798b8c2741347cb1bd4bf545f706574f523e (patch) | |
tree | d9c3f8abe29d5d2d9576608642e65512ed707828 /Modules/_cursesmodule.c | |
parent | 3e554d7b8a90cafc677ef49dc89ccd81a146d2bb (diff) | |
download | cpython-2100798b8c2741347cb1bd4bf545f706574f523e.zip cpython-2100798b8c2741347cb1bd4bf545f706574f523e.tar.gz cpython-2100798b8c2741347cb1bd4bf545f706574f523e.tar.bz2 |
Always call tparm with 10 arguments. It seems it's not varargs i
more often than it is. In response to bug:
[ 641808 ] Portability of Modules/_cursesmodule.c
submitted by Nick Mclaren.
Diffstat (limited to 'Modules/_cursesmodule.c')
-rw-r--r-- | Modules/_cursesmodule.c | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index ea10710..4424dae 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -2260,7 +2260,7 @@ PyCurses_tparm(PyObject *self, PyObject *args) { char* fmt; char* result = NULL; - int i1,i2,i3,i4,i5,i6,i7,i8,i9; + int i1=0,i2=0,i3=0,i4=0,i5=0,i6=0,i7=0,i8=0,i9=0; PyCursesSetupTermCalled; @@ -2269,49 +2269,9 @@ PyCurses_tparm(PyObject *self, PyObject *args) &i5, &i6, &i7, &i8, &i9)) { return NULL; } - -#if defined(__hpux) || defined(_AIX) - /* tparm is declared with 10 arguments on a few platforms - (HP-UX, AIX). If this proves to be a problem on other - platforms as well, perhaps an autoconf test should be - added to determine whether tparm can be called with a - variable number of arguments. Perhaps the other arguments - should be initialized in this case also. */ + result = tparm(fmt,i1,i2,i3,i4,i5,i6,i7,i8,i9); -#else - switch (PyTuple_GET_SIZE(args)) { - case 1: - result = tparm(fmt); - break; - case 2: - result = tparm(fmt,i1); - break; - case 3: - result = tparm(fmt,i1,i2); - break; - case 4: - result = tparm(fmt,i1,i2,i3); - break; - case 5: - result = tparm(fmt,i1,i2,i3,i4); - break; - case 6: - result = tparm(fmt,i1,i2,i3,i4,i5); - break; - case 7: - result = tparm(fmt,i1,i2,i3,i4,i5,i6); - break; - case 8: - result = tparm(fmt,i1,i2,i3,i4,i5,i6,i7); - break; - case 9: - result = tparm(fmt,i1,i2,i3,i4,i5,i6,i7,i8); - break; - case 10: - result = tparm(fmt,i1,i2,i3,i4,i5,i6,i7,i8,i9); - break; - } -#endif /* defined(__hpux) || defined(_AIX) */ + return PyString_FromString(result); } |