Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce32db3

Browse files
committed
Silence gcc warnings.
Use correct type for copy target pointer.
1 parent 071b9da commit ce32db3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Objects/unicodeobject.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,13 @@ PyObject *PyUnicode_FromString(const char *u)
410410

411411
/* Single characters are shared when using this constructor */
412412
if (size == 1) {
413-
unicode = unicode_latin1[*u];
413+
unicode = unicode_latin1[(int)*u];
414414
if (!unicode) {
415415
unicode = _PyUnicode_New(1);
416416
if (!unicode)
417417
return NULL;
418418
unicode->str[0] = *u;
419-
unicode_latin1[*u] = unicode;
419+
unicode_latin1[(int)*u] = unicode;
420420
}
421421
Py_INCREF(unicode);
422422
return (PyObject *)unicode;
@@ -429,8 +429,8 @@ PyObject *PyUnicode_FromString(const char *u)
429429

430430
/* Copy the Unicode data into the new object */
431431
if (u != NULL) {
432-
char *p = unicode->str;
433-
while (*p++ = *u++)
432+
Py_UNICODE *p = unicode->str;
433+
while ((*p++ = *u++))
434434
;
435435
}
436436

0 commit comments

Comments
 (0)