[Python-checkins] r45341 - python/trunk/Modules/_hotshot.c python/trunk/Modules/stropmodule.c python/trunk/Modules/timemodule.c (original) (raw)

anthony.baxter python-checkins at python.org
Thu Apr 13 09:19:02 CEST 2006


Author: anthony.baxter Date: Thu Apr 13 09:19:01 2006 New Revision: 45341

Modified: python/trunk/Modules/_hotshot.c python/trunk/Modules/stropmodule.c python/trunk/Modules/timemodule.c Log: C++ compiler changes. casts, rename variables with reserved names.

Modified: python/trunk/Modules/_hotshot.c

--- python/trunk/Modules/_hotshot.c (original) +++ python/trunk/Modules/_hotshot.c Thu Apr 13 09:19:01 2006 @@ -308,7 +308,7 @@ if ((err = unpack_packed_int(self, &len, 0))) return err;

Modified: python/trunk/Modules/stropmodule.c

--- python/trunk/Modules/stropmodule.c (original) +++ python/trunk/Modules/stropmodule.c Thu Apr 13 09:19:01 2006 @@ -446,16 +446,16 @@ { char *s, *s_new; Py_ssize_t i, n; - PyObject *new; + PyObject *newstr; int changed;

 WARN;
 if (PyString_AsStringAndSize(args, &s, &n))
     return NULL;

@@ -467,11 +467,11 @@ s_new++; } if (!changed) { - Py_DECREF(new); + Py_DECREF(newstr); Py_INCREF(args); return args; } - return new; + return newstr; }

@@ -485,16 +485,16 @@ { char *s, *s_new; Py_ssize_t i, n; - PyObject *new; + PyObject *newstr; int changed;

 WARN;
 if (PyString_AsStringAndSize(args, &s, &n))
     return NULL;

@@ -506,11 +506,11 @@ s_new++; } if (!changed) { - Py_DECREF(new); + Py_DECREF(newstr); Py_INCREF(args); return args; } - return new; + return newstr; }

@@ -525,16 +525,16 @@ { char *s, *s_new; Py_ssize_t i, n; - PyObject *new; + PyObject *newstr; int changed;

 WARN;
 if (PyString_AsStringAndSize(args, &s, &n))
     return NULL;

@@ -555,11 +555,11 @@ s_new++; } if (!changed) { - Py_DECREF(new); + Py_DECREF(newstr); Py_INCREF(args); return args; } - return new; + return newstr; }

@@ -691,16 +691,16 @@ { char *s, *s_new; Py_ssize_t i, n; - PyObject *new; + PyObject *newstr; int changed;

 WARN;
 if (PyString_AsStringAndSize(args, &s, &n))
     return NULL;

@@ -717,11 +717,11 @@ s_new++; } if (!changed) { - Py_DECREF(new); + Py_DECREF(newstr); Py_INCREF(args); return args; } - return new; + return newstr; }

@@ -1141,7 +1141,7 @@ char *str, *pat,*sub,*new_s; Py_ssize_t len,pat_len,sub_len,out_len; Py_ssize_t count = -1; - PyObject *new; + PyObject *newstr;

 WARN;
 if (!PyArg_ParseTuple(args, "t#t#t#|n:replace",

@@ -1165,14 +1165,14 @@ } if (out_len == -1) { /* we're returning another reference to the input string */ - new = PyTuple_GetItem(args, 0); - Py_XINCREF(new); + newstr = PyTuple_GetItem(args, 0); + Py_XINCREF(newstr); } else { - new = PyString_FromStringAndSize(new_s, out_len); + newstr = PyString_FromStringAndSize(new_s, out_len); PyMem_FREE(new_s); } - return new; + return newstr; }

Modified: python/trunk/Modules/timemodule.c

--- python/trunk/Modules/timemodule.c (original) +++ python/trunk/Modules/timemodule.c Thu Apr 13 09:19:01 2006 @@ -443,7 +443,7 @@ * will be ahead of time... */ for (i = 1024; ; i += i) { - outbuf = malloc(i); + outbuf = (char *)malloc(i); if (outbuf == NULL) { return PyErr_NoMemory(); }



More information about the Python-checkins mailing list