mirror of
https://github.com/python/cpython.git
synced 2025-11-09 22:16:39 +00:00
Issue #10310: Use "unsigned int field:1" instead of "signed int field:1" in a
private structure of the _io module to fix a compiler warning (overflow when assigning the value 1). Fix also a cast in incrementalnewlinedecoder_setstate(). Patch written by Hallvard B Furuseth.
This commit is contained in:
parent
1b1fe97e95
commit
7d7e7756d9
1 changed files with 3 additions and 3 deletions
|
|
@ -224,8 +224,8 @@ typedef struct {
|
||||||
PyObject_HEAD
|
PyObject_HEAD
|
||||||
PyObject *decoder;
|
PyObject *decoder;
|
||||||
PyObject *errors;
|
PyObject *errors;
|
||||||
signed int pendingcr: 1;
|
unsigned int pendingcr: 1;
|
||||||
signed int translate: 1;
|
unsigned int translate: 1;
|
||||||
unsigned int seennl: 3;
|
unsigned int seennl: 3;
|
||||||
} nldecoder_object;
|
} nldecoder_object;
|
||||||
|
|
||||||
|
|
@ -546,7 +546,7 @@ incrementalnewlinedecoder_setstate(nldecoder_object *self, PyObject *state)
|
||||||
if (!PyArg_Parse(state, "(OK)", &buffer, &flag))
|
if (!PyArg_Parse(state, "(OK)", &buffer, &flag))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
self->pendingcr = (int) flag & 1;
|
self->pendingcr = (int) (flag & 1);
|
||||||
flag >>= 1;
|
flag >>= 1;
|
||||||
|
|
||||||
if (self->decoder != Py_None)
|
if (self->decoder != Py_None)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue