Commit f8facacf authored by Victor Stinner's avatar Victor Stinner

Fix compiler warnings

parent 9d3b93ba
...@@ -1431,7 +1431,7 @@ textiowrapper_read_chunk(textio *self, Py_ssize_t size_hint) ...@@ -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. */ /* Read a chunk, decode it, and put the result in self._decoded_chars. */
if (size_hint > 0) { 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)); chunk_size = PyLong_FromSsize_t(Py_MAX(self->chunk_size, size_hint));
if (chunk_size == NULL) if (chunk_size == NULL)
......
...@@ -7756,9 +7756,9 @@ posix_putenv(PyObject *self, PyObject *args) ...@@ -7756,9 +7756,9 @@ posix_putenv(PyObject *self, PyObject *args)
PyObject *os1, *os2; PyObject *os1, *os2;
char *s1, *s2; char *s1, *s2;
char *newenv; char *newenv;
size_t len;
#endif #endif
PyObject *newstr = NULL; PyObject *newstr = NULL;
size_t len;
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
if (!PyArg_ParseTuple(args, if (!PyArg_ParseTuple(args,
......
...@@ -4330,7 +4330,8 @@ static int ...@@ -4330,7 +4330,8 @@ static int
refit_partial_string(PyObject **unicode, int kind, void *data, Py_ssize_t n) refit_partial_string(PyObject **unicode, int kind, void *data, Py_ssize_t n)
{ {
PyObject *tmp; PyObject *tmp;
Py_ssize_t k, maxchar; Py_ssize_t k;
Py_UCS4 maxchar;
for (k = 0, maxchar = 0; k < n; k++) for (k = 0, maxchar = 0; k < n; k++)
maxchar = Py_MAX(maxchar, PyUnicode_READ(kind, data, k)); maxchar = Py_MAX(maxchar, PyUnicode_READ(kind, data, k));
tmp = PyUnicode_New(PyUnicode_GET_LENGTH(*unicode), maxchar); tmp = PyUnicode_New(PyUnicode_GET_LENGTH(*unicode), maxchar);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment