A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/005655.html below:

[Patches] [Patch #100745] Fix PR #384, fixes UTF-8 en/decode

[Python-Dev] RE: [Patches] [Patch #100745] Fix PR #384, fixes UTF-8 en/decode [Python-Dev] RE: [Patches] [Patch #100745] Fix PR #384, fixes UTF-8 en/decodeTim Peters tim_one@email.msn.com
Thu, 6 Jul 2000 17:55:10 -0400
[Bill Tutt]
> How about this:
> /*
>  * Use this typedef when you need to represent a UTF-16 surrogate pair
>  * as single unsigned integer.
>  */
> #if SIZEOF_INT >= 4
> typedef unsigned int Py_UCS4;
> #else
> #if SIZEOF_LONG >= 4
> typedef unsigned long Py_UCS4;
> #else
> #error "can't find integral type that can contain 32 bits"
> #endif /* SIZEOF_LONG */
> #endif /* SIZEOF_INT */

Much better!  In the future (when the infrastructure is in place), I expect
we'll replace the #if stuff here with

typedef Py_uint_least32_t UCS4;

instead (where Py_uint_least32_t is defined in pyfort.h, and uint_least32_t
is the C9X spelling of the true requirement).

BTW, why not use #elif instead of nested #ifs?  #elif is clearer and
shorter.





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4