mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
Fix compiler warnings
This commit is contained in:
parent
9d3b93ba30
commit
f8facacf30
3 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||||
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
|
||||||
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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue