From dff3a37afdf36263d9d10daf35d8400bda0dbbb1 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Thu, 19 Jul 2001 21:29:49 +0000 Subject: Make more warnings go away on the SGI compiler. This is part of SF patch #424992. --- Modules/pcremodule.c | 5 +---- Modules/selectmodule.c | 6 +++--- Modules/signalmodule.c | 2 +- Modules/xreadlinesmodule.c | 4 +--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Modules/pcremodule.c b/Modules/pcremodule.c index a7581c6..e34c002 100644 --- a/Modules/pcremodule.c +++ b/Modules/pcremodule.c @@ -258,7 +258,6 @@ PyPcre_expand_escape(unsigned char *pattern, int pattern_len, *indexptr = end; return Py_BuildValue("c", (char)x); } - break; case('E'): case('G'): case('L'): case('Q'): case('U'): case('l'): case('u'): @@ -331,7 +330,6 @@ PyPcre_expand_escape(unsigned char *pattern, int pattern_len, /* Otherwise, return a string containing the group name */ return Py_BuildValue("s#", pattern+index, end-index); } - break; case('0'): { @@ -354,7 +352,7 @@ PyPcre_expand_escape(unsigned char *pattern, int pattern_len, *indexptr = i; return Py_BuildValue("c", (unsigned char)octval); } - break; + case('1'): case('2'): case('3'): case('4'): case('5'): case('6'): case('7'): case('8'): case('9'): @@ -410,7 +408,6 @@ PyPcre_expand_escape(unsigned char *pattern, int pattern_len, return Py_BuildValue("i", pattern[index]-'0'); } } - break; default: /* It's some unknown escape like \s, so return a string containing diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index c6e4b86..c92dc7f 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -332,7 +332,7 @@ staticforward PyTypeObject poll_Type; static int update_ufd_array(pollObject *self) { - int i, j, pos; + int i, pos; PyObject *key, *value; self->ufd_len = PyDict_Size(self->dict); @@ -343,9 +343,9 @@ update_ufd_array(pollObject *self) } i = pos = 0; - while ((j = PyDict_Next(self->dict, &pos, &key, &value))) { + while (PyDict_Next(self->dict, &pos, &key, &value)) { self->ufds[i].fd = PyInt_AsLong(key); - self->ufds[i].events = PyInt_AsLong(value); + self->ufds[i].events = (short)PyInt_AsLong(value); i++; } self->ufd_uptodate = 1; diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 0ce755f..340445f 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -156,7 +156,7 @@ signal_alarm(PyObject *self, PyObject *args) if (!PyArg_Parse(args, "i", &t)) return NULL; /* alarm() returns the number of seconds remaining */ - return PyInt_FromLong(alarm(t)); + return PyInt_FromLong((long)alarm(t)); } static char alarm_doc[] = diff --git a/Modules/xreadlinesmodule.c b/Modules/xreadlinesmodule.c index 7ae949e..0881dd8 100644 --- a/Modules/xreadlinesmodule.c +++ b/Modules/xreadlinesmodule.c @@ -171,8 +171,6 @@ static PyMethodDef xreadlines_functions[] = { DL_EXPORT(void) initxreadlines(void) { - PyObject *m; - XReadlinesObject_Type.ob_type = &PyType_Type; - m = Py_InitModule("xreadlines", xreadlines_functions); + Py_InitModule("xreadlines", xreadlines_functions); } -- cgit v0.12