diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-02-22 16:59:57 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-02-22 16:59:57 +0200 |
commit | 50bd97a9436afe01606ad0cef323e7bda4d77e9b (patch) | |
tree | 260c15e9d6f383c404ea95e9e68ef07f0eba2cea /mysys | |
parent | e5706080f08eea5a5e67f85778307fd2cc021861 (diff) | |
download | mariadb-git-50bd97a9436afe01606ad0cef323e7bda4d77e9b.tar.gz |
Fixed compiler warnings (for linux and win32 and win64)
Fixed a couple of usage of not initialized warnings (unlikely cases)
client/mysqldump.c:
Fixed compiler warnings from 'max' build
client/mysqltest.c:
Removed compiler warnings
cmd-line-utils/readline/xmalloc.c:
Fixed compiler warnings from 'max' build
extra/comp_err.c:
Fixed compiler warnings from 'max' build
extra/yassl/include/openssl/ssl.h:
Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit
extra/yassl/include/socket_wrapper.hpp:
Moved socket_t to ssl.h, to be able to removed compiler warnings on windows 64 bit
extra/yassl/src/ssl.cpp:
Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit
extra/yassl/taocrypt/src/integer.cpp:
Fixed compiler warnings
include/my_global.h:
Added my_offsetof() macro from 5.1 to get rid of compiler warnings
innobase/include/ut0byte.ic:
Fixed compiler warnings on win64
innobase/include/ut0ut.ic:
Fixed compiler warnings on win64
libmysql/libmysql.def:
Fixed compiler warnings on win64
myisam/mi_packrec.c:
Fixed compiler warnings on win64
myisam/myisamchk.c:
Fixed compiler warnings from 'max' build
mysys/base64.c:
Fixed compiler warnings on win64
mysys/mf_keycache.c:
Fixed compiler warnings from 'max' build
mysys/my_getopt.c:
Fixed compiler warnings from 'max' build
mysys/my_init.c:
Fixed compiler warnings from 'max' build
mysys/my_thr_init.c:
Fixed compiler warnings
mysys/ptr_cmp.c:
Fixed compiler warnings from 'max' build
ndb/include/kernel/signaldata/DictTabInfo.hpp:
Fixed compiler warnings
server-tools/instance-manager/mysql_connection.cc:
Fixed compiler warnings
server-tools/instance-manager/mysqlmanager.cc:
Fixed compiler warnings
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/ha_berkeley.cc:
Moved get_auto_primary_key() here as int5store() gives (wrong) compiler warnings in win64
sql/ha_berkeley.h:
Moved get_auto_primary_key() to ha_berkeley.cc
sql/ha_innodb.cc:
Fixed compiler warnings
sql/item.cc:
Fixed compiler warnings from 'max' build
sql/item_timefunc.cc:
Fixed compiler warnings
sql/mysqld.cc:
Fixed compiler warnings
sql/sql_acl.cc:
Fixed compiler warnings from 'max' build
sql/sql_base.cc:
Fixed compiler warnings from 'max' build
sql/sql_insert.cc:
Initialize variable that may be used unitialized on error conditions (not fatal)
sql/sql_prepare.cc:
Fixed compiler warnings from 'max' build
sql/sql_select.cc:
Fixed compiler warnings
sql/sql_show.cc:
Fixed compiler warnings
sql/udf_example.def:
Fixed compiler warnings on win64
sql/unireg.cc:
Initialize variable that may be used unitialized on error conditions
strings/ctype-ucs2.c:
Fixed compiler warnings
strings/ctype-utf8.c:
Fixed compiler warnings
strings/decimal.c:
Fixed compiler warnings
support-files/compiler_warnings.supp:
Ignore warnings from sql_yacc.cc that are hard to remove
Ignore some not important warnings from windows 64 bit build
tools/mysqlmanager.c:
Fixed compiler warnings
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/base64.c | 4 | ||||
-rw-r--r-- | mysys/mf_keycache.c | 5 | ||||
-rw-r--r-- | mysys/my_getopt.c | 1 | ||||
-rw-r--r-- | mysys/my_init.c | 2 | ||||
-rw-r--r-- | mysys/my_thr_init.c | 6 | ||||
-rw-r--r-- | mysys/ptr_cmp.c | 2 |
6 files changed, 13 insertions, 7 deletions
diff --git a/mysys/base64.c b/mysys/base64.c index 6a6b7eae359..47b93942784 100644 --- a/mysys/base64.c +++ b/mysys/base64.c @@ -98,10 +98,10 @@ base64_encode(const void *src, size_t src_len, char *dst) } -static inline unsigned +static inline uint pos(unsigned char c) { - return strchr(base64_table, c) - base64_table; + return (uint) (strchr(base64_table, c) - base64_table); } diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 0762d10ab08..87f136dbf81 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -167,8 +167,10 @@ static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue, struct st_my_thread_var *thread); #endif static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block); +#ifndef DBUG_OFF static void test_key_cache(KEY_CACHE *keycache, const char *where, my_bool lock); +#endif #define KEYCACHE_HASH(f, pos) \ (((ulong) ((pos) >> keycache->key_cache_shift)+ \ @@ -2605,7 +2607,8 @@ static int flush_all_key_blocks(KEY_CACHE *keycache) 0 on success (always because it can't fail) */ -int reset_key_cache_counters(const char *name, KEY_CACHE *key_cache) +int reset_key_cache_counters(const char *name __attribute__((unused)), + KEY_CACHE *key_cache) { DBUG_ENTER("reset_key_cache_counters"); if (!key_cache->key_cache_inited) diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 250c10e8479..623c48b2e55 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -194,6 +194,7 @@ int handle_options(int *argc, char ***argv, Find first the right option. Return error in case of an ambiguous, or unknown option */ + LINT_INIT(prev_found); optp= longopts; if (!(opt_found= findopt(opt_str, length, &optp, &prev_found))) { diff --git a/mysys/my_init.c b/mysys/my_init.c index cc4bef10e8d..2bcf5f44c4d 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -197,7 +197,9 @@ Voluntary context switches %ld, Involuntary context switches %ld\n", } if (!(infoflag & MY_DONT_FREE_DBUG)) + { DBUG_END(); /* Must be done before my_thread_end */ + } #ifdef THREAD my_thread_end(); my_thread_global_end(); diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 67ab1e4a38a..7a5fdbf8ad6 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -54,8 +54,8 @@ pthread_mutexattr_t my_errorcheck_mutexattr; race conditions in NPTL pthread_exit code. */ -static -pthread_handler_t nptl_pthread_exit_hack_handler(void *arg) +static pthread_handler_t +nptl_pthread_exit_hack_handler(void *arg __attribute__((unused))) { /* Do nothing! */ pthread_exit(0); @@ -400,9 +400,9 @@ const char *my_thread_name(void) static uint get_thread_lib(void) { +#ifdef _CS_GNU_LIBPTHREAD_VERSION char buff[64]; -#ifdef _CS_GNU_LIBPTHREAD_VERSION confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff)); if (!strncasecmp(buff, "NPTL", 4)) diff --git a/mysys/ptr_cmp.c b/mysys/ptr_cmp.c index a3bc3702c34..33c28160a4c 100644 --- a/mysys/ptr_cmp.c +++ b/mysys/ptr_cmp.c @@ -185,7 +185,7 @@ my_off_t my_get_ptr(byte *ptr, uint pack_length) case 3: pos= (my_off_t) mi_uint3korr(ptr); break; case 2: pos= (my_off_t) mi_uint2korr(ptr); break; case 1: pos= (my_off_t) mi_uint2korr(ptr); break; - default: DBUG_ASSERT(0); + default: DBUG_ASSERT(0); return 0; } return pos; } |