summaryrefslogtreecommitdiff
path: root/regex
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-07-20 15:07:36 -0300
committerDavi Arnaut <davi.arnaut@oracle.com>2010-07-20 15:07:36 -0300
commitc96b249fc3912f7a86f885cc62da1a3eeed537c6 (patch)
tree3be217b0b2b0e9c76e6f41abe8c7fa3aeb35d373 /regex
parentd676c3ff0eef8613ac689df8ed07ecdd0a39817b (diff)
downloadmariadb-git-c96b249fc3912f7a86f885cc62da1a3eeed537c6.tar.gz
Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix warnings flagged by the new warning option -Wunused-but-set-variable that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The option causes a warning whenever a local variable is assigned to but is later unused. It also warns about meaningless pointer dereferences.
Diffstat (limited to 'regex')
-rw-r--r--regex/engine.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/regex/engine.c b/regex/engine.c
index 1968ca61a96..be08adf8601 100644
--- a/regex/engine.c
+++ b/regex/engine.c
@@ -256,7 +256,6 @@ sopno stopst;
register char *ssp; /* start of string matched by subsubRE */
register char *sep; /* end of string matched by subsubRE */
register char *oldssp; /* previous ssp */
- register char *dp; /* used in debug mode to check asserts */
AT("diss", start, stop, startst, stopst);
sp = start;
@@ -314,11 +313,9 @@ sopno stopst;
ssub = ss + 1;
esub = es - 1;
/* did innards match? */
- if (slow(charset, m, sp, rest, ssub, esub) != NULL) {
- dp = dissect(charset, m, sp, rest, ssub, esub);
- assert(dp == rest);
- } else /* no */
- assert(sp == rest);
+ if (slow(charset, m, sp, rest, ssub, esub) != NULL)
+ sp = dissect(charset, m, sp, rest, ssub, esub);
+ assert(sp == rest);
sp = rest;
break;
case OPLUS_:
@@ -353,8 +350,8 @@ sopno stopst;
}
assert(sep == rest); /* must exhaust substring */
assert(slow(charset, m, ssp, sep, ssub, esub) == rest);
- dp = dissect(charset, m, ssp, sep, ssub, esub);
- assert(dp == sep);
+ sp = dissect(charset, m, ssp, sep, ssub, esub);
+ assert(sp == sep);
sp = rest;
break;
case OCH_:
@@ -388,8 +385,8 @@ sopno stopst;
else
assert(OP(m->g->strip[esub]) == O_CH);
}
- dp = dissect(charset, m, sp, rest, ssub, esub);
- assert(dp == rest);
+ sp = dissect(charset, m, sp, rest, ssub, esub);
+ assert(sp == rest);
sp = rest;
break;
case O_PLUS: