diff options
author | Tor Didriksen <tor.didriksen@sun.com> | 2010-05-26 16:12:23 +0200 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@sun.com> | 2010-05-26 16:12:23 +0200 |
commit | 85da8956e62cf5a1e3ed78cb18110e3888822d09 (patch) | |
tree | e02f9ec4f4f64535006e2aeecf1ec1497146b50c | |
parent | 2d80fb918f7eacb0e3c2199eb27a4b14ab40dbf0 (diff) | |
download | mariadb-git-85da8956e62cf5a1e3ed78cb18110e3888822d09.tar.gz |
Bug #53445 Build with -Wall and fix warnings that it generates
Add -Wall to gcc/g++
Fix most warnings reported in dbg and opt mode.
cmd-line-utils/libedit/filecomplete.c:
Remove unused auto variables.
configure.cmake:
Add -Wall to gcc.
extra/comp_err.c:
Cast to correct type.
extra/perror.c:
Fix segfault (but warnings about deprecated features remain)
extra/yassl/taocrypt/include/runtime.hpp:
Comparing two literals was reported as undefined behaviour.
include/my_global.h:
Add a template for aligning character buffers.
mysys/lf_alloc-pin.c:
Initialize pointer.
sql/mysqld.cc:
Use UNINIT_VAR rather than LINT_INIT.
sql/partition_info.cc:
Use UNINIT_VAR rather than LINT_INIT.
sql/rpl_handler.cc:
Use char[] rather than unsigned long[] array for placement buffer.
sql/spatial.cc:
Use char[] rather than unsigned void*[] array for placement buffer.
sql/spatial.h:
Use char[] rather than unsigned void*[] array for placement buffer.
sql/sql_partition.cc:
Initialize auto variable.
sql/sql_table.cc:
Initialize auto variables.
Add parens around assignment within if()
sql/sys_vars.cc:
Use UNINIT_VAR.
storage/innobase/os/os0file.c:
Init first slot in auto variable.
storage/myisam/mi_create.c:
Use UNINIT_VAR rather than LINT_INIT.
storage/myisam/mi_open.c:
Remove (wrong) casting.
storage/myisam/mi_page.c:
Remove (wrong) casting.
storage/myisam/mi_search.c:
Cast to uchar* rather than char*.
strings/ctype-ucs2.c:
Use UNINIT_VAR rather than LINT_INIT.
Add (uchar*) casting.
-rw-r--r-- | cmd-line-utils/libedit/filecomplete.c | 3 | ||||
-rw-r--r-- | configure.cmake | 9 | ||||
-rw-r--r-- | extra/comp_err.c | 2 | ||||
-rw-r--r-- | extra/perror.c | 2 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/runtime.hpp | 2 | ||||
-rw-r--r-- | include/my_global.h | 11 | ||||
-rw-r--r-- | mysys/lf_alloc-pin.c | 3 | ||||
-rw-r--r-- | sql/ha_partition.cc | 3 | ||||
-rw-r--r-- | sql/mysqld.cc | 6 | ||||
-rw-r--r-- | sql/partition_info.cc | 11 | ||||
-rw-r--r-- | sql/rpl_handler.cc | 21 | ||||
-rw-r--r-- | sql/spatial.cc | 10 | ||||
-rw-r--r-- | sql/spatial.h | 12 | ||||
-rw-r--r-- | sql/sql_partition.cc | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 7 | ||||
-rw-r--r-- | sql/sys_vars.cc | 4 | ||||
-rw-r--r-- | storage/innobase/os/os0file.c | 1 | ||||
-rw-r--r-- | storage/myisam/mi_create.c | 5 | ||||
-rw-r--r-- | storage/myisam/mi_open.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_page.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_search.c | 6 | ||||
-rw-r--r-- | strings/ctype-ucs2.c | 34 |
22 files changed, 83 insertions, 75 deletions
diff --git a/cmd-line-utils/libedit/filecomplete.c b/cmd-line-utils/libedit/filecomplete.c index 4c63f57bc45..05bd10e9f9e 100644 --- a/cmd-line-utils/libedit/filecomplete.c +++ b/cmd-line-utils/libedit/filecomplete.c @@ -95,10 +95,9 @@ static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$', char * fn_tilde_expand(const char *txt) { - struct passwd pwres, *pass; + struct passwd *pass; char *temp; size_t len = 0; - char pwbuf[1024]; if (txt[0] != '~') return (strdup(txt)); diff --git a/configure.cmake b/configure.cmake index df71a96ee47..14e561b86ef 100644 --- a/configure.cmake +++ b/configure.cmake @@ -54,6 +54,15 @@ IF(NOT SYSTEM_TYPE) ENDIF() +# Always enable -Wall for gnu C/C++ +IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +ENDIF() +IF(CMAKE_COMPILER_IS_GNUCC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") +ENDIF() + + IF(CMAKE_COMPILER_IS_GNUCXX) # MySQL "canonical" GCC flags. At least -fno-rtti flag affects # ABI and cannot be simply removed. diff --git a/extra/comp_err.c b/extra/comp_err.c index e4a07caa2ef..362533d9781 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -686,7 +686,7 @@ static ha_checksum checksum_format_specifier(const char* msg) case 'u': case 'x': case 's': - chksum= my_checksum(chksum, start, (uint) (p + 1 - start)); + chksum= my_checksum(chksum, (uchar*) start, (uint) (p + 1 - start)); start= 0; /* Not in format specifier anymore */ break; diff --git a/extra/perror.c b/extra/perror.c index d9c636ceb8c..eda0253129d 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -269,7 +269,7 @@ int main(int argc,char *argv[]) HA_ERRORS *ha_err_ptr; for (code=1 ; code < sys_nerr ; code++) { - if (sys_errlist[code][0]) + if (sys_errlist[code] && sys_errlist[code][0]) { /* Skip if no error-text */ printf("%3d = %s\n",code,sys_errlist[code]); } diff --git a/extra/yassl/taocrypt/include/runtime.hpp b/extra/yassl/taocrypt/include/runtime.hpp index 99bbe3ac8a3..b59f61a1cde 100644 --- a/extra/yassl/taocrypt/include/runtime.hpp +++ b/extra/yassl/taocrypt/include/runtime.hpp @@ -60,7 +60,7 @@ static int __cxa_pure_virtual() __attribute__((noinline, used)); static int __cxa_pure_virtual() { // oops, pure virtual called! - assert("Pure virtual method called." == "Aborted"); + assert(!"Pure virtual method called. Aborted"); return 0; } diff --git a/include/my_global.h b/include/my_global.h index 094853cb642..2a65c610604 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1070,6 +1070,17 @@ typedef long long my_ptrdiff_t; #define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B)) #define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))] +#ifdef __cplusplus +template <size_t sz> struct Aligned_char_array +{ + union { + void *v; // Ensures alignment. + char arr[sz]; // The actual buffer. + } u; + void* arr() { return &u.arr[0]; } +}; +#endif /* __cplusplus */ + /* Custom version of standard offsetof() macro which can be used to get offsets of members in class for non-POD types (according to the current diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c index fda9b97791d..7fd10703871 100644 --- a/mysys/lf_alloc-pin.c +++ b/mysys/lf_alloc-pin.c @@ -329,10 +329,9 @@ static void _lf_pinbox_real_free(LF_PINS *pins) { int npins, alloca_size; void *list, **addr; - void *first, *last= NULL; + void *first= NULL, *last= NULL; LF_PINBOX *pinbox= pins->pinbox; - LINT_INIT(first); npins= pinbox->pins_in_array+1; #ifdef HAVE_ALLOCA diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index f0b77a831a8..86332f8c79c 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4181,10 +4181,9 @@ int ha_partition::index_read_map(uchar *buf, const uchar *key, int ha_partition::common_index_read(uchar *buf, bool have_start_key) { int error; - uint key_len; + uint UNINIT_VAR(key_len); /* used if have_start_key==TRUE */ bool reverse_order= FALSE; DBUG_ENTER("ha_partition::common_index_read"); - LINT_INIT(key_len); /* used if have_start_key==TRUE */ DBUG_PRINT("info", ("m_ordered %u m_ordered_scan_ong %u have_start_key %u", m_ordered, m_ordered_scan_ongoing, have_start_key)); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0edb42f5d36..89b601d07f9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5343,11 +5343,11 @@ inline void kill_broken_server() void handle_connections_sockets() { - my_socket sock,new_sock; + my_socket UNINIT_VAR(sock), UNINIT_VAR(new_sock); uint error_count=0; THD *thd; struct sockaddr_storage cAddr; - int ip_flags=0,socket_flags=0,flags,retval; + int ip_flags=0,socket_flags=0,flags=0,retval; st_vio *vio_tmp; #ifdef HAVE_POLL int socket_count= 0; @@ -5359,8 +5359,6 @@ void handle_connections_sockets() DBUG_ENTER("handle_connections_sockets"); - LINT_INIT(new_sock); - #ifndef HAVE_POLL FD_ZERO(&clientFDs); #endif diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 4a2d457df9c..e505630d08f 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -701,12 +701,11 @@ bool partition_info::check_range_constants(THD *thd) if (column_list) { part_column_list_val *loc_range_col_array; - part_column_list_val *current_largest_col_val; + part_column_list_val *UNINIT_VAR(current_largest_col_val); uint num_column_values= part_field_list.elements; uint size_entries= sizeof(part_column_list_val) * num_column_values; range_col_array= (part_column_list_val*)sql_calloc(num_parts * size_entries); - LINT_INIT(current_largest_col_val); if (unlikely(range_col_array == NULL)) { mem_alloc_error(num_parts * size_entries); @@ -739,12 +738,10 @@ bool partition_info::check_range_constants(THD *thd) } else { - longlong current_largest; + longlong UNINIT_VAR(current_largest); longlong part_range_value; bool signed_flag= !part_expr->unsigned_flag; - LINT_INIT(current_largest); - part_result_type= INT_RESULT; range_int_array= (longlong*)sql_alloc(num_parts * sizeof(longlong)); if (unlikely(range_int_array == NULL)) @@ -894,7 +891,8 @@ bool partition_info::check_list_constants(THD *thd) part_elem_value *list_value; bool result= TRUE; longlong type_add, calc_value; - void *curr_value, *prev_value; + void *curr_value; + void *UNINIT_VAR(prev_value); partition_element* part_def; bool found_null= FALSE; int (*compare_func)(const void *, const void*); @@ -1009,7 +1007,6 @@ bool partition_info::check_list_constants(THD *thd) compare_func); i= 0; - LINT_INIT(prev_value); do { DBUG_ASSERT(i < num_list_values); diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc index 9cb5391075d..be0a61bcae2 100644 --- a/sql/rpl_handler.cc +++ b/sql/rpl_handler.cc @@ -89,21 +89,24 @@ int get_user_var_str(const char *name, char *value, int delegates_init() { - static unsigned long trans_mem[sizeof(Trans_delegate) / sizeof(unsigned long) + 1]; - static unsigned long storage_mem[sizeof(Binlog_storage_delegate) / sizeof(unsigned long) + 1]; + static Aligned_char_array<sizeof(Trans_delegate)> trans_mem; + static Aligned_char_array<sizeof(Binlog_storage_delegate)> storage_mem; #ifdef HAVE_REPLICATION - static unsigned long transmit_mem[sizeof(Binlog_transmit_delegate) / sizeof(unsigned long) + 1]; - static unsigned long relay_io_mem[sizeof(Binlog_relay_IO_delegate)/ sizeof(unsigned long) + 1]; + static Aligned_char_array<sizeof(Binlog_transmit_delegate)> transmit_mem; + static Aligned_char_array<sizeof(Binlog_relay_IO_delegate)> relay_io_mem; #endif - - if (!(transaction_delegate= new (trans_mem) Trans_delegate) + + if (!(transaction_delegate= new (trans_mem.arr()) Trans_delegate) || (!transaction_delegate->is_inited()) - || !(binlog_storage_delegate= new (storage_mem) Binlog_storage_delegate) + || !(binlog_storage_delegate= + new (storage_mem.arr()) Binlog_storage_delegate) || (!binlog_storage_delegate->is_inited()) #ifdef HAVE_REPLICATION - || !(binlog_transmit_delegate= new (transmit_mem) Binlog_transmit_delegate) + || !(binlog_transmit_delegate= + new (transmit_mem.arr()) Binlog_transmit_delegate) || (!binlog_transmit_delegate->is_inited()) - || !(binlog_relay_io_delegate= new (relay_io_mem) Binlog_relay_IO_delegate) + || !(binlog_relay_io_delegate= + new (relay_io_mem.arr()) Binlog_relay_IO_delegate) || (!binlog_relay_io_delegate->is_inited()) #endif /* HAVE_REPLICATION */ ) diff --git a/sql/spatial.cc b/sql/spatial.cc index 34b1f3d1f0c..fcf06119db9 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -128,6 +128,16 @@ Geometry::Class_info *Geometry::find_class(const char *name, uint32 len) } +Geometry *Geometry::create_by_typeid(Geometry_buffer *buffer, int type_id) +{ + Class_info *ci; + if (!(ci= find_class((int) type_id))) + return NULL; + (*ci->m_create_func)(buffer->buf.arr()); + return my_reinterpret_cast(Geometry *)(buffer->buf.arr()); +} + + Geometry *Geometry::construct(Geometry_buffer *buffer, const char *data, uint32 data_len) { diff --git a/sql/spatial.h b/sql/spatial.h index a4bce47d0e5..aabbb7a1b97 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -267,14 +267,7 @@ public: virtual int geometry_n(uint32 num, String *result) const { return -1; } public: - static Geometry *create_by_typeid(Geometry_buffer *buffer, int type_id) - { - Class_info *ci; - if (!(ci= find_class((int) type_id))) - return NULL; - (*ci->m_create_func)((void *)buffer); - return my_reinterpret_cast(Geometry *)(buffer); - } + static Geometry *create_by_typeid(Geometry_buffer *buffer, int type_id); static Geometry *construct(Geometry_buffer *buffer, const char *data, uint32 data_len); @@ -532,10 +525,9 @@ public: const Class_info *get_class_info() const; }; -const int geometry_buffer_size= sizeof(Gis_point); struct Geometry_buffer { - void *arr[(geometry_buffer_size - 1)/sizeof(void *) + 1]; + Aligned_char_array<sizeof(Gis_point)> buf; }; #endif /*HAVE_SPATAIAL*/ diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 398af8c676e..e6f9a10801b 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4584,7 +4584,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, partition_info *tab_part_info= table->part_info; partition_info *alt_part_info= thd->work_part_info; uint flags= 0; - bool is_last_partition_reorged; + bool is_last_partition_reorged= FALSE; part_elem_value *tab_max_elem_val= NULL; part_elem_value *alt_max_elem_val= NULL; longlong tab_max_range= 0, alt_max_range= 0; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 19281dbbf37..f8d99d87228 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1899,8 +1899,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, bool dont_log_query) { TABLE_LIST *table; - char path[FN_REFLEN + 1], *alias; - uint path_length; + char path[FN_REFLEN + 1], *alias= NULL; + uint path_length= 0; String wrong_tables; int error= 0; int non_temp_tables_count= 0; @@ -1909,9 +1909,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, String built_tmp_query; DBUG_ENTER("mysql_rm_table_part2"); - LINT_INIT(alias); - LINT_INIT(path_length); - if (thd->is_current_stmt_binlog_format_row() && !dont_log_query) { built_query.set_charset(system_charset_info); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index b8312fc3255..aeb9dda3a8b 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2723,8 +2723,8 @@ static Sys_var_mybool Sys_log_slow( static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type) { bool res; - my_bool *newvalptr, newval, oldval; - uint log_type; + my_bool *UNINIT_VAR(newvalptr), newval, UNINIT_VAR(oldval); + uint UNINIT_VAR(log_type); if (self == &Sys_general_log || self == &Sys_log) { diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c index 37edad442db..885faa7b51f 100644 --- a/storage/innobase/os/os0file.c +++ b/storage/innobase/os/os0file.c @@ -3923,6 +3923,7 @@ os_aio_simulated_handle( ulint n; ulint i; + consecutive_ios[0]= NULL; segment = os_aio_get_array_and_local_segment(&array, global_segment); restart: diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 66d5d4fa3cd..3db03e23637 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -38,7 +38,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, MI_CREATE_INFO *ci,uint flags) { register uint i,j; - File UNINIT_VAR(dfile),file; + File UNINIT_VAR(dfile), UNINIT_VAR(file); int errpos,save_errno, create_mode= O_RDWR | O_TRUNC; myf create_flag; uint fields,length,max_key_length,packed,pointer,real_length_diff, @@ -73,8 +73,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, { DBUG_RETURN(my_errno=HA_WRONG_CREATE_OPTION); } - LINT_INIT(dfile); - LINT_INIT(file); + errpos=0; options=0; bzero((uchar*) &share,sizeof(share)); diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index f7137ac554d..ef5b442cd3a 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -143,7 +143,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) (uchar*) myisam_file_magic, 4)) { DBUG_PRINT("error",("Wrong header in %s",name_buff)); - DBUG_DUMP("error_dump",(char*) share->state.header.file_version, + DBUG_DUMP("error_dump", share->state.header.file_version, head_length); my_errno=HA_ERR_NOT_A_TABLE; goto err; diff --git a/storage/myisam/mi_page.c b/storage/myisam/mi_page.c index 23a2526f756..2cf3891807f 100644 --- a/storage/myisam/mi_page.c +++ b/storage/myisam/mi_page.c @@ -49,7 +49,7 @@ uchar *_mi_fetch_keypage(register MI_INFO *info, MI_KEYDEF *keyinfo, { DBUG_PRINT("error",("page %lu had wrong page length: %u", (ulong) page, page_size)); - DBUG_DUMP("page", (char*) tmp, keyinfo->block_length); + DBUG_DUMP("page", tmp, keyinfo->block_length); info->last_keypage = HA_OFFSET_ERROR; mi_print_error(info->s, HA_ERR_CRASHED); my_errno = HA_ERR_CRASHED; diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c index 95f817e47aa..c7ebf9ae220 100644 --- a/storage/myisam/mi_search.c +++ b/storage/myisam/mi_search.c @@ -819,7 +819,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, DBUG_PRINT("error", ("Found too long null packed key: %u of %u at 0x%lx", length, keyseg->length, (long) *page_pos)); - DBUG_DUMP("key",(char*) *page_pos,16); + DBUG_DUMP("key",(uchar*) *page_pos,16); mi_print_error(keyinfo->share, HA_ERR_CRASHED); my_errno=HA_ERR_CRASHED; return 0; @@ -876,7 +876,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, { DBUG_PRINT("error",("Found too long packed key: %u of %u at 0x%lx", length, keyseg->length, (long) *page_pos)); - DBUG_DUMP("key",(char*) *page_pos,16); + DBUG_DUMP("key",(uchar*) *page_pos,16); mi_print_error(keyinfo->share, HA_ERR_CRASHED); my_errno=HA_ERR_CRASHED; return 0; /* Error */ @@ -948,7 +948,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, DBUG_PRINT("error", ("Found too long binary packed key: %u of %u at 0x%lx", length, keyinfo->maxlength, (long) *page_pos)); - DBUG_DUMP("key",(char*) *page_pos,16); + DBUG_DUMP("key",(uchar*) *page_pos,16); mi_print_error(keyinfo->share, HA_ERR_CRASHED); my_errno=HA_ERR_CRASHED; DBUG_RETURN(0); /* Wrong key */ diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index e3e13af85ef..3946f6a83b4 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1961,12 +1961,10 @@ my_strnncoll_utf32(CHARSET_INFO *cs, const uchar *t, size_t tlen, my_bool t_is_prefix) { - my_wc_t s_wc,t_wc; + my_wc_t UNINIT_VAR(s_wc),UNINIT_VAR(t_wc); const uchar *se= s + slen; const uchar *te= t + tlen; MY_UNICASE_INFO **uni_plane= cs->caseinfo; - LINT_INIT(s_wc); - LINT_INIT(t_wc); while (s < se && t < te) { @@ -2028,11 +2026,9 @@ my_strnncollsp_utf32(CHARSET_INFO *cs, my_bool diff_if_only_endspace_difference) { int res; - my_wc_t s_wc, t_wc; + my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); const uchar *se= s + slen, *te= t + tlen; MY_UNICASE_INFO **uni_plane= cs->caseinfo; - LINT_INIT(s_wc); - LINT_INIT(t_wc); DBUG_ASSERT((slen % 4) == 0); DBUG_ASSERT((tlen % 4) == 0); @@ -2498,11 +2494,9 @@ my_strnncoll_utf32_bin(CHARSET_INFO *cs, const uchar *t, size_t tlen, my_bool t_is_prefix) { - my_wc_t s_wc, t_wc; + my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); const uchar *se= s + slen; const uchar *te= t + tlen; - LINT_INIT(s_wc); - LINT_INIT(t_wc); while (s < se && t < te) { @@ -2624,7 +2618,7 @@ my_like_range_utf32(CHARSET_INFO *cs, { my_wc_t wc; int res; - if ((res= my_utf32_uni(cs, &wc, ptr, end)) < 0) + if ((res= my_utf32_uni(cs, &wc, (uchar*) ptr, (uchar*) end)) < 0) { my_fill_utf32(cs, min_str, min_end - min_str, cs->min_sort_char); my_fill_utf32(cs, max_str, min_end - min_str, cs->max_sort_char); @@ -2635,15 +2629,15 @@ my_like_range_utf32(CHARSET_INFO *cs, if (wc == (my_wc_t) escape) { ptr+= 4; /* Skip escape */ - if ((res= my_utf32_uni(cs, &wc, ptr, end)) < 0) + if ((res= my_utf32_uni(cs, &wc, (uchar*) ptr, (uchar*) end)) < 0) { my_fill_utf32(cs, min_str, min_end - min_str, cs->min_sort_char); my_fill_utf32(cs, max_str, max_end - min_str, cs->max_sort_char); /* min_length and max_length are not important */ return TRUE; } - if (my_uni_utf32(cs, wc, min_str, min_end) != 4 || - my_uni_utf32(cs, wc, max_str, max_end) != 4) + if (my_uni_utf32(cs, wc, (uchar*) min_str, (uchar*) min_end) != 4 || + my_uni_utf32(cs, wc, (uchar*) max_str, (uchar*) max_end) != 4) goto pad_set_lengths; *min_str++= 4; *max_str++= 4; @@ -2652,8 +2646,8 @@ my_like_range_utf32(CHARSET_INFO *cs, if (wc == (my_wc_t) w_one) { - if (my_uni_utf32(cs, cs->min_sort_char, min_str, min_end) != 4 || - my_uni_utf32(cs, cs->max_sort_char, max_str, max_end) != 4) + if (my_uni_utf32(cs, cs->min_sort_char, (uchar*) min_str, (uchar*) min_end) != 4 || + my_uni_utf32(cs, cs->max_sort_char, (uchar*) max_str, (uchar*) max_end) != 4) goto pad_set_lengths; min_str+= 4; max_str+= 4; @@ -2675,8 +2669,8 @@ my_like_range_utf32(CHARSET_INFO *cs, } /* Normal character */ - if (my_uni_utf32(cs, wc, min_str, min_end) != 4 || - my_uni_utf32(cs, wc, max_str, max_end) != 4) + if (my_uni_utf32(cs, wc, (uchar*) min_str, (uchar*) min_end) != 4 || + my_uni_utf32(cs, wc, (uchar*) max_str, (uchar*) max_end) != 4) goto pad_set_lengths; min_str+= 4; max_str+= 4; @@ -2704,7 +2698,7 @@ my_scan_utf32(CHARSET_INFO *cs, for ( ; str < end; ) { my_wc_t wc; - int res= my_utf32_uni(cs, &wc, str, end); + int res= my_utf32_uni(cs, &wc, (uchar*) str, (uchar*) end); if (res < 0 || wc != ' ') break; str+= res; @@ -3008,7 +3002,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs, my_bool t_is_prefix) { int s_res,t_res; - my_wc_t UNINIT_VAR(s_wc),t_wc; + my_wc_t UNINIT_VAR(s_wc),UNINIT_VAR(t_wc); const uchar *se=s+slen; const uchar *te=t+tlen; MY_UNICASE_INFO **uni_plane= cs->caseinfo; @@ -3195,7 +3189,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs, my_bool t_is_prefix) { int s_res,t_res; - my_wc_t UNINIT_VAR(s_wc),t_wc; + my_wc_t UNINIT_VAR(s_wc),UNINIT_VAR(t_wc); const uchar *se=s+slen; const uchar *te=t+tlen; |