summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-22 01:30:47 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-22 01:30:47 (GMT)
commitf8facacf30a20b068c2a6fc62196c2335f150dbc (patch)
tree1c48fd6bb1e92fa9fac14771d458278ebb897d57
parent9d3b93ba305e8a83bf1cec5146def2078e40b1a5 (diff)
downloadcpython-f8facacf30a20b068c2a6fc62196c2335f150dbc.zip
cpython-f8facacf30a20b068c2a6fc62196c2335f150dbc.tar.gz
cpython-f8facacf30a20b068c2a6fc62196c2335f150dbc.tar.bz2
Fix compiler warnings
-rw-r--r--Modules/_io/textio.c2
-rw-r--r--Modules/posixmodule.c2
-rw-r--r--Objects/unicodeobject.c3
3 files changed, 4 insertions, 3 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 07dad3a..890a356 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -1431,7 +1431,7 @@ textiowrapper_read_chunk(textio *self, Py_ssize_t size_hint)
/* Read a chunk, decode it, and put the result in self._decoded_chars. */
if (size_hint > 0) {
- size_hint = Py_MAX(self->b2cratio, 1.0) * size_hint;
+ size_hint = (Py_ssize_t)(Py_MAX(self->b2cratio, 1.0) * size_hint);
}
chunk_size = PyLong_FromSsize_t(Py_MAX(self->chunk_size, size_hint));
if (chunk_size == NULL)
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 975cd9a..fe92491 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -7756,9 +7756,9 @@ posix_putenv(PyObject *self, PyObject *args)
PyObject *os1, *os2;
char *s1, *s2;
char *newenv;
+ size_t len;
#endif
PyObject *newstr = NULL;
- size_t len;
#ifdef MS_WINDOWS
if (!PyArg_ParseTuple(args,
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 16db801..e715567 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4330,7 +4330,8 @@ static int
refit_partial_string(PyObject **unicode, int kind, void *data, Py_ssize_t n)
{
PyObject *tmp;
- Py_ssize_t k, maxchar;
+ Py_ssize_t k;
+ Py_UCS4 maxchar;
for (k = 0, maxchar = 0; k < n; k++)
maxchar = Py_MAX(maxchar, PyUnicode_READ(kind, data, k));
tmp = PyUnicode_New(PyUnicode_GET_LENGTH(*unicode), maxchar);