This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients pitrou, vstinner
Date 2011-10-12.00:24:31
SpamBayes Score 1.813033e-08
Marked as misclassified No
Message-id <1318378846.3277.19.camel@localhost.localdomain>
In-reply-to <1318378305.18.0.54202768.issue13155@psf.upfronthosting.co.za>
Content
> > 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.
History
Date User Action Args
2011-10-12 00:24:32pitrousetrecipients: + pitrou, vstinner
2011-10-12 00:24:31pitroulinkissue13155 messages
2011-10-12 00:24:31pitroucreate