mirror of
https://github.com/python/cpython
synced 2026-09-29 09:55:31 +03:00
Issue #23181: More "codepoint" -> "code point".
This commit is contained in:
parent
b2653b344e
commit
d3faf43f9b
24 changed files with 46 additions and 46 deletions
|
|
@ -15,7 +15,7 @@
|
|||
#undef hz
|
||||
#endif
|
||||
|
||||
/* GBK and GB2312 map differently in few codepoints that are listed below:
|
||||
/* GBK and GB2312 map differently in few code points that are listed below:
|
||||
*
|
||||
* gb2312 gbk
|
||||
* A1A4 U+30FB KATAKANA MIDDLE DOT U+00B7 MIDDLE DOT
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ DECODER(big5hkscs)
|
|||
default: return 1;
|
||||
}
|
||||
|
||||
NEXT_IN(2); /* all decoded codepoints are pairs, above. */
|
||||
NEXT_IN(2); /* all decoded code points are pairs, above. */
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ ENCODER(euc_kr)
|
|||
OUTBYTE1(EUCKR_JAMO_FIRSTBYTE);
|
||||
OUTBYTE2(EUCKR_JAMO_FILLER);
|
||||
|
||||
/* All codepoints in CP949 extension are in unicode
|
||||
/* All code points in CP949 extension are in unicode
|
||||
* Hangul Syllable area. */
|
||||
assert(0xac00 <= c && c <= 0xd7a3);
|
||||
c -= 0xac00;
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
#include "multibytecodec.h"
|
||||
|
||||
|
||||
/* a unicode "undefined" codepoint */
|
||||
/* a unicode "undefined" code point */
|
||||
#define UNIINV 0xFFFE
|
||||
|
||||
/* internal-use DBCS codepoints which aren't used by any charsets */
|
||||
/* internal-use DBCS code points which aren't used by any charsets */
|
||||
#define NOCHAR 0xFFFF
|
||||
#define MULTIC 0xFFFE
|
||||
#define DBCINV 0xFFFD
|
||||
|
|
|
|||
|
|
@ -976,7 +976,7 @@ is_unified_ideograph(Py_UCS4 code)
|
|||
(0x2B740 <= code && code <= 0x2B81D); /* CJK Ideograph Extension D */
|
||||
}
|
||||
|
||||
/* macros used to determine if the given codepoint is in the PUA range that
|
||||
/* macros used to determine if the given code point is in the PUA range that
|
||||
* we are using to store aliases and named sequences */
|
||||
#define IS_ALIAS(cp) ((cp >= aliases_start) && (cp < aliases_end))
|
||||
#define IS_NAMED_SEQ(cp) ((cp >= named_sequences_start) && \
|
||||
|
|
@ -986,7 +986,7 @@ static int
|
|||
_getucname(PyObject *self, Py_UCS4 code, char* buffer, int buflen,
|
||||
int with_alias_and_seq)
|
||||
{
|
||||
/* Find the name associated with the given codepoint.
|
||||
/* Find the name associated with the given code point.
|
||||
* If with_alias_and_seq is 1, check for names in the Private Use Area 15
|
||||
* that we are using for aliases and named sequences. */
|
||||
int offset;
|
||||
|
|
@ -997,7 +997,7 @@ _getucname(PyObject *self, Py_UCS4 code, char* buffer, int buflen,
|
|||
if (code >= 0x110000)
|
||||
return 0;
|
||||
|
||||
/* XXX should we just skip all the codepoints in the PUAs here? */
|
||||
/* XXX should we just skip all the code points in the PUAs here? */
|
||||
if (!with_alias_and_seq && (IS_ALIAS(code) || IS_NAMED_SEQ(code)))
|
||||
return 0;
|
||||
|
||||
|
|
@ -1125,8 +1125,8 @@ _check_alias_and_seq(unsigned int cp, Py_UCS4* code, int with_named_seq)
|
|||
/* check if named sequences are allowed */
|
||||
if (!with_named_seq && IS_NAMED_SEQ(cp))
|
||||
return 0;
|
||||
/* if the codepoint is in the PUA range that we use for aliases,
|
||||
* convert it to obtain the right codepoint */
|
||||
/* if the code point is in the PUA range that we use for aliases,
|
||||
* convert it to obtain the right code point */
|
||||
if (IS_ALIAS(cp))
|
||||
*code = name_aliases[cp-aliases_start];
|
||||
else
|
||||
|
|
@ -1138,9 +1138,9 @@ static int
|
|||
_getcode(PyObject* self, const char* name, int namelen, Py_UCS4* code,
|
||||
int with_named_seq)
|
||||
{
|
||||
/* Return the codepoint associated with the given name.
|
||||
/* Return the code point associated with the given name.
|
||||
* Named aliases are resolved too (unless self != NULL (i.e. we are using
|
||||
* 3.2.0)). If with_named_seq is 1, returns the PUA codepoint that we are
|
||||
* 3.2.0)). If with_named_seq is 1, returns the PUA code point that we are
|
||||
* using for the named sequence, and the caller must then convert it. */
|
||||
unsigned int h, v;
|
||||
unsigned int mask = code_size-1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue