diff options
author | unknown <monty@hundin.mysql.fi> | 2001-12-02 14:34:01 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-12-02 14:34:01 +0200 |
commit | 7c999bb03223114a4d07f23db2842363d32d1859 (patch) | |
tree | 8e30a64d5c7aaa0ba8554c4c316cc9b76a6724ca /regex | |
parent | 95e94560eac0ee72bbc566517ca70f14128a01e8 (diff) | |
download | mariadb-git-7c999bb03223114a4d07f23db2842363d32d1859.tar.gz |
Query cache.
Remove some warnings
Docs/manual.texi:
Solaris and gcc
include/ft_global.h:
Remove warnings
include/myisam.h:
Query cache
include/myisammrg.h:
Query cache
include/mysql_com.h:
Query cache
libmysqld/lib_sql.cc:
Query cache
myisam/ft_boolean_search.c:
Remove warnings
myisam/ft_dump.c:
Remove warnings
myisam/ft_parser.c:
Remove warnings
myisam/ft_static.c:
Remove warnings
myisam/ft_update.c:
Remove warnings
myisam/ftdefs.h:
Remove warnings
myisam/mi_delete.c:
Query cache
myisam/mi_locking.c:
Query cache
myisam/mi_update.c:
Query cache
myisam/myisamdef.h:
Optimize for Ia64
myisammrg/myrg_extra.c:
Query cache
mysys/mf_keycache.c:
DBUG statements
regex/cclass.h:
Remove warnings
regex/cname.h:
Remove warnings
regex/main.c:
Remove warnings
regex/regcomp.c:
Remove warnings
regex/regcomp.ih:
Remove warnings
regex/regerror.c:
Remove warnings
regex/reginit.c:
Remove warnings
regex/split.c:
Remove warnings
sql-bench/test-connect.sh:
Make tests query-cache safe.
sql-bench/test-transactions.sh:
Fix for old perl versions
sql/convert.cc:
Query cache
sql/ha_myisammrg.cc:
Query cache
sql/ha_myisammrg.h:
Query cache
sql/handler.cc:
Query cache
sql/item_create.cc:
Query cache
sql/item_func.cc:
Remove warnings
sql/item_func.h:
Remove warnings
sql/lex.h:
Query cache
sql/mysql_priv.h:
Query cache
sql/mysqld.cc:
Query cache
sql/net_serv.cc:
Query cache
sql/sql_cache.cc:
Query cache
sql/sql_class.cc:
Query cache
sql/sql_class.h:
Query cache
sql/sql_db.cc:
Query cache
sql/sql_delete.cc:
Query cache
sql/sql_insert.cc:
Query cache
sql/sql_parse.cc:
Query cache
sql/sql_select.cc:
Query cache
sql/sql_table.cc:
Query cache
sql/sql_update.cc:
Query cache
sql/sql_yacc.yy:
Query cache
Diffstat (limited to 'regex')
-rw-r--r-- | regex/cclass.h | 6 | ||||
-rw-r--r-- | regex/cname.h | 4 | ||||
-rw-r--r-- | regex/main.c | 16 | ||||
-rw-r--r-- | regex/regcomp.c | 72 | ||||
-rw-r--r-- | regex/regcomp.ih | 2 | ||||
-rw-r--r-- | regex/regerror.c | 8 | ||||
-rw-r--r-- | regex/reginit.c | 2 | ||||
-rw-r--r-- | regex/split.c | 2 |
8 files changed, 58 insertions, 54 deletions
diff --git a/regex/cclass.h b/regex/cclass.h index 7d9a7ccc7c2..e0f752f38b8 100644 --- a/regex/cclass.h +++ b/regex/cclass.h @@ -15,7 +15,7 @@ #define CCLASS_LAST 12 extern struct cclass { - char *name; - char *chars; - char *multis; + const char *name; + const char *chars; + const char *multis; } cclasses[]; diff --git a/regex/cname.h b/regex/cname.h index 2b6a1a8496f..06865f3e102 100644 --- a/regex/cname.h +++ b/regex/cname.h @@ -1,7 +1,7 @@ /* character-name table */ static struct cname { - char *name; - char code; + const char *name; + const char code; } cnames[] = { {"NUL", '\0'}, {"SOH", '\001'}, diff --git a/regex/main.c b/regex/main.c index eac7293bf45..7844a4d8384 100644 --- a/regex/main.c +++ b/regex/main.c @@ -133,9 +133,9 @@ FILE *in; int i; char erbuf[100]; size_t ne; - char *badpat = "invalid regular expression"; + const char *badpat = "invalid regular expression"; # define SHORT 10 - char *bpname = "REG_BADPAT"; + const char *bpname = "REG_BADPAT"; regex_t re; while (fgets(inbuf, sizeof(inbuf), in) != NULL) { @@ -152,7 +152,7 @@ FILE *in; } for (i = 0; i < nf; i++) if (strcmp(f[i], "\"\"") == 0) - f[i] = ""; + f[i] = (char*) ""; if (nf <= 3) f[3] = NULL; if (nf <= 4) @@ -217,7 +217,7 @@ int opts; /* may not match f1 */ char erbuf[100]; int err; int len; - char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; + const char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; register int i; char *grump; char f0copy[1000]; @@ -291,7 +291,7 @@ int opts; /* may not match f1 */ nshould = split(f4, should+1, NSHOULD-1, ","); if (nshould == 0) { nshould = 1; - should[1] = ""; + should[1] = (char*) ""; } for (i = 1; i < NSUBS; i++) { grump = check(f2, subs[i], should[i]); @@ -317,7 +317,7 @@ char *s; { register char *p; register int o = (type == 'c') ? copts : eopts; - register char *legal = (type == 'c') ? "bisnmp" : "^$#tl"; + register const char *legal = (type == 'c') ? "bisnmp" : "^$#tl"; for (p = s; *p != '\0'; p++) if (strchr(legal, *p) != NULL) @@ -417,7 +417,7 @@ char *should; should = NULL; if (should != NULL && should[0] == '@') { at = should + 1; - should = ""; + should = (char*) ""; } /* check rm_so and rm_eo for consistency */ @@ -434,7 +434,7 @@ char *should; if (sub.rm_so == -1 && should == NULL) return(NULL); if (sub.rm_so == -1) - return("did not match"); + return((char*) "did not match"); /* check for in range */ if ((int) sub.rm_eo > (int) strlen(str)) { diff --git a/regex/regcomp.c b/regex/regcomp.c index 688b8ce7464..6f8221a706d 100644 --- a/regex/regcomp.c +++ b/regex/regcomp.c @@ -219,7 +219,7 @@ int stop; /* character this ERE should end at */ conc = HERE(); while (MORE() && (c = PEEK()) != '|' && c != stop) p_ere_exp(p); - if(REQUIRE(HERE() != conc, REG_EMPTY)); /* require nonempty */ + if(REQUIRE(HERE() != conc, REG_EMPTY)) {}/* require nonempty */ if (!EAT('|')) break; /* NOTE BREAK OUT */ @@ -266,11 +266,11 @@ register struct parse *p; pos = HERE(); switch (c) { case '(': - if(REQUIRE(MORE(), REG_EPAREN)); + if(REQUIRE(MORE(), REG_EPAREN)) {} p->g->nsub++; subno = (sopno) p->g->nsub; if (subno < NPAREN) - p->pbegin[subno] = HERE(); + p->pbegin[subno] = HERE(); EMIT(OLPAREN, subno); if (!SEE(')')) p_ere(p, ')'); @@ -279,7 +279,7 @@ register struct parse *p; assert(p->pend[subno] != 0); } EMIT(ORPAREN, subno); - if(MUSTEAT(')', REG_EPAREN)); + if(MUSTEAT(')', REG_EPAREN)) {} break; #ifndef POSIX_MISTAKE case ')': /* happens only if no current unmatched ( */ @@ -322,12 +322,12 @@ register struct parse *p; p_bracket(p); break; case '\\': - if(REQUIRE(MORE(), REG_EESCAPE)); + if(REQUIRE(MORE(), REG_EESCAPE)) {} c = GETNEXT(); ordinary(p, c); break; case '{': /* okay as ordinary except if digit follows */ - if(REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT)); + if(REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT)) {} /* FALLTHROUGH */ default: ordinary(p, c); @@ -343,7 +343,7 @@ register struct parse *p; return; /* no repetition, we're done */ NEXT(); - if(REQUIRE(!wascaret, REG_BADRPT)); + if(REQUIRE(!wascaret, REG_BADRPT)) {} switch (c) { case '*': /* implemented as +? */ /* this case does not require the (y|) trick, noKLUDGE */ @@ -370,7 +370,7 @@ register struct parse *p; if (EAT(',')) { if (isdigit(PEEK())) { count2 = p_count(p); - if(REQUIRE(count <= count2, REG_BADBR)); + if(REQUIRE(count <= count2, REG_BADBR)) {} } else /* single number with comma */ count2 = RE_INFINITY; } else /* just a single number */ @@ -379,7 +379,7 @@ register struct parse *p; if (!EAT('}')) { /* error heuristics */ while (MORE() && PEEK() != '}') NEXT(); - if(REQUIRE(MORE(), REG_EBRACE)); + if(REQUIRE(MORE(), REG_EBRACE)) {} SETERROR(REG_BADBR); } break; @@ -402,7 +402,7 @@ static void p_str(p) register struct parse *p; { - if(REQUIRE(MORE(), REG_EMPTY)); + if(REQUIRE(MORE(), REG_EMPTY)) {} while (MORE()) ordinary(p, GETNEXT()); } @@ -445,7 +445,7 @@ register int end2; /* second terminating character */ p->g->neol++; } - if(REQUIRE(HERE() != start, REG_EMPTY)); /* require nonempty */ + if(REQUIRE(HERE() != start, REG_EMPTY)) {} /* require nonempty */ } /* @@ -470,7 +470,7 @@ int starordinary; /* is a leading * an ordinary character? */ assert(MORE()); /* caller should have ensured this */ c = GETNEXT(); if (c == '\\') { - if(REQUIRE(MORE(), REG_EESCAPE)); + if(REQUIRE(MORE(), REG_EESCAPE)) {} c = BACKSL | (unsigned char)GETNEXT(); } switch (c) { @@ -500,7 +500,7 @@ int starordinary; /* is a leading * an ordinary character? */ assert(p->pend[subno] != 0); } EMIT(ORPAREN, subno); - if(REQUIRE(EATTWO('\\', ')'), REG_EPAREN)); + if(REQUIRE(EATTWO('\\', ')'), REG_EPAREN)) {} break; case BACKSL|')': /* should not get here -- must be user */ case BACKSL|'}': @@ -530,7 +530,7 @@ int starordinary; /* is a leading * an ordinary character? */ p->g->backrefs = 1; break; case '*': - if(REQUIRE(starordinary, REG_BADRPT)); + if(REQUIRE(starordinary, REG_BADRPT)) {} /* FALLTHROUGH */ default: ordinary(p, c &~ BACKSL); @@ -548,7 +548,7 @@ int starordinary; /* is a leading * an ordinary character? */ if (EAT(',')) { if (MORE() && isdigit(PEEK())) { count2 = p_count(p); - if(REQUIRE(count <= count2, REG_BADBR)); + if(REQUIRE(count <= count2, REG_BADBR)) {} } else /* single number with comma */ count2 = RE_INFINITY; } else /* just a single number */ @@ -557,7 +557,7 @@ int starordinary; /* is a leading * an ordinary character? */ if (!EATTWO('\\', '}')) { /* error heuristics */ while (MORE() && !SEETWO('\\', '}')) NEXT(); - if(REQUIRE(MORE(), REG_EBRACE)); + if(REQUIRE(MORE(), REG_EBRACE)) {} SETERROR(REG_BADBR); } } else if (c == (unsigned char)'$') /* $ (but not \$) ends it */ @@ -582,7 +582,7 @@ register struct parse *p; ndigits++; } - if(REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR)); + if(REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR)) {} return(count); } @@ -622,7 +622,7 @@ register struct parse *p; p_b_term(p, cs); if (EAT('-')) CHadd(cs, '-'); - if(MUSTEAT(']', REG_EBRACK)); + if(MUSTEAT(']', REG_EBRACK)) {} if (p->error != 0) /* don't mess things up further */ return; @@ -693,21 +693,21 @@ register cset *cs; switch (c) { case ':': /* character class */ NEXT2(); - if(REQUIRE(MORE(), REG_EBRACK)); + if(REQUIRE(MORE(), REG_EBRACK)) {} c = PEEK(); - if(REQUIRE(c != '-' && c != ']', REG_ECTYPE)); + if(REQUIRE(c != '-' && c != ']', REG_ECTYPE)) {} p_b_cclass(p, cs); - if(REQUIRE(MORE(), REG_EBRACK)); - if(REQUIRE(EATTWO(':', ']'), REG_ECTYPE)); + if(REQUIRE(MORE(), REG_EBRACK)) {} + if(REQUIRE(EATTWO(':', ']'), REG_ECTYPE)) {} break; case '=': /* equivalence class */ NEXT2(); - if(REQUIRE(MORE(), REG_EBRACK)); + if(REQUIRE(MORE(), REG_EBRACK)) {} c = PEEK(); - if(REQUIRE(c != '-' && c != ']', REG_ECOLLATE)); + if(REQUIRE(c != '-' && c != ']', REG_ECOLLATE)) {} p_b_eclass(p, cs); - if(REQUIRE(MORE(), REG_EBRACK)); - if(REQUIRE(EATTWO('=', ']'), REG_ECOLLATE)); + if(REQUIRE(MORE(), REG_EBRACK)) {} + if(REQUIRE(EATTWO('=', ']'), REG_ECOLLATE)) {} break; default: /* symbol, ordinary character, or range */ /* xxx revision needed for multichar stuff */ @@ -722,7 +722,7 @@ register cset *cs; } else finish = start; /* xxx what about signed chars here... */ - if(REQUIRE(start <= finish, REG_ERANGE)); + if(REQUIRE(start <= finish, REG_ERANGE)) {} for (i = start; i <= finish; i++) CHadd(cs, i); break; @@ -756,10 +756,10 @@ register cset *cs; return; } - u = cp->chars; + u = (char*) cp->chars; while ((c = *u++) != '\0') CHadd(cs, c); - for (u = cp->multis; *u != '\0'; u += strlen(u) + 1) + for (u = (char*) cp->multis; *u != '\0'; u += strlen(u) + 1) MCadd(p, cs, u); } @@ -790,13 +790,13 @@ register struct parse *p; { register char value; - if(REQUIRE(MORE(), REG_EBRACK)); + if(REQUIRE(MORE(), REG_EBRACK)) {} if (!EATTWO('[', '.')) return(GETNEXT()); /* collating symbol */ value = p_b_coll_elem(p, '.'); - if(REQUIRE(EATTWO('.', ']'), REG_ECOLLATE)); + if(REQUIRE(EATTWO('.', ']'), REG_ECOLLATE)) {} return(value); } @@ -1189,6 +1189,7 @@ register char *cp; cs->multis[cs->smultis - 1] = '\0'; } +#ifdef NOT_USED /* - mcsub - subtract a collating element from a cset == static void mcsub(register cset *cs, register char *cp); @@ -1246,6 +1247,7 @@ register char *cp; return(p); return(NULL); } +#endif /* - mcinvert - invert the list of collating elements in a cset @@ -1256,8 +1258,8 @@ register char *cp; */ static void mcinvert(p, cs) -register struct parse *p; -register cset *cs; + register struct parse *p __attribute__((unused)); + register cset *cs __attribute__((unused)); { assert(cs->multis == NULL); /* xxx */ } @@ -1271,8 +1273,8 @@ register cset *cs; */ static void mccase(p, cs) -register struct parse *p; -register cset *cs; +register struct parse *p __attribute__((unused)); +register cset *cs __attribute__((unused)); { assert(cs->multis == NULL); /* xxx */ } diff --git a/regex/regcomp.ih b/regex/regcomp.ih index 0776e7185cd..4ae45bbf4a9 100644 --- a/regex/regcomp.ih +++ b/regex/regcomp.ih @@ -28,9 +28,11 @@ static int freezeset(register struct parse *p, register cset *cs); static int firstch(register struct parse *p, register cset *cs); static int nch(register struct parse *p, register cset *cs); static void mcadd(register struct parse *p, register cset *cs, register char *cp); +#ifdef NOT_USED static void mcsub(register cset *cs, register char *cp); static int mcin(register cset *cs, register char *cp); static char *mcfind(register cset *cs, register char *cp); +#endif static void mcinvert(register struct parse *p, register cset *cs); static void mccase(register struct parse *p, register cset *cs); static int isinsets(register struct re_guts *g, int c); diff --git a/regex/regerror.c b/regex/regerror.c index 4a28f6e9d24..0a7b7c8da2c 100644 --- a/regex/regerror.c +++ b/regex/regerror.c @@ -28,8 +28,8 @@ */ static struct rerr { int code; - char *name; - char *explain; + const char *name; + const char *explain; } rerrs[] = { {REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"}, {REG_BADPAT, "REG_BADPAT", "invalid regular expression"}, @@ -83,7 +83,7 @@ size_t errbuf_size; assert(strlen(convbuf) < sizeof(convbuf)); s = convbuf; } else - s = r->explain; + s = (char*) r->explain; } len = strlen(s) + 1; @@ -113,7 +113,7 @@ char *localbuf; if (strcmp(r->name, preg->re_endp) == 0) break; if (r->code == 0) - return("0"); + return((char*) "0"); sprintf(localbuf, "%d", r->code); return(localbuf); diff --git a/regex/reginit.c b/regex/reginit.c index 06a48b16243..18647c386fc 100644 --- a/regex/reginit.c +++ b/regex/reginit.c @@ -63,7 +63,7 @@ void regex_end() { int i; for (i=0; i < CCLASS_LAST ; i++) - free(cclasses[i].chars); + free((char*) cclasses[i].chars); regex_inited=0; } } diff --git a/regex/split.c b/regex/split.c index 188bdb775b9..bd2a53c01e3 100644 --- a/regex/split.c +++ b/regex/split.c @@ -27,7 +27,7 @@ char *sep; /* "" white, "c" single char, "ab" [ab]+ */ continue; p--; trimtrail = 1; - sep = " \t"; /* note, code below knows this is 2 long */ + sep = (char*) " \t"; /* note, code below knows this is 2 long */ sepc = ' '; } else trimtrail = 0; |