]> granicus.if.org Git - python/commitdiff
Make more warnings go away on the SGI compiler.
authorFred Drake <fdrake@acm.org>
Thu, 19 Jul 2001 21:29:49 +0000 (21:29 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 19 Jul 2001 21:29:49 +0000 (21:29 +0000)
This is part of SF patch #424992.

Modules/pcremodule.c
Modules/selectmodule.c
Modules/signalmodule.c
Modules/xreadlinesmodule.c

index a7581c6858e37c87da0d8397b4b3a162434a4992..e34c002b039eeda57cf2133a4d3b40e5b7684553 100644 (file)
@@ -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
index c6e4b86ade03156251b8af87760b8328d2004d16..c92dc7f18ab9bf602e4e3626d7a2bd46e91e9f05 100644 (file)
@@ -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;
index 0ce755f2fae2f70e2090b8c959a3813265097ee9..340445fc59c3f6dfbe9163af35776b2902e954f6 100644 (file)
@@ -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[] =
index 7ae949e0df37c3eafe65b3172a4b8b529858e752..0881dd8521255e4db4156fe46bf59f41e0809a86 100644 (file)
@@ -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);
 }