Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
b13dbb91
Commit
b13dbb91
authored
Feb 18, 2012
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regex: fix sign warnings
parent
1eaecf2f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
deps/regex/regcomp.c
+6
-3
deps/regex/regexec.c
+7
-7
No files found.
deps/regex/regcomp.c
View file @
b13dbb91
...
@@ -598,7 +598,8 @@ static bitset_t utf8_sb_map;
...
@@ -598,7 +598,8 @@ static bitset_t utf8_sb_map;
static
void
static
void
free_dfa_content
(
re_dfa_t
*
dfa
)
free_dfa_content
(
re_dfa_t
*
dfa
)
{
{
int
i
,
j
;
unsigned
int
i
;
int
j
;
if
(
dfa
->
nodes
)
if
(
dfa
->
nodes
)
for
(
i
=
0
;
i
<
dfa
->
nodes_len
;
++
i
)
for
(
i
=
0
;
i
<
dfa
->
nodes_len
;
++
i
)
...
@@ -1134,7 +1135,7 @@ analyze (regex_t *preg)
...
@@ -1134,7 +1135,7 @@ analyze (regex_t *preg)
dfa
->
subexp_map
=
re_malloc
(
int
,
preg
->
re_nsub
);
dfa
->
subexp_map
=
re_malloc
(
int
,
preg
->
re_nsub
);
if
(
dfa
->
subexp_map
!=
NULL
)
if
(
dfa
->
subexp_map
!=
NULL
)
{
{
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
preg
->
re_nsub
;
i
++
)
for
(
i
=
0
;
i
<
preg
->
re_nsub
;
i
++
)
dfa
->
subexp_map
[
i
]
=
i
;
dfa
->
subexp_map
[
i
]
=
i
;
preorder
(
dfa
->
str_tree
,
optimize_subexps
,
dfa
);
preorder
(
dfa
->
str_tree
,
optimize_subexps
,
dfa
);
...
@@ -1583,13 +1584,15 @@ duplicate_node (re_dfa_t *dfa, int org_idx, unsigned int constraint)
...
@@ -1583,13 +1584,15 @@ duplicate_node (re_dfa_t *dfa, int org_idx, unsigned int constraint)
static
reg_errcode_t
static
reg_errcode_t
calc_inveclosure
(
re_dfa_t
*
dfa
)
calc_inveclosure
(
re_dfa_t
*
dfa
)
{
{
int
src
,
idx
,
ret
;
int
ret
;
unsigned
int
src
,
idx
;
for
(
idx
=
0
;
idx
<
dfa
->
nodes_len
;
++
idx
)
for
(
idx
=
0
;
idx
<
dfa
->
nodes_len
;
++
idx
)
re_node_set_init_empty
(
dfa
->
inveclosures
+
idx
);
re_node_set_init_empty
(
dfa
->
inveclosures
+
idx
);
for
(
src
=
0
;
src
<
dfa
->
nodes_len
;
++
src
)
for
(
src
=
0
;
src
<
dfa
->
nodes_len
;
++
src
)
{
{
int
*
elems
=
dfa
->
eclosures
[
src
].
elems
;
int
*
elems
=
dfa
->
eclosures
[
src
].
elems
;
int
idx
;
for
(
idx
=
0
;
idx
<
dfa
->
eclosures
[
src
].
nelem
;
++
idx
)
for
(
idx
=
0
;
idx
<
dfa
->
eclosures
[
src
].
nelem
;
++
idx
)
{
{
ret
=
re_node_set_insert_last
(
dfa
->
inveclosures
+
elems
[
idx
],
src
);
ret
=
re_node_set_insert_last
(
dfa
->
inveclosures
+
elems
[
idx
],
src
);
...
...
deps/regex/regexec.c
View file @
b13dbb91
...
@@ -51,7 +51,7 @@ static int re_search_stub (struct re_pattern_buffer *bufp,
...
@@ -51,7 +51,7 @@ static int re_search_stub (struct re_pattern_buffer *bufp,
int
range
,
int
stop
,
struct
re_registers
*
regs
,
int
range
,
int
stop
,
struct
re_registers
*
regs
,
int
ret_len
);
int
ret_len
);
static
unsigned
re_copy_regs
(
struct
re_registers
*
regs
,
regmatch_t
*
pmatch
,
static
unsigned
re_copy_regs
(
struct
re_registers
*
regs
,
regmatch_t
*
pmatch
,
int
nregs
,
int
regs_allocated
);
unsigned
int
nregs
,
int
regs_allocated
);
static
reg_errcode_t
prune_impossible_nodes
(
re_match_context_t
*
mctx
);
static
reg_errcode_t
prune_impossible_nodes
(
re_match_context_t
*
mctx
);
static
int
check_matching
(
re_match_context_t
*
mctx
,
int
fl_longest_match
,
static
int
check_matching
(
re_match_context_t
*
mctx
,
int
fl_longest_match
,
int
*
p_match_first
)
internal_function
;
int
*
p_match_first
)
internal_function
;
...
@@ -486,11 +486,11 @@ re_search_stub (struct re_pattern_buffer *bufp,
...
@@ -486,11 +486,11 @@ re_search_stub (struct re_pattern_buffer *bufp,
static
unsigned
static
unsigned
re_copy_regs
(
struct
re_registers
*
regs
,
re_copy_regs
(
struct
re_registers
*
regs
,
regmatch_t
*
pmatch
,
regmatch_t
*
pmatch
,
int
nregs
,
int
regs_allocated
)
unsigned
int
nregs
,
int
regs_allocated
)
{
{
int
rval
=
REGS_REALLOCATE
;
int
rval
=
REGS_REALLOCATE
;
int
i
;
unsigned
int
i
;
int
need_regs
=
nregs
+
1
;
unsigned
int
need_regs
=
nregs
+
1
;
/* We need one extra element beyond `num_regs' for the `-1' marker GNU code
/* We need one extra element beyond `num_regs' for the `-1' marker GNU code
uses. */
uses. */
...
@@ -624,7 +624,7 @@ re_search_internal (const regex_t *preg,
...
@@ -624,7 +624,7 @@ re_search_internal (const regex_t *preg,
const
re_dfa_t
*
dfa
=
(
const
re_dfa_t
*
)
preg
->
buffer
;
const
re_dfa_t
*
dfa
=
(
const
re_dfa_t
*
)
preg
->
buffer
;
int
left_lim
,
right_lim
,
incr
;
int
left_lim
,
right_lim
,
incr
;
int
fl_longest_match
,
match_first
,
match_kind
,
match_last
=
-
1
;
int
fl_longest_match
,
match_first
,
match_kind
,
match_last
=
-
1
;
int
extra_nmatch
;
unsigned
int
extra_nmatch
;
int
sb
,
ch
;
int
sb
,
ch
;
#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
re_match_context_t
mctx
=
{
.
dfa
=
dfa
};
re_match_context_t
mctx
=
{
.
dfa
=
dfa
};
...
@@ -870,7 +870,7 @@ re_search_internal (const regex_t *preg,
...
@@ -870,7 +870,7 @@ re_search_internal (const regex_t *preg,
/* Set pmatch[] if we need. */
/* Set pmatch[] if we need. */
if
(
nmatch
>
0
)
if
(
nmatch
>
0
)
{
{
int
reg_idx
;
unsigned
int
reg_idx
;
/* Initialize registers. */
/* Initialize registers. */
for
(
reg_idx
=
1
;
reg_idx
<
nmatch
;
++
reg_idx
)
for
(
reg_idx
=
1
;
reg_idx
<
nmatch
;
++
reg_idx
)
...
@@ -1446,7 +1446,7 @@ set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch,
...
@@ -1446,7 +1446,7 @@ set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch,
if
(
idx
==
pmatch
[
0
].
rm_eo
&&
cur_node
==
mctx
->
last_node
)
if
(
idx
==
pmatch
[
0
].
rm_eo
&&
cur_node
==
mctx
->
last_node
)
{
{
int
reg_idx
;
unsigned
int
reg_idx
;
if
(
fs
)
if
(
fs
)
{
{
for
(
reg_idx
=
0
;
reg_idx
<
nmatch
;
++
reg_idx
)
for
(
reg_idx
=
0
;
reg_idx
<
nmatch
;
++
reg_idx
)
...
...
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