corrected some usage of 'unsigned long' where Py_UNICODE
should have been used.
sizeof(Py_UNICODE) * (size + (byteorder == 0)));
if (v == NULL)
return NULL;
- if (size == 0)
- goto done;
q = PyString_AS_STRING(v);
p = (Py_UNICODE *)q;
-
if (byteorder == 0)
*p++ = 0xFEFF;
+ if (size == 0)
+ goto done;
if (byteorder == 0 ||
#ifdef BYTEORDER_IS_LITTLE_ENDIAN
byteorder == -1
static
int unicodeescape_decoding_error(const char **source,
- unsigned long *x,
+ Py_UNICODE *x,
const char *errors,
const char *details)
{
return 0;
}
else if (strcmp(errors,"replace") == 0) {
- *x = (unsigned long)Py_UNICODE_REPLACEMENT_CHARACTER;
+ *x = Py_UNICODE_REPLACEMENT_CHARACTER;
return 0;
}
else {
end = s + size;
while (s < end) {
unsigned char c;
- unsigned long x;
+ Py_UNICODE x;
int i;
/* Non-escape characters are interpreted as Unicode ordinals */
end = s + size;
while (s < end) {
unsigned char c;
- unsigned long x;
+ Py_UNICODE x;
int i;
/* Non-escape characters are interpreted as Unicode ordinals */