Antoine Pitrou <[email protected]> added the comment:
> > Ok, updated patch.
>
> "ret = ~mask + 1;" looks wrong: (~0xFFFFFF80+1) gives 128, not 127.
That's on purpose, since the mask has just matched. If 0xFFFFFF80
matches, then the max char can't be 127, it has to be at least 128.
> I don't see why you need:
>
> + if (ret < 128)
> + return 127;
> + if (ret < 256)
> + return 255;
Because otherwise you're returning 0xFFFF in the following line:
if (ret < 0x10000)
return 0xFFFF;
> #undef ASCII_CHAR_MASK should be #undef UCS1_ASCII_CHAR_MASK
Ha, funny that gcc doesn't say anything.
I also forgot to #under MASK_*.
> #error Invalid STRINGLIB_SIZEOF_CHAR (must be 1, 2 or 4)
> should be
> #error Invalid STRINGLIB_SIZEOF_CHAR (must be 2 or 4)
Well, no. 1 is a legal value, even though it's handled elsewhere, so the
error message is right.
> Why do you need these forward declarations? It's maybe related to another
> patch?
It's because I'm moving the stringlib #includes up in unicodeobject.c,
and stringlib calls these functions.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13155>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com