@@ -3519,7 +3519,7 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
35193519 if (locale_error_handler (errors , & surrogateescape ) < 0 )
35203520 return NULL ;
35213521
3522- if (str [len ] != '\0' || len != strlen (str )) {
3522+ if (str [len ] != '\0' || ( size_t ) len != strlen (str )) {
35233523 PyErr_SetString (PyExc_TypeError , "embedded null character" );
35243524 return NULL ;
35253525 }
@@ -3696,7 +3696,7 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
36963696 }
36973697 size = PyBytes_GET_SIZE (output );
36983698 data = PyBytes_AS_STRING (output );
3699- if (size != strlen (data )) {
3699+ if (( size_t ) size != strlen (data )) {
37003700 PyErr_SetString (PyExc_TypeError , "embedded NUL character" );
37013701 Py_DECREF (output );
37023702 return 0 ;
@@ -8874,7 +8874,7 @@ PyUnicode_TransformDecimalToASCII(Py_UNICODE *s,
88748874
88758875 maxchar = 127 ;
88768876 for (i = 0 ; i < length ; i ++ ) {
8877- Py_UNICODE ch = s [i ];
8877+ Py_UCS4 ch = s [i ];
88788878 if (ch > 127 ) {
88798879 int decimal = Py_UNICODE_TODECIMAL (ch );
88808880 if (decimal >= 0 )
@@ -8891,7 +8891,7 @@ PyUnicode_TransformDecimalToASCII(Py_UNICODE *s,
88918891 data = PyUnicode_DATA (decimal );
88928892 /* Iterate over code points */
88938893 for (i = 0 ; i < length ; i ++ ) {
8894- Py_UNICODE ch = s [i ];
8894+ Py_UCS4 ch = s [i ];
88958895 if (ch > 127 ) {
88968896 int decimal = Py_UNICODE_TODECIMAL (ch );
88978897 if (decimal >= 0 )
@@ -10833,7 +10833,7 @@ PyUnicode_CompareWithASCIIString(PyObject* uni, const char* str)
1083310833 void * data = PyUnicode_DATA (uni );
1083410834 /* Compare Unicode string and source character set string */
1083510835 for (i = 0 ; (chr = PyUnicode_READ (kind , data , i )) && str [i ]; i ++ )
10836- if (chr != str [i ])
10836+ if (chr != ( unsigned char ) str [i ])
1083710837 return (chr < (unsigned char )(str [i ])) ? -1 : 1 ;
1083810838 /* This check keeps Python strings that end in '\0' from comparing equal
1083910839 to C strings identical up to that point. */
0 commit comments