[Python-checkins] r45280 - in python/trunk: Modules/gcmodule.c Modules/getpath.c Modules/main.c Modules/posixmodule.c Python/pystrtod.c
anthony.baxter
python-checkins at python.org
Tue Apr 11 14:14:11 CEST 2006
Author: anthony.baxter
Date: Tue Apr 11 14:14:09 2006
New Revision: 45280
Modified:
python/trunk/Modules/gcmodule.c
python/trunk/Modules/getpath.c
python/trunk/Modules/main.c
python/trunk/Modules/posixmodule.c
python/trunk/Python/pystrtod.c
Log:
some more fruit.
Modified: python/trunk/Modules/gcmodule.c
==============================================================================
--- python/trunk/Modules/gcmodule.c (original)
+++ python/trunk/Modules/gcmodule.c Tue Apr 11 14:14:09 2006
@@ -1281,7 +1281,8 @@
_PyObject_GC_Malloc(size_t basicsize)
{
PyObject *op;
- PyGC_Head *g = PyObject_MALLOC(sizeof(PyGC_Head) + basicsize);
+ PyGC_Head *g = (PyGC_Head *)PyObject_MALLOC(
+ sizeof(PyGC_Head) + basicsize);
if (g == NULL)
return PyErr_NoMemory();
g->gc.gc_refs = GC_UNTRACKED;
@@ -1323,7 +1324,7 @@
{
const size_t basicsize = _PyObject_VAR_SIZE(op->ob_type, nitems);
PyGC_Head *g = AS_GC(op);
- g = PyObject_REALLOC(g, sizeof(PyGC_Head) + basicsize);
+ g = (PyGC_Head *)PyObject_REALLOC(g, sizeof(PyGC_Head) + basicsize);
if (g == NULL)
return (PyVarObject *)PyErr_NoMemory();
op = (PyVarObject *) FROM_GC(g);
Modified: python/trunk/Modules/getpath.c
==============================================================================
--- python/trunk/Modules/getpath.c (original)
+++ python/trunk/Modules/getpath.c Tue Apr 11 14:14:09 2006
@@ -566,7 +566,7 @@
bufsz += strlen(exec_prefix) + 1;
/* This is the only malloc call in this file */
- buf = PyMem_Malloc(bufsz);
+ buf = (char *)PyMem_Malloc(bufsz);
if (buf == NULL) {
/* We can't exit, so print a warning and limp along */
Modified: python/trunk/Modules/main.c
==============================================================================
--- python/trunk/Modules/main.c (original)
+++ python/trunk/Modules/main.c Tue Apr 11 14:14:09 2006
@@ -208,7 +208,7 @@
/* -c is the last option; following arguments
that look like options are left for the
command to interpret. */
- command = malloc(strlen(_PyOS_optarg) + 2);
+ command = (char *)malloc(strlen(_PyOS_optarg) + 2);
if (command == NULL)
Py_FatalError(
"not enough memory to copy -c argument");
@@ -221,7 +221,7 @@
/* -m is the last option; following arguments
that look like options are left for the
module to interpret. */
- module = malloc(strlen(_PyOS_optarg) + 2);
+ module = (char *)malloc(strlen(_PyOS_optarg) + 2);
if (module == NULL)
Py_FatalError(
"not enough memory to copy -m argument");
Modified: python/trunk/Modules/posixmodule.c
==============================================================================
--- python/trunk/Modules/posixmodule.c (original)
+++ python/trunk/Modules/posixmodule.c Tue Apr 11 14:14:09 2006
@@ -6009,7 +6009,7 @@
posix_putenv(PyObject *self, PyObject *args)
{
char *s1, *s2;
- char *new;
+ char *newenv;
PyObject *newstr;
size_t len;
@@ -6040,9 +6040,9 @@
newstr = PyString_FromStringAndSize(NULL, (int)len - 1);
if (newstr == NULL)
return PyErr_NoMemory();
- new = PyString_AS_STRING(newstr);
- PyOS_snprintf(new, len, "%s=%s", s1, s2);
- if (putenv(new)) {
+ newenv = PyString_AS_STRING(newstr);
+ PyOS_snprintf(newenv, len, "%s=%s", s1, s2);
+ if (putenv(newenv)) {
Py_DECREF(newstr);
posix_error();
return NULL;
Modified: python/trunk/Python/pystrtod.c
==============================================================================
--- python/trunk/Python/pystrtod.c (original)
+++ python/trunk/Python/pystrtod.c Tue Apr 11 14:14:09 2006
@@ -101,7 +101,7 @@
char *copy, *c;
/* We need to convert the '.' to the locale specific decimal point */
- copy = malloc(end - nptr + 1 + decimal_point_len);
+ copy = (char *)malloc(end - nptr + 1 + decimal_point_len);
c = copy;
memcpy(c, nptr, decimal_point_pos - nptr);
More information about the Python-checkins
mailing list