mirror of https://github.com/python/cpython
Sheesh -- repair the dodge around "cast isn't an lvalue" complaints to
restore correct semantics.
This commit is contained in:
parent
9e897f41db
commit
4862ab7bf4
|
@ -75,11 +75,13 @@ PyString_FromStringAndSize(const char *str, int size)
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
PyObject *t = (PyObject *)op;
|
PyObject *t = (PyObject *)op;
|
||||||
PyString_InternInPlace(&t);
|
PyString_InternInPlace(&t);
|
||||||
|
op = (PyStringObject *)t;
|
||||||
nullstring = op;
|
nullstring = op;
|
||||||
Py_INCREF(op);
|
Py_INCREF(op);
|
||||||
} else if (size == 1 && str != NULL) {
|
} else if (size == 1 && str != NULL) {
|
||||||
PyObject *t = (PyObject *)op;
|
PyObject *t = (PyObject *)op;
|
||||||
PyString_InternInPlace(&t);
|
PyString_InternInPlace(&t);
|
||||||
|
op = (PyStringObject *)t;
|
||||||
characters[*str & UCHAR_MAX] = op;
|
characters[*str & UCHAR_MAX] = op;
|
||||||
Py_INCREF(op);
|
Py_INCREF(op);
|
||||||
}
|
}
|
||||||
|
@ -131,11 +133,13 @@ PyString_FromString(const char *str)
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
PyObject *t = (PyObject *)op;
|
PyObject *t = (PyObject *)op;
|
||||||
PyString_InternInPlace(&t);
|
PyString_InternInPlace(&t);
|
||||||
|
op = (PyStringObject *)t;
|
||||||
nullstring = op;
|
nullstring = op;
|
||||||
Py_INCREF(op);
|
Py_INCREF(op);
|
||||||
} else if (size == 1) {
|
} else if (size == 1) {
|
||||||
PyObject *t = (PyObject *)op;
|
PyObject *t = (PyObject *)op;
|
||||||
PyString_InternInPlace(&t);
|
PyString_InternInPlace(&t);
|
||||||
|
op = (PyStringObject *)t;
|
||||||
characters[*str & UCHAR_MAX] = op;
|
characters[*str & UCHAR_MAX] = op;
|
||||||
Py_INCREF(op);
|
Py_INCREF(op);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue