diff options
author | Michael Widenius <monty@askmonty.org> | 2009-11-30 01:08:56 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2009-11-30 01:08:56 +0200 |
commit | d13c54351dd7ec5c538ff746704c6a8096b25776 (patch) | |
tree | 29515d03576ab3021ec5a7e5e353d68f782ffd91 /regex | |
parent | d210df50a21d82a1f20c6bc786149478801e91c6 (diff) | |
download | mariadb-git-d13c54351dd7ec5c538ff746704c6a8096b25776.tar.gz |
Remove compiler warnings (Including some warnings from -Wstrict-aliasing)
Don't use static link by default (in compile-pentium) as some new systems doesn't have all static libraries available
Change type for functions in plugin.h:str_mysql_ftparser_param() to const unsigned char and string lengths to size_t.
One effect of the above change is that one needs to include mysql_global.h or define size_t before including plugin.h
This fixes a case where mysql_client_test failed with newer gcc that enables strict-aliasing by default
BUILD/compile-pentium:
Don't use static link by default as some new systems doesn't have all static libraries available
client/mysql_upgrade.c:
Remove not used variable
cmd-line-utils/readline/config_readline.h:
Define some constants to get rid of compiler warnings on Linux
cmd-line-utils/readline/display.c:
Get rid of compiler warnings
cmd-line-utils/readline/history.c:
Got rid of compiler warnings:
- Defining some strings as const
- Added cast
cmd-line-utils/readline/rlmbutil.h:
Added cast to get rid of compiler warnings
cmd-line-utils/readline/text.c:
Remove not needed initialization to get rid of compiler warnings
cmd-line-utils/readline/xmalloc.c:
Changed types to 'const char* to get rid of compiler warnings
configure.in:
Ensure that we use MariaDB as suffix
include/mysql/plugin.h:
Changed types to 'const unsigned char* to get rid of compiler warnings (in other parts of the code)
Change length for not \0 terminated string to size_t
include/mysql/plugin.h.pp:
Update related to plugin.h
libmysql/libmysql.c:
Fixed bug that caused core dump with newer gcc when strict aliasing is not turned off
mysql-test/t/information_schema.test:
Test is depending on innodb
mysql-test/t/not_partition.test:
Fixed wrong directory name
(Not noticed before as we don't ususally run this test)
mysys/lf_hash.c:
Got rid of compiler warnings from -Wstrict-aliasing
mysys/my_redel.c:
Removed not used variable
regex/engine.c:
Changed types to 'const char* to get rid of compiler warnings
regex/engine.ih:
Changed types to 'const char* to get rid of compiler warnings
sql/sp_head.cc:
Got rid of compiler warning from -Wstrict-aliasing
sql/sql_base.cc:
Got rid of compiler warnings from -Wstrict-aliasing
(The original code was probably wrong as nj_col->table_field was
sql/sql_builtin.cc.in:
plugin.h needs to have size_t defined
sql/sql_parse.cc:
Remove used variable
sql/sql_select.cc:
Got rid of compiler warnings from -Wstrict-aliasing
sql/sql_show.cc:
Added #ifdef to get rid of compiler warning when not using partition engine
sql/table.cc:
Got rid of compiler warning from -Wstrict-aliasing
storage/maria/ha_maria.cc:
Got rid of compiler warnings from -Wstrict-aliasing:
- Use the thd_killed() API function
storage/maria/lockman.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/ma_check.c:
Got rid of compiler warnings from -Wstrict-aliasing
Change to use new version of _ma_killed_ptr; Don't call it as often as before
storage/maria/ma_check_standalone.h:
Update to compatible _ma_killed_ptr() from ha_maria.cc
storage/maria/ma_ft_boolean_search.c:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_ft_nlq_search.c:
Got rid of compiler warnings from -Wstrict-aliasing
Ensure that 'subkeys' is 32 bit
storage/maria/ma_ft_parser.c:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_ftdefs.h:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_sort.c:
Change to use new version of _ma_killed_ptr; Don't call it as often as before
storage/maria/ma_state.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/maria_def.h:
Redefine ma_killed_ptr()
storage/maria/maria_ftdump.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/trnman.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/ft_boolean_search.c:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ft_nlq_search.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/ft_parser.c:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ft_stopwords.c:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ftdefs.h:
Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ha_myisam.cc:
Got rid of compiler warnings from -Wstrict-aliasing:
- Use the thd_killed() API function
storage/myisam/mi_check.c:
Use new killed_ptr() function
storage/myisam/myisam_ftdump.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/myisamchk.c:
Update to compatible killed_ptr() from ha_myisam.cc
storage/myisam/myisamdef.h:
Redefine killed_ptr()
storage/myisam/myisamlog.c:
Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/sort.c:
Change to use new version of killed_ptr; Don't call it as often as before
storage/xtradb/fil/fil0fil.c:
Fixedc ompiler warning
storage/xtradb/trx/trx0i_s.c:
Include mysql_plugin.h later to ensure that size_t is defined
Diffstat (limited to 'regex')
-rw-r--r-- | regex/engine.c | 76 | ||||
-rw-r--r-- | regex/engine.ih | 10 |
2 files changed, 43 insertions, 43 deletions
diff --git a/regex/engine.c b/regex/engine.c index 1968ca61a96..a099cfb891d 100644 --- a/regex/engine.c +++ b/regex/engine.c @@ -33,11 +33,11 @@ struct match { struct re_guts *g; int eflags; my_regmatch_t *pmatch; /* [nsub+1] (0 element unused) */ - char *offp; /* offsets work from here */ - char *beginp; /* start of string -- virtual NUL precedes */ - char *endp; /* end of string -- virtual NUL here */ - char *coldp; /* can be no match starting before here */ - char **lastpos; /* [nplus+1] */ + const char *offp; /* offsets work from here */ + const char *beginp; /* start of string -- virtual NUL precedes */ + const char *endp; /* end of string -- virtual NUL here */ + const char *coldp; /* can be no match starting before here */ + const char **lastpos; /* [nplus+1] */ STATEVARS; states st; /* current states */ states fresh; /* states for a fresh start */ @@ -66,20 +66,20 @@ static int /* 0 success, REG_NOMATCH failure */ matcher(charset,g, str, nmatch, pmatch, eflags) CHARSET_INFO *charset; register struct re_guts *g; -char *str; +const char *str; size_t nmatch; my_regmatch_t pmatch[]; int eflags; { - register char *endp; + register const char *endp; register uint i; struct match mv; register struct match *m = &mv; - register char *dp; + register const char *dp; register const sopno gf = g->firststate+1; /* +1 for OEND */ register const sopno gl = g->laststate; - char *start; - char *stop; + const char *start; + const char *stop; /* simplify the situation where possible */ if (g->cflags®_NOSUB) @@ -163,7 +163,7 @@ int eflags; dp = dissect(charset, m, m->coldp, endp, gf, gl); } else { if (g->nplus > 0 && m->lastpos == NULL) - m->lastpos = (char **)malloc((g->nplus+1) * + m->lastpos = (const char **)malloc((g->nplus+1) * sizeof(char *)); if (g->nplus > 0 && m->lastpos == NULL) { free(m->pmatch); @@ -235,28 +235,28 @@ int eflags; == static char *dissect(register struct match *m, char *start, \ == char *stop, sopno startst, sopno stopst); */ -static char * /* == stop (success) always */ +static const char * /* == stop (success) always */ dissect(charset, m, start, stop, startst, stopst) CHARSET_INFO *charset; register struct match *m; -char *start; -char *stop; +const char *start; +const char *stop; sopno startst; sopno stopst; { register uint i; register sopno ss; /* start sop of current subRE */ register sopno es; /* end sop of current subRE */ - register char *sp; /* start of string matched by it */ - register char *stp; /* string matched by it cannot pass here */ - register char *rest; /* start of rest of string */ - register char *tail; /* string unmatched by rest of RE */ + register const char *sp; /* start of string matched by it */ + register const char *stp; /* string matched by it cannot pass here */ + register const char *rest; /* start of rest of string */ + register const char *tail; /* string unmatched by rest of RE */ register sopno ssub; /* start sop of subsubRE */ register sopno esub; /* end sop of subsubRE */ - 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 */ + register const char *ssp; /* start of string matched by subsubRE */ + register const char *sep; /* end of string matched by subsubRE */ + register const char *oldssp; /* previous ssp */ + register const char *dp; /* used in debug mode to check asserts */ AT("diss", start, stop, startst, stopst); sp = start; @@ -424,23 +424,23 @@ sopno stopst; == static char *backref(register struct match *m, char *start, \ == char *stop, sopno startst, sopno stopst, sopno lev); */ -static char * /* == stop (success) or NULL (failure) */ +static const char * /* == stop (success) or NULL (failure) */ backref(charset,m, start, stop, startst, stopst, lev) CHARSET_INFO *charset; register struct match *m; -char *start; -char *stop; +const char *start; +const char *stop; sopno startst; sopno stopst; sopno lev; /* PLUS nesting level */ { register uint i; register sopno ss; /* start sop of current subRE */ - register char *sp; /* start of string matched by it */ + register const char *sp; /* start of string matched by it */ register sopno ssub; /* start sop of subsubRE */ register sopno esub; /* end sop of subsubRE */ - register char *ssp; /* start of string matched by subsubRE */ - register char *dp; + register const char *ssp; /* start of string matched by subsubRE */ + register const char *dp; register size_t len; register int hard; register sop s; @@ -630,24 +630,24 @@ sopno lev; /* PLUS nesting level */ == static char *fast(register struct match *m, char *start, \ == char *stop, sopno startst, sopno stopst); */ -static char * /* where tentative match ended, or NULL */ +static const char * /* where tentative match ended, or NULL */ fast(charset, m, start, stop, startst, stopst) CHARSET_INFO *charset; register struct match *m; -char *start; -char *stop; +const char *start; +const char *stop; sopno startst; sopno stopst; { register states st = m->st; register states fresh = m->fresh; register states tmp = m->tmp; - register char *p = start; + register const char *p = start; register int c = (start == m->beginp) ? OUT : *(start-1); register int lastc; /* previous c */ register int flagch; register int i; - register char *coldp; /* last p after which no match was underway */ + register const char *coldp; /* last p after which no match was underway */ CLEAR(st); SET1(st, startst); @@ -722,24 +722,24 @@ sopno stopst; == static char *slow(register struct match *m, char *start, \ == char *stop, sopno startst, sopno stopst); */ -static char * /* where it ended */ +static const char * /* where it ended */ slow(charset, m, start, stop, startst, stopst) CHARSET_INFO *charset; register struct match *m; -char *start; -char *stop; +const char *start; +const char *stop; sopno startst; sopno stopst; { register states st = m->st; register states empty = m->empty; register states tmp = m->tmp; - register char *p = start; + register const char *p = start; register int c = (start == m->beginp) ? OUT : *(start-1); register int lastc; /* previous c */ register int flagch; register int i; - register char *matchp; /* last p at which a match ended */ + register const char *matchp; /* last p at which a match ended */ AT("slow", start, stop, startst, stopst); CLEAR(st); diff --git a/regex/engine.ih b/regex/engine.ih index a9e98abef00..aa0f83e8e2e 100644 --- a/regex/engine.ih +++ b/regex/engine.ih @@ -4,11 +4,11 @@ extern "C" { #endif /* === engine.c === */ -static int matcher(CHARSET_INFO *charset,register struct re_guts *g, char *string, size_t nmatch, my_regmatch_t pmatch[], int eflags); -static char *dissect(CHARSET_INFO *charset,register struct match *m, char *start, char *stop, sopno startst, sopno stopst); -static char *backref(CHARSET_INFO *charset, register struct match *m, char *start, char *stop, sopno startst, sopno stopst, sopno lev); -static char *fast(CHARSET_INFO *charset, register struct match *m, char *start, char *stop, sopno startst, sopno stopst); -static char *slow(CHARSET_INFO *charset, register struct match *m, char *start, char *stop, sopno startst, sopno stopst); +static int matcher(CHARSET_INFO *charset,register struct re_guts *g, const char *string, size_t nmatch, my_regmatch_t pmatch[], int eflags); +static const char *dissect(CHARSET_INFO *charset,register struct match *m, const char *start, const char *stop, sopno startst, sopno stopst); +static const char *backref(CHARSET_INFO *charset, register struct match *m, const char *start, const char *stop, sopno startst, sopno stopst, sopno lev); +static const char *fast(CHARSET_INFO *charset, register struct match *m, const char *start, const char *stop, sopno startst, sopno stopst); +static const char *slow(CHARSET_INFO *charset, register struct match *m, const char *start, const char *stop, sopno startst, sopno stopst); static states step(register struct re_guts *g, sopno start, sopno stop, register states bef, int ch, register states aft); #define BOL (OUT+1) #define EOL (BOL+1) |