Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
601b963b
Commit
601b963b
authored
Feb 14, 2004
by
Gustavo Niemeyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixing annoying warnings.
parent
a6e436e4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
Modules/_sre.c
Modules/_sre.c
+10
-7
Modules/sre.h
Modules/sre.h
+2
-2
No files found.
Modules/_sre.c
View file @
601b963b
...
...
@@ -146,20 +146,21 @@ static char sre_char_lower[128] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
static
unsigned
int
sre_lower
(
unsigned
int
ch
)
{
return
((
ch
)
<
128
?
sre_char_lower
[
ch
]
:
ch
);
return
((
ch
)
<
128
?
(
unsigned
int
)
sre_char_lower
[
ch
]
:
ch
);
}
/* locale-specific character predicates */
#define SRE_LOC_IS_DIGIT(ch) ((ch) < 256 ? isdigit((ch)) : 0)
#define SRE_LOC_IS_SPACE(ch) ((ch) < 256 ? isspace((ch)) : 0)
/* !(c & ~N) == (c < N+1) for any unsigned c, this avoids
* warnings when c's type supports only numbers < N+1 */
#define SRE_LOC_IS_DIGIT(ch) (!((ch) & ~255) ? isdigit((ch)) : 0)
#define SRE_LOC_IS_SPACE(ch) (!((ch) & ~255) ? isspace((ch)) : 0)
#define SRE_LOC_IS_LINEBREAK(ch) ((ch) == '\n')
#define SRE_LOC_IS_ALNUM(ch) (
(ch) < 256
? isalnum((ch)) : 0)
#define SRE_LOC_IS_ALNUM(ch) (
!((ch) & ~255)
? isalnum((ch)) : 0)
#define SRE_LOC_IS_WORD(ch) (SRE_LOC_IS_ALNUM((ch)) || (ch) == '_')
static
unsigned
int
sre_lower_locale
(
unsigned
int
ch
)
{
return
((
ch
)
<
256
?
tolower
((
ch
))
:
ch
);
return
((
ch
)
<
256
?
(
unsigned
int
)
tolower
((
ch
))
:
ch
);
}
/* unicode-specific character predicates */
...
...
@@ -484,7 +485,9 @@ SRE_CHARSET(SRE_CODE* set, SRE_CODE ch)
set
+=
count
*
16
;
}
else
{
if
(
ch
<
65536
)
/* !(c & ~N) == (c < N+1) for any unsigned c, this avoids
* warnings when c's type supports only numbers < N+1 */
if
(
!
(
ch
&
~
65535
))
block
=
((
unsigned
char
*
)
set
)[
ch
>>
8
];
else
block
=
-
1
;
...
...
Modules/sre.h
View file @
601b963b
...
...
@@ -76,8 +76,8 @@ typedef struct {
void
*
mark
[
SRE_MARK_SIZE
];
/* dynamically allocated stuff */
char
*
data_stack
;
int
data_stack_size
;
int
data_stack_base
;
unsigned
int
data_stack_size
;
unsigned
int
data_stack_base
;
/* current repeat context */
SRE_REPEAT
*
repeat
;
/* hooks */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment