summaryrefslogtreecommitdiffstats
path: root/libc/regex/regcomp.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2010-06-16 16:36:41 -0700
committerDavid 'Digit' Turner <digit@google.com>2010-06-22 17:51:41 -0700
commit50ace4fec5e8cb5afcbc656a4556fa528adfd760 (patch)
tree04647e039a457f69ba48a8301bebdd605fda7fca /libc/regex/regcomp.c
parent6a9b888d7c4b246f6f66360789c72b754ff85021 (diff)
downloadbionic-50ace4fec5e8cb5afcbc656a4556fa528adfd760.zip
bionic-50ace4fec5e8cb5afcbc656a4556fa528adfd760.tar.gz
bionic-50ace4fec5e8cb5afcbc656a4556fa528adfd760.tar.bz2
Remove compiler warnings when building Bionic.
Also add missing declarations to misc. functions. Fix clearerr() implementation (previous was broken). Handle feature test macros like _POSIX_C_SOURCE properly. Change-Id: Icdc973a6b9d550a166fc2545f727ea837fe800c4
Diffstat (limited to 'libc/regex/regcomp.c')
-rw-r--r--libc/regex/regcomp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libc/regex/regcomp.c b/libc/regex/regcomp.c
index 5b632c8..19f4790 100644
--- a/libc/regex/regcomp.c
+++ b/libc/regex/regcomp.c
@@ -249,8 +249,8 @@ static void
p_ere(struct parse *p, int stop) /* character this ERE should end at */
{
char c;
- sopno prevback;
- sopno prevfwd;
+ sopno prevback = 0;
+ sopno prevfwd = 0;
sopno conc;
int first = 1; /* is this the first alternative? */
@@ -767,7 +767,7 @@ static void
p_b_cclass(struct parse *p, cset *cs)
{
char *sp = p->next;
- struct cclass *cp;
+ const struct cclass *cp;
size_t len;
char *u;
char c;
@@ -831,7 +831,7 @@ p_b_coll_elem(struct parse *p,
int endc) /* name ended by endc,']' */
{
char *sp = p->next;
- struct cname *cp;
+ const struct cname *cp;
int len;
while (MORE() && !SEETWO(endc, ']'))
@@ -1084,7 +1084,7 @@ freeset(struct parse *p, cset *cs)
cset *top = &p->g->sets[p->g->ncsets];
size_t css = (size_t)p->g->csetsize;
- for (i = 0; i < css; i++)
+ for (i = 0; i < (ssize_t)css; i++)
CHsub(cs, i);
if (cs == top-1) /* recover only the easy case */
p->g->ncsets--;
@@ -1112,10 +1112,10 @@ freezeset(struct parse *p, cset *cs)
for (cs2 = &p->g->sets[0]; cs2 < top; cs2++)
if (cs2->hash == h && cs2 != cs) {
/* maybe */
- for (i = 0; i < css; i++)
+ for (i = 0; i < (ssize_t)css; i++)
if (!!CHIN(cs2, i) != !!CHIN(cs, i))
break; /* no */
- if (i == css)
+ if (i == (ssize_t)css)
break; /* yes */
}
@@ -1136,7 +1136,7 @@ firstch(struct parse *p, cset *cs)
int i;
size_t css = (size_t)p->g->csetsize;
- for (i = 0; i < css; i++)
+ for (i = 0; i < (ssize_t)css; i++)
if (CHIN(cs, i))
return((char)i);
assert(never);
@@ -1153,7 +1153,7 @@ nch(struct parse *p, cset *cs)
size_t css = (size_t)p->g->csetsize;
int n = 0;
- for (i = 0; i < css; i++)
+ for (i = 0; i < (ssize_t)css; i++)
if (CHIN(cs, i))
n++;
return(n);
@@ -1412,7 +1412,7 @@ static void
findmust(struct parse *p, struct re_guts *g)
{
sop *scan;
- sop *start; /* start initialized in the default case, after that */
+ sop *start = NULL; /* start initialized in the default case, after that */
sop *newstart; /* newstart was initialized in the OCHAR case */
sopno newlen;
sop s;