mirror of https://github.com/python/cpython
removed "register const" from scalar arguments to the unicode
predicates
This commit is contained in:
parent
bc7c8960e0
commit
72b068566a
|
@ -864,63 +864,63 @@ extern DL_IMPORT(int) PyUnicode_Contains(
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_IsLowercase(
|
extern DL_IMPORT(int) _PyUnicode_IsLowercase(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_IsUppercase(
|
extern DL_IMPORT(int) _PyUnicode_IsUppercase(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_IsTitlecase(
|
extern DL_IMPORT(int) _PyUnicode_IsTitlecase(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_IsWhitespace(
|
extern DL_IMPORT(int) _PyUnicode_IsWhitespace(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_IsLinebreak(
|
extern DL_IMPORT(int) _PyUnicode_IsLinebreak(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToLowercase(
|
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToLowercase(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToUppercase(
|
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToUppercase(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToTitlecase(
|
extern DL_IMPORT(Py_UNICODE) _PyUnicode_ToTitlecase(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_ToDecimalDigit(
|
extern DL_IMPORT(int) _PyUnicode_ToDecimalDigit(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_ToDigit(
|
extern DL_IMPORT(int) _PyUnicode_ToDigit(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(double) _PyUnicode_ToNumeric(
|
extern DL_IMPORT(double) _PyUnicode_ToNumeric(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_IsDecimalDigit(
|
extern DL_IMPORT(int) _PyUnicode_IsDecimalDigit(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_IsDigit(
|
extern DL_IMPORT(int) _PyUnicode_IsDigit(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_IsNumeric(
|
extern DL_IMPORT(int) _PyUnicode_IsNumeric(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
extern DL_IMPORT(int) _PyUnicode_IsAlpha(
|
extern DL_IMPORT(int) _PyUnicode_IsAlpha(
|
||||||
register const Py_UNICODE ch /* Unicode character */
|
Py_UNICODE ch /* Unicode character */
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -49,7 +49,7 @@ gettyperecord(Py_UNICODE code)
|
||||||
/* Returns 1 for Unicode characters having the category 'Zl' or type
|
/* Returns 1 for Unicode characters having the category 'Zl' or type
|
||||||
'B', 0 otherwise. */
|
'B', 0 otherwise. */
|
||||||
|
|
||||||
int _PyUnicode_IsLinebreak(register const Py_UNICODE ch)
|
int _PyUnicode_IsLinebreak(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ Py_UNICODE _PyUnicode_ToTitlecase(register Py_UNICODE ch)
|
||||||
/* Returns 1 for Unicode characters having the category 'Lt', 0
|
/* Returns 1 for Unicode characters having the category 'Lt', 0
|
||||||
otherwise. */
|
otherwise. */
|
||||||
|
|
||||||
int _PyUnicode_IsTitlecase(register const Py_UNICODE ch)
|
int _PyUnicode_IsTitlecase(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
||||||
|
|
||||||
|
@ -89,14 +89,14 @@ int _PyUnicode_IsTitlecase(register const Py_UNICODE ch)
|
||||||
/* Returns the integer decimal (0-9) for Unicode characters having
|
/* Returns the integer decimal (0-9) for Unicode characters having
|
||||||
this property, -1 otherwise. */
|
this property, -1 otherwise. */
|
||||||
|
|
||||||
int _PyUnicode_ToDecimalDigit(register const Py_UNICODE ch)
|
int _PyUnicode_ToDecimalDigit(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
||||||
|
|
||||||
return (ctype->flags & DECIMAL_MASK) ? ctype->decimal : -1;
|
return (ctype->flags & DECIMAL_MASK) ? ctype->decimal : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _PyUnicode_IsDecimalDigit(register const Py_UNICODE ch)
|
int _PyUnicode_IsDecimalDigit(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
if (_PyUnicode_ToDecimalDigit(ch) < 0)
|
if (_PyUnicode_ToDecimalDigit(ch) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -106,14 +106,14 @@ int _PyUnicode_IsDecimalDigit(register const Py_UNICODE ch)
|
||||||
/* Returns the integer digit (0-9) for Unicode characters having
|
/* Returns the integer digit (0-9) for Unicode characters having
|
||||||
this property, -1 otherwise. */
|
this property, -1 otherwise. */
|
||||||
|
|
||||||
int _PyUnicode_ToDigit(register const Py_UNICODE ch)
|
int _PyUnicode_ToDigit(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
||||||
|
|
||||||
return (ctype->flags & DIGIT_MASK) ? ctype->digit : -1;
|
return (ctype->flags & DIGIT_MASK) ? ctype->digit : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _PyUnicode_IsDigit(register const Py_UNICODE ch)
|
int _PyUnicode_IsDigit(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
if (_PyUnicode_ToDigit(ch) < 0)
|
if (_PyUnicode_ToDigit(ch) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -125,7 +125,7 @@ int _PyUnicode_IsDigit(register const Py_UNICODE ch)
|
||||||
|
|
||||||
/* TODO: replace with unicodetype_db.h table */
|
/* TODO: replace with unicodetype_db.h table */
|
||||||
|
|
||||||
double _PyUnicode_ToNumeric(register const Py_UNICODE ch)
|
double _PyUnicode_ToNumeric(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 0x3007:
|
case 0x3007:
|
||||||
|
@ -313,7 +313,7 @@ double _PyUnicode_ToNumeric(register const Py_UNICODE ch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int _PyUnicode_IsNumeric(register const Py_UNICODE ch)
|
int _PyUnicode_IsNumeric(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
if (_PyUnicode_ToNumeric(ch) < 0.0)
|
if (_PyUnicode_ToNumeric(ch) < 0.0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -325,7 +325,7 @@ int _PyUnicode_IsNumeric(register const Py_UNICODE ch)
|
||||||
/* Returns 1 for Unicode characters having the bidirectional type
|
/* Returns 1 for Unicode characters having the bidirectional type
|
||||||
'WS', 'B' or 'S' or the category 'Zs', 0 otherwise. */
|
'WS', 'B' or 'S' or the category 'Zs', 0 otherwise. */
|
||||||
|
|
||||||
int _PyUnicode_IsWhitespace(register const Py_UNICODE ch)
|
int _PyUnicode_IsWhitespace(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ int _PyUnicode_IsWhitespace(register const Py_UNICODE ch)
|
||||||
/* Returns 1 for Unicode characters having the category 'Ll', 0
|
/* Returns 1 for Unicode characters having the category 'Ll', 0
|
||||||
otherwise. */
|
otherwise. */
|
||||||
|
|
||||||
int _PyUnicode_IsLowercase(register const Py_UNICODE ch)
|
int _PyUnicode_IsLowercase(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ int _PyUnicode_IsLowercase(register const Py_UNICODE ch)
|
||||||
/* Returns 1 for Unicode characters having the category 'Lu', 0
|
/* Returns 1 for Unicode characters having the category 'Lu', 0
|
||||||
otherwise. */
|
otherwise. */
|
||||||
|
|
||||||
int _PyUnicode_IsUppercase(register const Py_UNICODE ch)
|
int _PyUnicode_IsUppercase(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ int _PyUnicode_IsUppercase(register const Py_UNICODE ch)
|
||||||
/* Returns the uppercase Unicode characters corresponding to ch or just
|
/* Returns the uppercase Unicode characters corresponding to ch or just
|
||||||
ch if no uppercase mapping is known. */
|
ch if no uppercase mapping is known. */
|
||||||
|
|
||||||
Py_UNICODE _PyUnicode_ToUppercase(register Py_UNICODE ch)
|
Py_UNICODE _PyUnicode_ToUppercase(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
||||||
|
|
||||||
|
@ -371,7 +371,7 @@ Py_UNICODE _PyUnicode_ToUppercase(register Py_UNICODE ch)
|
||||||
/* Returns the lowercase Unicode characters corresponding to ch or just
|
/* Returns the lowercase Unicode characters corresponding to ch or just
|
||||||
ch if no lowercase mapping is known. */
|
ch if no lowercase mapping is known. */
|
||||||
|
|
||||||
Py_UNICODE _PyUnicode_ToLowercase(register Py_UNICODE ch)
|
Py_UNICODE _PyUnicode_ToLowercase(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ Py_UNICODE _PyUnicode_ToLowercase(register Py_UNICODE ch)
|
||||||
/* Returns 1 for Unicode characters having the category 'Ll', 'Lu', 'Lt',
|
/* Returns 1 for Unicode characters having the category 'Ll', 'Lu', 'Lt',
|
||||||
'Lo' or 'Lm', 0 otherwise. */
|
'Lo' or 'Lm', 0 otherwise. */
|
||||||
|
|
||||||
int _PyUnicode_IsAlpha(register const Py_UNICODE ch)
|
int _PyUnicode_IsAlpha(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
|
||||||
|
|
||||||
|
@ -399,32 +399,32 @@ int _PyUnicode_IsAlpha(register const Py_UNICODE ch)
|
||||||
/* Export the interfaces using the wchar_t type for portability
|
/* Export the interfaces using the wchar_t type for portability
|
||||||
reasons: */
|
reasons: */
|
||||||
|
|
||||||
int _PyUnicode_IsWhitespace(register const Py_UNICODE ch)
|
int _PyUnicode_IsWhitespace(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
return iswspace(ch);
|
return iswspace(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _PyUnicode_IsLowercase(register const Py_UNICODE ch)
|
int _PyUnicode_IsLowercase(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
return iswlower(ch);
|
return iswlower(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _PyUnicode_IsUppercase(register const Py_UNICODE ch)
|
int _PyUnicode_IsUppercase(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
return iswupper(ch);
|
return iswupper(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_UNICODE _PyUnicode_ToLowercase(register const Py_UNICODE ch)
|
Py_UNICODE _PyUnicode_ToLowercase(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
return towlower(ch);
|
return towlower(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_UNICODE _PyUnicode_ToUppercase(register const Py_UNICODE ch)
|
Py_UNICODE _PyUnicode_ToUppercase(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
return towupper(ch);
|
return towupper(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _PyUnicode_IsAlpha(register const Py_UNICODE ch)
|
int _PyUnicode_IsAlpha(Py_UNICODE ch)
|
||||||
{
|
{
|
||||||
return iswalpha(ch);
|
return iswalpha(ch);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue