diff options
author | unknown <georg@lmy002.wdf.sap.corp> | 2005-06-13 12:41:15 +0200 |
---|---|---|
committer | unknown <georg@lmy002.wdf.sap.corp> | 2005-06-13 12:41:15 +0200 |
commit | ba144e2290e100c02d9f4f4648d8ce1cabbdde77 (patch) | |
tree | 0a4d130bc8c5eb5d2582f3864b50584de7a5647f /sql | |
parent | 871977f26f523a3587c24273e3ebc61ccd26890f (diff) | |
download | mariadb-git-ba144e2290e100c02d9f4f4648d8ce1cabbdde77.tar.gz |
fixes for windows 64-bit compiler warnings
heap/hp_hash.c:
fix for windows 64-bit compiler warnings
heap/hp_update.c:
fix for windows 64-bit compiler warnings
mysys/default.c:
fix for windows 64-bit compiler warnings
mysys/default_modify.c:
fix for windows 64-bit compiler warnings
mysys/mf_iocache.c:
fix for windows 64-bit compiler warnings
mysys/mf_keycache.c:
fix for windows 64-bit compiler warnings
mysys/my_alloc.c:
fix for windows 64-bit compiler warnings
mysys/my_getopt.c:
fix for windows 64-bit compiler warnings
mysys/my_mmap.c:
fix for windows 64-bit compiler warnings
mysys/my_once.c:
fix for windows 64-bit compiler warnings
mysys/string.c:
fix for windows 64-bit compiler warnings
sql-common/client.c:
fix for windows 64-bit compiler warnings
sql/field.cc:
fix for windows 64-bit compiler warnings
sql/gstream.cc:
fix for windows 64-bit compiler warnings
sql/ha_myisam.cc:
fix for windows 64-bit compiler warnings
sql/ha_myisammrg.cc:
fix for windows 64-bit compiler warnings
sql/item.cc:
fix for windows 64-bit compiler warnings
sql/item.h:
fix for windows 64-bit compiler warnings
sql/item_cmpfunc.cc:
fix for windows 64-bit compiler warnings
sql/password.c:
fix for windows 64-bit compiler warnings
sql/set_var.h:
fix for windows 64-bit compiler warnings
strings/ctype-big5.c:
fix for windows 64-bit compiler warnings
strings/ctype-bin.c:
fix for windows 64-bit compiler warnings
strings/ctype-cp932.c:
fix for windows 64-bit compiler warnings
strings/ctype-eucjpms.c:
fix for windows 64-bit compiler warnings
strings/ctype-mb.c:
fix for windows 64-bit compiler warnings
strings/ctype-simple.c:
fix for windows 64-bit compiler warnings
strings/ctype-sjis.c:
fix for windows 64-bit compiler warnings
strings/ctype-uca.c:
fix for windows 64-bit compiler warnings
strings/ctype-ucs2.c:
fix for windows 64-bit compiler warnings
strings/ctype-ujis.c:
fix for windows 64-bit compiler warnings
strings/ctype-utf8.c:
fix for windows 64-bit compiler warnings
strings/ctype.c:
fix for windows 64-bit compiler warnings
strings/decimal.c:
fix for windows 64-bit compiler warnings
strings/xml.c:
fix for windows 64-bit compiler warnings
Diffstat (limited to 'sql')
-rw-r--r-- | sql/field.cc | 9 | ||||
-rw-r--r-- | sql/gstream.cc | 4 | ||||
-rw-r--r-- | sql/ha_myisam.cc | 2 | ||||
-rw-r--r-- | sql/ha_myisammrg.cc | 2 | ||||
-rw-r--r-- | sql/item.cc | 23 | ||||
-rw-r--r-- | sql/item.h | 2 | ||||
-rw-r--r-- | sql/item_cmpfunc.cc | 7 | ||||
-rw-r--r-- | sql/password.c | 8 | ||||
-rw-r--r-- | sql/set_var.h | 3 |
9 files changed, 32 insertions, 28 deletions
diff --git a/sql/field.cc b/sql/field.cc index 89ef25475ff..acf3c0647cb 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1920,7 +1920,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs) int_digits_added_zeros=0; } } - tmp_uint= (tmp_dec+(int_digits_end-int_digits_from)+ + tmp_uint= (uint) (tmp_dec+(int_digits_end-int_digits_from)+ (uint)(frac_digits_from-int_digits_tail_from)+ int_digits_added_zeros); } @@ -7734,9 +7734,9 @@ bool Field_enum::eq_def(Field *field) for (uint i=0 ; i < from_lib->count ; i++) if (my_strnncoll(field_charset, (const uchar*)typelib->type_names[i], - strlen(typelib->type_names[i]), + (uint) strlen(typelib->type_names[i]), (const uchar*)from_lib->type_names[i], - strlen(from_lib->type_names[i]))) + (uint) strlen(from_lib->type_names[i]))) return 0; return 1; } @@ -8594,7 +8594,8 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code, { char str_nr[22]; char *str_end= longlong10_to_str(nr, str_nr, -10); - make_truncated_value_warning(table->in_use, str_nr, str_end - str_nr, + make_truncated_value_warning(table->in_use, str_nr, + (uint) (str_end - str_nr), ts_type, field_name); } } diff --git a/sql/gstream.cc b/sql/gstream.cc index f7d11d76b0c..4083cb2fe71 100644 --- a/sql/gstream.cc +++ b/sql/gstream.cc @@ -83,7 +83,7 @@ bool Gis_read_stream::get_next_number(double *d) } *d = my_strntod(m_charset, (char *)m_cur, - m_limit-m_cur, &endptr, &err); + (uint) (m_limit-m_cur), &endptr, &err); if (err) return 1; if (endptr) @@ -115,6 +115,6 @@ bool Gis_read_stream::check_next_symbol(char symbol) void Gis_read_stream::set_error_msg(const char *msg) { size_t len= strlen(msg); // ok in this context - m_err_msg= (char *) my_realloc(m_err_msg, len + 1, MYF(MY_ALLOW_ZERO_PTR)); + m_err_msg= (char *) my_realloc(m_err_msg, (uint) len + 1, MYF(MY_ALLOW_ZERO_PTR)); memcpy(m_err_msg, msg, len + 1); } diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 1352fd84d9d..0d9c32adbfa 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1068,7 +1068,7 @@ bool ha_myisam::check_and_repair(THD *thd) old_query_length= thd->query_length; pthread_mutex_lock(&LOCK_thread_count); thd->query= (char*) table->s->table_name; - thd->query_length= strlen(table->s->table_name); + thd->query_length= (uint32) strlen(table->s->table_name); pthread_mutex_unlock(&LOCK_thread_count); if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt)) diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 0796ded3ac0..5d3f379081c 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -466,7 +466,7 @@ void ha_myisammrg::append_create_info(String *packet) MYRG_TABLE *open_table,*first; current_db= table->s->db; - db_length= strlen(current_db); + db_length= (uint) strlen(current_db); for (first=open_table=file->open_tables ; open_table != file->end_table ; diff --git a/sql/item.cc b/sql/item.cc index 680b771f908..b722a4cb122 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -307,7 +307,7 @@ void *Item::operator new(size_t size, Item *reuse, uint *rsize) return (void *)reuse; } if (rsize) - (*rsize)= size; + (*rsize)= (uint) size; return (void *)sql_alloc((uint)size); } @@ -382,7 +382,7 @@ void Item::print_item_w_name(String *str) { THD *thd= current_thd; str->append(" AS ", 4); - append_identifier(thd, str, name, strlen(name)); + append_identifier(thd, str, name, (uint) strlen(name)); } } @@ -1132,27 +1132,27 @@ void Item_ident::print(String *str) if (!table_name || !field_name) { const char *nm= field_name ? field_name : name ? name : "tmp_field"; - append_identifier(thd, str, nm, strlen(nm)); + append_identifier(thd, str, nm, (uint) strlen(nm)); return; } if (db_name && db_name[0] && !alias_name_used) { - append_identifier(thd, str, d_name, strlen(d_name)); + append_identifier(thd, str, d_name, (uint) strlen(d_name)); str->append('.'); - append_identifier(thd, str, t_name, strlen(t_name)); + append_identifier(thd, str, t_name, (uint) strlen(t_name)); str->append('.'); - append_identifier(thd, str, field_name, strlen(field_name)); + append_identifier(thd, str, field_name, (uint) strlen(field_name)); } else { if (table_name[0]) { - append_identifier(thd, str, t_name, strlen(t_name)); + append_identifier(thd, str, t_name, (uint) strlen(t_name)); str->append('.'); - append_identifier(thd, str, field_name, strlen(field_name)); + append_identifier(thd, str, field_name, (uint) strlen(field_name)); } else - append_identifier(thd, str, field_name, strlen(field_name)); + append_identifier(thd, str, field_name, (uint) strlen(field_name)); } } @@ -2179,7 +2179,7 @@ const String *Item_param::query_val_str(String* str) const ptr+= escape_string_for_mysql(str_value.charset(), ptr, 0, str_value.ptr(), str_value.length()); *ptr++= '\''; - str->length(ptr - buf); + str->length((uint32) (ptr - buf)); break; } case NULL_VALUE: @@ -4597,7 +4597,8 @@ void Item_trigger_field::setup_field(THD *thd, TABLE *table) Try to find field by its name and if it will be found set field_idx properly. */ - (void)find_field_in_real_table(thd, table, field_name, strlen(field_name), + (void)find_field_in_real_table(thd, table, field_name, + (uint) strlen(field_name), 0, 0, &field_idx); thd->set_query_id= save_set_query_id; triggers= table->triggers; diff --git a/sql/item.h b/sql/item.h index 1fe90a41e3a..fdbd6ba3326 100644 --- a/sql/item.h +++ b/sql/item.h @@ -630,7 +630,7 @@ public: Item *it= this_item(); if (name) - it->set_name(name, strlen(name), system_charset_info); + it->set_name(name, (uint) strlen(name), system_charset_info); else it->set_name(m_name.str, m_name.length, system_charset_info); it->make_field(field); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index b5b37efaf07..cb8a31c65e7 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2794,10 +2794,11 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref) if (canDoTurboBM) { pattern = first + 1; - pattern_len = len - 2; + pattern_len = (int) len - 2; DBUG_PRINT("info", ("Initializing pattern: '%s'", first)); - int *suff = (int*) thd->alloc(sizeof(int)*((pattern_len + 1)*2+ - alphabet_size)); + int *suff = (int*) thd->alloc((int) (sizeof(int)* + ((pattern_len + 1)*2+ + alphabet_size))); bmGs = suff + pattern_len + 1; bmBc = bmGs + pattern_len + 1; turboBM_compute_good_suffix_shifts(suff); diff --git a/sql/password.c b/sql/password.c index 79675ade30b..60cc0ac0c97 100644 --- a/sql/password.c +++ b/sql/password.c @@ -146,7 +146,7 @@ void hash_password(ulong *result, const char *password, uint password_len) void make_scrambled_password_323(char *to, const char *password) { ulong hash_res[2]; - hash_password(hash_res, password, strlen(password)); + hash_password(hash_res, password, (uint) strlen(password)); sprintf(to, "%08lx%08lx", hash_res[0], hash_res[1]); } @@ -172,7 +172,7 @@ void scramble_323(char *to, const char *message, const char *password) { char extra, *to_start=to; const char *message_end= message + SCRAMBLE_LENGTH_323; - hash_password(hash_pass,password, strlen(password)); + hash_password(hash_pass,password, (uint) strlen(password)); hash_password(hash_message, message, SCRAMBLE_LENGTH_323); randominit(&rand_st,hash_pass[0] ^ hash_message[0], hash_pass[1] ^ hash_message[1]); @@ -394,7 +394,7 @@ make_scrambled_password(char *to, const char *password) sha1_reset(&sha1_context); /* stage 1: hash password */ - sha1_input(&sha1_context, (uint8 *) password, strlen(password)); + sha1_input(&sha1_context, (uint8 *) password, (uint) strlen(password)); sha1_result(&sha1_context, (uint8 *) to); /* stage 2: hash stage1 output */ sha1_reset(&sha1_context); @@ -433,7 +433,7 @@ scramble(char *to, const char *message, const char *password) sha1_reset(&sha1_context); /* stage 1: hash password */ - sha1_input(&sha1_context, (uint8 *) password, strlen(password)); + sha1_input(&sha1_context, (uint8 *) password, (uint) strlen(password)); sha1_result(&sha1_context, hash_stage1); /* stage 2: hash stage 1; note that hash_stage2 is stored in the database */ sha1_reset(&sha1_context); diff --git a/sql/set_var.h b/sql/set_var.h index 56690c46131..a6532323b34 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -786,7 +786,8 @@ public: if (value_arg && value_arg->type() == Item::FIELD_ITEM) { Item_field *item= (Item_field*) value_arg; - if (!(value=new Item_string(item->field_name, strlen(item->field_name), + if (!(value=new Item_string(item->field_name, + (uint) strlen(item->field_name), item->collation.collation))) value=value_arg; /* Give error message later */ } |