mirror of
https://github.com/python/cpython.git
synced 2025-07-15 15:25:29 +00:00
Silence gcc warnings.
Use correct type for copy target pointer.
This commit is contained in:
parent
071b9da146
commit
ce32db3ab5
1 changed files with 4 additions and 4 deletions
|
@ -410,13 +410,13 @@ PyObject *PyUnicode_FromString(const char *u)
|
||||||
|
|
||||||
/* Single characters are shared when using this constructor */
|
/* Single characters are shared when using this constructor */
|
||||||
if (size == 1) {
|
if (size == 1) {
|
||||||
unicode = unicode_latin1[*u];
|
unicode = unicode_latin1[(int)*u];
|
||||||
if (!unicode) {
|
if (!unicode) {
|
||||||
unicode = _PyUnicode_New(1);
|
unicode = _PyUnicode_New(1);
|
||||||
if (!unicode)
|
if (!unicode)
|
||||||
return NULL;
|
return NULL;
|
||||||
unicode->str[0] = *u;
|
unicode->str[0] = *u;
|
||||||
unicode_latin1[*u] = unicode;
|
unicode_latin1[(int)*u] = unicode;
|
||||||
}
|
}
|
||||||
Py_INCREF(unicode);
|
Py_INCREF(unicode);
|
||||||
return (PyObject *)unicode;
|
return (PyObject *)unicode;
|
||||||
|
@ -429,8 +429,8 @@ PyObject *PyUnicode_FromString(const char *u)
|
||||||
|
|
||||||
/* Copy the Unicode data into the new object */
|
/* Copy the Unicode data into the new object */
|
||||||
if (u != NULL) {
|
if (u != NULL) {
|
||||||
char *p = unicode->str;
|
Py_UNICODE *p = unicode->str;
|
||||||
while (*p++ = *u++)
|
while ((*p++ = *u++))
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue