fixes for windows 64-bit compiler warnings
This commit is contained in:
parent
55f962c0cf
commit
b64e6db5a4
@ -778,7 +778,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
|
|||||||
key+= seg->length;
|
key+= seg->length;
|
||||||
}
|
}
|
||||||
memcpy(key, &recpos, sizeof(byte*));
|
memcpy(key, &recpos, sizeof(byte*));
|
||||||
return key - start_key;
|
return (uint) (key - start_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -844,7 +844,7 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
|
|||||||
key+= seg->length;
|
key+= seg->length;
|
||||||
k_len-= seg->length;
|
k_len-= seg->length;
|
||||||
}
|
}
|
||||||
return key - start_key;
|
return (uint) (key - start_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -866,7 +866,7 @@ uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key)
|
|||||||
continue;
|
continue;
|
||||||
key+= seg->length;
|
key+= seg->length;
|
||||||
}
|
}
|
||||||
return key - start_key;
|
return (uint) (key - start_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -886,7 +886,7 @@ uint hp_rb_var_key_length(HP_KEYDEF *keydef, const byte *key)
|
|||||||
}
|
}
|
||||||
key+= length;
|
key+= length;
|
||||||
}
|
}
|
||||||
return key - start_key;
|
return (uint) (key - start_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ int heap_update(HP_INFO *info, const byte *old, const byte *heap_new)
|
|||||||
err:
|
err:
|
||||||
if (my_errno == HA_ERR_FOUND_DUPP_KEY)
|
if (my_errno == HA_ERR_FOUND_DUPP_KEY)
|
||||||
{
|
{
|
||||||
info->errkey = keydef - share->keydef;
|
info->errkey = (int) (keydef - share->keydef);
|
||||||
if (keydef->algorithm == HA_KEY_ALG_BTREE)
|
if (keydef->algorithm == HA_KEY_ALG_BTREE)
|
||||||
{
|
{
|
||||||
/* we don't need to delete non-inserted key from rb-tree */
|
/* we don't need to delete non-inserted key from rb-tree */
|
||||||
|
@ -856,7 +856,7 @@ static void init_default_directories()
|
|||||||
/* Only add shared system directory if different from default. */
|
/* Only add shared system directory if different from default. */
|
||||||
if (GetSystemWindowsDirectory(shared_system_dir,sizeof(shared_system_dir)) &&
|
if (GetSystemWindowsDirectory(shared_system_dir,sizeof(shared_system_dir)) &&
|
||||||
strcmp(system_dir, shared_system_dir))
|
strcmp(system_dir, shared_system_dir))
|
||||||
*ptr++= &shared_system_dir;
|
*ptr++= (char *)&shared_system_dir;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined(__NETWARE__)
|
#elif defined(__NETWARE__)
|
||||||
|
@ -58,8 +58,8 @@ int modify_defaults_file(const char *file_location, const char *option,
|
|||||||
if (my_fstat(fileno(cnf_file), &file_stat, MYF(0)))
|
if (my_fstat(fileno(cnf_file), &file_stat, MYF(0)))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
optlen= strlen(option);
|
optlen= (uint) strlen(option);
|
||||||
optval_len= strlen(option_value);
|
optval_len= (uint) strlen(option_value);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Reserve space to read the contents of the file and some more
|
Reserve space to read the contents of the file and some more
|
||||||
@ -79,7 +79,7 @@ int modify_defaults_file(const char *file_location, const char *option,
|
|||||||
FN_REFLEN), MYF(MY_WME))))
|
FN_REFLEN), MYF(MY_WME))))
|
||||||
goto malloc_err;
|
goto malloc_err;
|
||||||
|
|
||||||
sect_len= strlen(section_name);
|
sect_len= (uint) strlen(section_name);
|
||||||
|
|
||||||
for (dst_ptr= file_buffer; fgets(linebuff, BUFF_SIZE, cnf_file); )
|
for (dst_ptr= file_buffer; fgets(linebuff, BUFF_SIZE, cnf_file); )
|
||||||
{
|
{
|
||||||
|
@ -601,7 +601,7 @@ int _my_b_read_r(register IO_CACHE *info, byte *Buffer, uint Count)
|
|||||||
info->error= info->share->active->error;
|
info->error= info->share->active->error;
|
||||||
info->read_end= info->share->active->read_end;
|
info->read_end= info->share->active->read_end;
|
||||||
info->pos_in_file= info->share->active->pos_in_file;
|
info->pos_in_file= info->share->active->pos_in_file;
|
||||||
len= (info->error == -1 ? -1 : info->read_end-info->buffer);
|
len= (int) (info->error == -1 ? -1 : info->read_end-info->buffer);
|
||||||
}
|
}
|
||||||
info->read_pos=info->buffer;
|
info->read_pos=info->buffer;
|
||||||
info->seek_not_done=0;
|
info->seek_not_done=0;
|
||||||
|
@ -2191,7 +2191,7 @@ static int flush_cached_blocks(KEY_CACHE *keycache,
|
|||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
int last_errno= 0;
|
int last_errno= 0;
|
||||||
uint count= end-cache;
|
uint count= (uint) (end-cache);
|
||||||
|
|
||||||
/* Don't lock the cache during the flush */
|
/* Don't lock the cache during the flush */
|
||||||
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
||||||
|
@ -333,7 +333,7 @@ void set_prealloc_root(MEM_ROOT *root, char *ptr)
|
|||||||
|
|
||||||
char *strdup_root(MEM_ROOT *root,const char *str)
|
char *strdup_root(MEM_ROOT *root,const char *str)
|
||||||
{
|
{
|
||||||
return strmake_root(root, str, strlen(str));
|
return strmake_root(root, str, (uint) strlen(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
char *strmake_root(MEM_ROOT *root,const char *str, uint len)
|
char *strmake_root(MEM_ROOT *root,const char *str, uint len)
|
||||||
|
@ -180,7 +180,7 @@ int handle_options(int *argc, char ***argv,
|
|||||||
}
|
}
|
||||||
opt_str= check_struct_option(cur_arg, key_name);
|
opt_str= check_struct_option(cur_arg, key_name);
|
||||||
optend= strcend(opt_str, '=');
|
optend= strcend(opt_str, '=');
|
||||||
length= optend - opt_str;
|
length= (uint) (optend - opt_str);
|
||||||
if (*optend == '=')
|
if (*optend == '=')
|
||||||
optend++;
|
optend++;
|
||||||
else
|
else
|
||||||
@ -323,7 +323,7 @@ int handle_options(int *argc, char ***argv,
|
|||||||
return EXIT_NO_ARGUMENT_ALLOWED;
|
return EXIT_NO_ARGUMENT_ALLOWED;
|
||||||
}
|
}
|
||||||
value= optp->var_type & GET_ASK_ADDR ?
|
value= optp->var_type & GET_ASK_ADDR ?
|
||||||
(*getopt_get_addr)(key_name, strlen(key_name), optp) : optp->value;
|
(*getopt_get_addr)(key_name, (uint) strlen(key_name), optp) : optp->value;
|
||||||
|
|
||||||
if (optp->arg_type == NO_ARG)
|
if (optp->arg_type == NO_ARG)
|
||||||
{
|
{
|
||||||
@ -519,7 +519,7 @@ static char *check_struct_option(char *cur_arg, char *key_name)
|
|||||||
*/
|
*/
|
||||||
if (end - ptr > 1)
|
if (end - ptr > 1)
|
||||||
{
|
{
|
||||||
uint len= ptr - cur_arg;
|
uint len= (uint) (ptr - cur_arg);
|
||||||
set_if_smaller(len, FN_REFLEN-1);
|
set_if_smaller(len, FN_REFLEN-1);
|
||||||
strmake(key_name, cur_arg, len);
|
strmake(key_name, cur_arg, len);
|
||||||
return ++ptr;
|
return ++ptr;
|
||||||
@ -833,7 +833,7 @@ void my_print_help(const struct my_option *options)
|
|||||||
if (strlen(optp->name))
|
if (strlen(optp->name))
|
||||||
{
|
{
|
||||||
printf("--%s", optp->name);
|
printf("--%s", optp->name);
|
||||||
col+= 2 + strlen(optp->name);
|
col+= 2 + (uint) strlen(optp->name);
|
||||||
if ((optp->var_type & GET_TYPE_MASK) == GET_STR ||
|
if ((optp->var_type & GET_TYPE_MASK) == GET_STR ||
|
||||||
(optp->var_type & GET_TYPE_MASK) == GET_STR_ALLOC)
|
(optp->var_type & GET_TYPE_MASK) == GET_STR_ALLOC)
|
||||||
{
|
{
|
||||||
@ -904,7 +904,7 @@ void my_print_variables(const struct my_option *options)
|
|||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
printf("%s", optp->name);
|
printf("%s", optp->name);
|
||||||
length= strlen(optp->name);
|
length= (uint) strlen(optp->name);
|
||||||
for (; length < name_space; length++)
|
for (; length < name_space; length++)
|
||||||
putchar(' ');
|
putchar(' ');
|
||||||
switch ((optp->var_type & GET_TYPE_MASK)) {
|
switch ((optp->var_type & GET_TYPE_MASK)) {
|
||||||
|
@ -53,7 +53,7 @@ void *my_mmap(void *addr, size_t len, int prot,
|
|||||||
flProtect|=SEC_COMMIT;
|
flProtect|=SEC_COMMIT;
|
||||||
|
|
||||||
hFileMap=CreateFileMapping(hFile, &mmap_security_attributes,
|
hFileMap=CreateFileMapping(hFile, &mmap_security_attributes,
|
||||||
PAGE_READWRITE, 0, len, NULL);
|
PAGE_READWRITE, 0, (DWORD) len, NULL);
|
||||||
if (hFileMap == 0)
|
if (hFileMap == 0)
|
||||||
return MAP_FAILED;
|
return MAP_FAILED;
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ gptr my_once_alloc(unsigned int Size, myf MyFlags)
|
|||||||
|
|
||||||
char *my_once_strdup(const char *src,myf myflags)
|
char *my_once_strdup(const char *src,myf myflags)
|
||||||
{
|
{
|
||||||
uint len=strlen(src)+1;
|
uint len= (uint) strlen(src)+1;
|
||||||
char *dst=my_once_alloc(len, myflags);
|
char *dst=my_once_alloc(len, myflags);
|
||||||
if (dst)
|
if (dst)
|
||||||
memcpy(dst, src, len);
|
memcpy(dst, src, len);
|
||||||
|
@ -91,7 +91,7 @@ my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size)
|
|||||||
|
|
||||||
my_bool dynstr_append(DYNAMIC_STRING *str, const char *append)
|
my_bool dynstr_append(DYNAMIC_STRING *str, const char *append)
|
||||||
{
|
{
|
||||||
return dynstr_append_mem(str,append,strlen(append));
|
return dynstr_append_mem(str,append,(uint) strlen(append));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2130,7 +2130,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
|
|||||||
for (; ptr<end; ptr++)
|
for (; ptr<end; ptr++)
|
||||||
{
|
{
|
||||||
MYSQL_RES *res;
|
MYSQL_RES *res;
|
||||||
if (mysql_real_query(mysql,*ptr, strlen(*ptr)))
|
if (mysql_real_query(mysql,*ptr, (ulong) strlen(*ptr)))
|
||||||
goto error;
|
goto error;
|
||||||
if (mysql->fields)
|
if (mysql->fields)
|
||||||
{
|
{
|
||||||
|
@ -1920,7 +1920,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
|
|||||||
int_digits_added_zeros=0;
|
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)+
|
(uint)(frac_digits_from-int_digits_tail_from)+
|
||||||
int_digits_added_zeros);
|
int_digits_added_zeros);
|
||||||
}
|
}
|
||||||
@ -7734,9 +7734,9 @@ bool Field_enum::eq_def(Field *field)
|
|||||||
for (uint i=0 ; i < from_lib->count ; i++)
|
for (uint i=0 ; i < from_lib->count ; i++)
|
||||||
if (my_strnncoll(field_charset,
|
if (my_strnncoll(field_charset,
|
||||||
(const uchar*)typelib->type_names[i],
|
(const uchar*)typelib->type_names[i],
|
||||||
strlen(typelib->type_names[i]),
|
(uint) strlen(typelib->type_names[i]),
|
||||||
(const uchar*)from_lib->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 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -8594,7 +8594,8 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code,
|
|||||||
{
|
{
|
||||||
char str_nr[22];
|
char str_nr[22];
|
||||||
char *str_end= longlong10_to_str(nr, str_nr, -10);
|
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);
|
ts_type, field_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ bool Gis_read_stream::get_next_number(double *d)
|
|||||||
}
|
}
|
||||||
|
|
||||||
*d = my_strntod(m_charset, (char *)m_cur,
|
*d = my_strntod(m_charset, (char *)m_cur,
|
||||||
m_limit-m_cur, &endptr, &err);
|
(uint) (m_limit-m_cur), &endptr, &err);
|
||||||
if (err)
|
if (err)
|
||||||
return 1;
|
return 1;
|
||||||
if (endptr)
|
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)
|
void Gis_read_stream::set_error_msg(const char *msg)
|
||||||
{
|
{
|
||||||
size_t len= strlen(msg); // ok in this context
|
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);
|
memcpy(m_err_msg, msg, len + 1);
|
||||||
}
|
}
|
||||||
|
@ -1068,7 +1068,7 @@ bool ha_myisam::check_and_repair(THD *thd)
|
|||||||
old_query_length= thd->query_length;
|
old_query_length= thd->query_length;
|
||||||
pthread_mutex_lock(&LOCK_thread_count);
|
pthread_mutex_lock(&LOCK_thread_count);
|
||||||
thd->query= (char*) table->s->table_name;
|
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);
|
pthread_mutex_unlock(&LOCK_thread_count);
|
||||||
|
|
||||||
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
|
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
|
||||||
|
@ -466,7 +466,7 @@ void ha_myisammrg::append_create_info(String *packet)
|
|||||||
MYRG_TABLE *open_table,*first;
|
MYRG_TABLE *open_table,*first;
|
||||||
|
|
||||||
current_db= table->s->db;
|
current_db= table->s->db;
|
||||||
db_length= strlen(current_db);
|
db_length= (uint) strlen(current_db);
|
||||||
|
|
||||||
for (first=open_table=file->open_tables ;
|
for (first=open_table=file->open_tables ;
|
||||||
open_table != file->end_table ;
|
open_table != file->end_table ;
|
||||||
|
23
sql/item.cc
23
sql/item.cc
@ -307,7 +307,7 @@ void *Item::operator new(size_t size, Item *reuse, uint *rsize)
|
|||||||
return (void *)reuse;
|
return (void *)reuse;
|
||||||
}
|
}
|
||||||
if (rsize)
|
if (rsize)
|
||||||
(*rsize)= size;
|
(*rsize)= (uint) size;
|
||||||
return (void *)sql_alloc((uint)size);
|
return (void *)sql_alloc((uint)size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,7 +382,7 @@ void Item::print_item_w_name(String *str)
|
|||||||
{
|
{
|
||||||
THD *thd= current_thd;
|
THD *thd= current_thd;
|
||||||
str->append(" AS ", 4);
|
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)
|
if (!table_name || !field_name)
|
||||||
{
|
{
|
||||||
const char *nm= field_name ? field_name : name ? name : "tmp_field";
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (db_name && db_name[0] && !alias_name_used)
|
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('.');
|
str->append('.');
|
||||||
append_identifier(thd, str, t_name, strlen(t_name));
|
append_identifier(thd, str, t_name, (uint) strlen(t_name));
|
||||||
str->append('.');
|
str->append('.');
|
||||||
append_identifier(thd, str, field_name, strlen(field_name));
|
append_identifier(thd, str, field_name, (uint) strlen(field_name));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (table_name[0])
|
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('.');
|
str->append('.');
|
||||||
append_identifier(thd, str, field_name, strlen(field_name));
|
append_identifier(thd, str, field_name, (uint) strlen(field_name));
|
||||||
}
|
}
|
||||||
else
|
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,
|
ptr+= escape_string_for_mysql(str_value.charset(), ptr, 0,
|
||||||
str_value.ptr(), str_value.length());
|
str_value.ptr(), str_value.length());
|
||||||
*ptr++= '\'';
|
*ptr++= '\'';
|
||||||
str->length(ptr - buf);
|
str->length((uint32) (ptr - buf));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NULL_VALUE:
|
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
|
Try to find field by its name and if it will be found
|
||||||
set field_idx properly.
|
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);
|
0, 0, &field_idx);
|
||||||
thd->set_query_id= save_set_query_id;
|
thd->set_query_id= save_set_query_id;
|
||||||
triggers= table->triggers;
|
triggers= table->triggers;
|
||||||
|
@ -630,7 +630,7 @@ public:
|
|||||||
Item *it= this_item();
|
Item *it= this_item();
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
it->set_name(name, strlen(name), system_charset_info);
|
it->set_name(name, (uint) strlen(name), system_charset_info);
|
||||||
else
|
else
|
||||||
it->set_name(m_name.str, m_name.length, system_charset_info);
|
it->set_name(m_name.str, m_name.length, system_charset_info);
|
||||||
it->make_field(field);
|
it->make_field(field);
|
||||||
|
@ -2794,10 +2794,11 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref)
|
|||||||
if (canDoTurboBM)
|
if (canDoTurboBM)
|
||||||
{
|
{
|
||||||
pattern = first + 1;
|
pattern = first + 1;
|
||||||
pattern_len = len - 2;
|
pattern_len = (int) len - 2;
|
||||||
DBUG_PRINT("info", ("Initializing pattern: '%s'", first));
|
DBUG_PRINT("info", ("Initializing pattern: '%s'", first));
|
||||||
int *suff = (int*) thd->alloc(sizeof(int)*((pattern_len + 1)*2+
|
int *suff = (int*) thd->alloc((int) (sizeof(int)*
|
||||||
alphabet_size));
|
((pattern_len + 1)*2+
|
||||||
|
alphabet_size)));
|
||||||
bmGs = suff + pattern_len + 1;
|
bmGs = suff + pattern_len + 1;
|
||||||
bmBc = bmGs + pattern_len + 1;
|
bmBc = bmGs + pattern_len + 1;
|
||||||
turboBM_compute_good_suffix_shifts(suff);
|
turboBM_compute_good_suffix_shifts(suff);
|
||||||
|
@ -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)
|
void make_scrambled_password_323(char *to, const char *password)
|
||||||
{
|
{
|
||||||
ulong hash_res[2];
|
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]);
|
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;
|
char extra, *to_start=to;
|
||||||
const char *message_end= message + SCRAMBLE_LENGTH_323;
|
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);
|
hash_password(hash_message, message, SCRAMBLE_LENGTH_323);
|
||||||
randominit(&rand_st,hash_pass[0] ^ hash_message[0],
|
randominit(&rand_st,hash_pass[0] ^ hash_message[0],
|
||||||
hash_pass[1] ^ hash_message[1]);
|
hash_pass[1] ^ hash_message[1]);
|
||||||
@ -394,7 +394,7 @@ make_scrambled_password(char *to, const char *password)
|
|||||||
|
|
||||||
sha1_reset(&sha1_context);
|
sha1_reset(&sha1_context);
|
||||||
/* stage 1: hash password */
|
/* 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);
|
sha1_result(&sha1_context, (uint8 *) to);
|
||||||
/* stage 2: hash stage1 output */
|
/* stage 2: hash stage1 output */
|
||||||
sha1_reset(&sha1_context);
|
sha1_reset(&sha1_context);
|
||||||
@ -433,7 +433,7 @@ scramble(char *to, const char *message, const char *password)
|
|||||||
|
|
||||||
sha1_reset(&sha1_context);
|
sha1_reset(&sha1_context);
|
||||||
/* stage 1: hash password */
|
/* 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);
|
sha1_result(&sha1_context, hash_stage1);
|
||||||
/* stage 2: hash stage 1; note that hash_stage2 is stored in the database */
|
/* stage 2: hash stage 1; note that hash_stage2 is stored in the database */
|
||||||
sha1_reset(&sha1_context);
|
sha1_reset(&sha1_context);
|
||||||
|
@ -786,7 +786,8 @@ public:
|
|||||||
if (value_arg && value_arg->type() == Item::FIELD_ITEM)
|
if (value_arg && value_arg->type() == Item::FIELD_ITEM)
|
||||||
{
|
{
|
||||||
Item_field *item= (Item_field*) value_arg;
|
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)))
|
item->collation.collation)))
|
||||||
value=value_arg; /* Give error message later */
|
value=value_arg; /* Give error message later */
|
||||||
}
|
}
|
||||||
|
@ -6320,7 +6320,7 @@ uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b - b0;
|
return (uint) (b - b0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ skip:
|
|||||||
if (nmatch > 0)
|
if (nmatch > 0)
|
||||||
{
|
{
|
||||||
match[0].beg= 0;
|
match[0].beg= 0;
|
||||||
match[0].end= str- (const uchar*)b-1;
|
match[0].end= (uint) (str- (const uchar*)b-1);
|
||||||
match[0].mblen= match[0].end;
|
match[0].mblen= match[0].end;
|
||||||
|
|
||||||
if (nmatch > 1)
|
if (nmatch > 1)
|
||||||
|
@ -5446,7 +5446,7 @@ uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b - b0;
|
return (uint) (b - b0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8403,14 +8403,14 @@ uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
|
|
||||||
chbeg= (char *) b++;
|
chbeg= (char *) b++;
|
||||||
if (b >= (uchar *) end) /* need more bytes */
|
if (b >= (uchar *) end) /* need more bytes */
|
||||||
return chbeg - beg; /* unexpected EOL */
|
return (uint) (chbeg - beg); /* unexpected EOL */
|
||||||
|
|
||||||
if (ch == 0x8E) /* [x8E][xA0-xDF] */
|
if (ch == 0x8E) /* [x8E][xA0-xDF] */
|
||||||
{
|
{
|
||||||
if (*b >= 0xA0 && *b <= 0xDF)
|
if (*b >= 0xA0 && *b <= 0xDF)
|
||||||
continue;
|
continue;
|
||||||
*error=1;
|
*error=1;
|
||||||
return chbeg - beg; /* invalid sequence */
|
return (uint) (chbeg - beg); /* invalid sequence */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */
|
if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */
|
||||||
@ -8419,7 +8419,7 @@ uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
if (b >= (uchar*) end)
|
if (b >= (uchar*) end)
|
||||||
{
|
{
|
||||||
*error= 1;
|
*error= 1;
|
||||||
return chbeg - beg; /* unexpected EOL */
|
return (uint)(chbeg - beg); /* unexpected EOL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8427,9 +8427,9 @@ uint my_well_formed_len_eucjpms(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
|
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
|
||||||
continue;
|
continue;
|
||||||
*error=1;
|
*error=1;
|
||||||
return chbeg - beg; /* invalid sequence */
|
return (uint) (chbeg - beg); /* invalid sequence */
|
||||||
}
|
}
|
||||||
return b - (uchar *) beg;
|
return (uint) (b - (uchar *) beg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
pos+= (mblen= my_ismbchar(cs, pos, end)) ? mblen : 1;
|
pos+= (mblen= my_ismbchar(cs, pos, end)) ? mblen : 1;
|
||||||
length--;
|
length--;
|
||||||
}
|
}
|
||||||
return length ? end+2-start : pos-start;
|
return (uint) (length ? end+2-start : pos-start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e,
|
|||||||
b+= mblen;
|
b+= mblen;
|
||||||
pos--;
|
pos--;
|
||||||
}
|
}
|
||||||
return b - b_start;
|
return (uint) (b - b_start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ uint my_instr_mb(CHARSET_INFO *cs,
|
|||||||
if (nmatch)
|
if (nmatch)
|
||||||
{
|
{
|
||||||
match[0].beg= 0;
|
match[0].beg= 0;
|
||||||
match[0].end= b-b0;
|
match[0].end= (uint) (b-b0);
|
||||||
match[0].mblen= res;
|
match[0].mblen= res;
|
||||||
if (nmatch > 1)
|
if (nmatch > 1)
|
||||||
{
|
{
|
||||||
|
@ -1084,7 +1084,7 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
|
|||||||
if (*str == '.')
|
if (*str == '.')
|
||||||
{
|
{
|
||||||
for(str++ ; str != end && *str == '0' ; str++);
|
for(str++ ; str != end && *str == '0' ; str++);
|
||||||
return str-str0;
|
return (ulong) (str-str0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -1094,7 +1094,7 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
|
|||||||
if (!my_isspace(cs,*str))
|
if (!my_isspace(cs,*str))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return str-str0;
|
return (ulong) (str-str0);
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1111,14 +1111,14 @@ void my_fill_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
uint my_numchars_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
uint my_numchars_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
const char *b, const char *e)
|
const char *b, const char *e)
|
||||||
{
|
{
|
||||||
return e-b;
|
return (uint) (e-b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint my_numcells_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
uint my_numcells_8bit(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
const char *b, const char *e)
|
const char *b, const char *e)
|
||||||
{
|
{
|
||||||
return e-b;
|
return (uint) (e-b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1193,7 +1193,7 @@ skip:
|
|||||||
if (nmatch > 0)
|
if (nmatch > 0)
|
||||||
{
|
{
|
||||||
match[0].beg= 0;
|
match[0].beg= 0;
|
||||||
match[0].end= str- (const uchar*)b-1;
|
match[0].end= (uint) (str- (const uchar*)b-1);
|
||||||
match[0].mblen= match[0].end;
|
match[0].mblen= match[0].end;
|
||||||
|
|
||||||
if (nmatch > 1)
|
if (nmatch > 1)
|
||||||
|
@ -4615,7 +4615,7 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b - b0;
|
return (uint) (b - b0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7527,7 +7527,7 @@ static void my_coll_lexem_print_error(MY_COLL_LEXEM *lexem,
|
|||||||
{
|
{
|
||||||
char tail[30];
|
char tail[30];
|
||||||
size_t len= lexem->end - lexem->prev;
|
size_t len= lexem->end - lexem->prev;
|
||||||
strmake (tail, lexem->prev, min(len, sizeof(tail)-1));
|
strmake (tail, lexem->prev, (uint) min(len, sizeof(tail)-1));
|
||||||
errstr[errsize-1]= '\0';
|
errstr[errsize-1]= '\0';
|
||||||
my_snprintf(errstr,errsize-1,"%s at '%s'", txt, tail);
|
my_snprintf(errstr,errsize-1,"%s at '%s'", txt, tail);
|
||||||
}
|
}
|
||||||
@ -7769,7 +7769,7 @@ static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (size_t) nitems;
|
return (int) nitems;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MY_MAX_COLL_RULE 128
|
#define MY_MAX_COLL_RULE 128
|
||||||
|
@ -229,7 +229,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs,
|
|||||||
s+=s_res;
|
s+=s_res;
|
||||||
t+=t_res;
|
t+=t_res;
|
||||||
}
|
}
|
||||||
return t_is_prefix ? t-te : ((se-s) - (te-t));
|
return (int) (t_is_prefix ? t-te : ((se-s) - (te-t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -344,14 +344,14 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs,
|
|||||||
s+=s_res;
|
s+=s_res;
|
||||||
t+=t_res;
|
t+=t_res;
|
||||||
}
|
}
|
||||||
return ( (se-s) - (te-t) );
|
return (int) ( (se-s) - (te-t) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int my_strcasecmp_ucs2(CHARSET_INFO *cs, const char *s, const char *t)
|
static int my_strcasecmp_ucs2(CHARSET_INFO *cs, const char *s, const char *t)
|
||||||
{
|
{
|
||||||
uint s_len=strlen(s);
|
uint s_len= (uint) strlen(s);
|
||||||
uint t_len=strlen(t);
|
uint t_len= (uint) strlen(t);
|
||||||
uint len = (s_len > t_len) ? s_len : t_len;
|
uint len = (s_len > t_len) ? s_len : t_len;
|
||||||
return my_strncasecmp_ucs2(cs, s, t, len);
|
return my_strncasecmp_ucs2(cs, s, t, len);
|
||||||
}
|
}
|
||||||
@ -386,7 +386,7 @@ static int my_strnxfrm_ucs2(CHARSET_INFO *cs,
|
|||||||
dst+=res;
|
dst+=res;
|
||||||
}
|
}
|
||||||
if (dst < de)
|
if (dst < de)
|
||||||
cs->cset->fill(cs, (char*) dst, de - dst, ' ');
|
cs->cset->fill(cs, (char*) dst, (uint) (de - dst), ' ');
|
||||||
return dstlen;
|
return dstlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1370,7 +1370,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
|
|||||||
s+=s_res;
|
s+=s_res;
|
||||||
t+=t_res;
|
t+=t_res;
|
||||||
}
|
}
|
||||||
return t_is_prefix ? t-te : ((se-s) - (te-t));
|
return (int) (t_is_prefix ? t-te : ((se-s) - (te-t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs,
|
static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs,
|
||||||
@ -1387,8 +1387,8 @@ static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs,
|
|||||||
static
|
static
|
||||||
int my_strcasecmp_ucs2_bin(CHARSET_INFO *cs, const char *s, const char *t)
|
int my_strcasecmp_ucs2_bin(CHARSET_INFO *cs, const char *s, const char *t)
|
||||||
{
|
{
|
||||||
uint s_len=strlen(s);
|
uint s_len= (uint) strlen(s);
|
||||||
uint t_len=strlen(t);
|
uint t_len= (uint) strlen(t);
|
||||||
uint len = (s_len > t_len) ? s_len : t_len;
|
uint len = (s_len > t_len) ? s_len : t_len;
|
||||||
return my_strncasecmp_ucs2(cs, s, t, len);
|
return my_strncasecmp_ucs2(cs, s, t, len);
|
||||||
}
|
}
|
||||||
@ -1525,7 +1525,7 @@ ulong my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
if (str[0] != '\0' || str[1] != ' ')
|
if (str[0] != '\0' || str[1] != ' ')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return str - str0;
|
return (ulong) (str - str0);
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -8270,7 +8270,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
if (b >= (uchar *) end) /* need more bytes */
|
if (b >= (uchar *) end) /* need more bytes */
|
||||||
{
|
{
|
||||||
*error= 1;
|
*error= 1;
|
||||||
return chbeg - beg; /* unexpected EOL */
|
return (uint) (chbeg - beg); /* unexpected EOL */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch == 0x8E) /* [x8E][xA0-xDF] */
|
if (ch == 0x8E) /* [x8E][xA0-xDF] */
|
||||||
@ -8278,7 +8278,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
if (*b >= 0xA0 && *b <= 0xDF)
|
if (*b >= 0xA0 && *b <= 0xDF)
|
||||||
continue;
|
continue;
|
||||||
*error= 1;
|
*error= 1;
|
||||||
return chbeg - beg; /* invalid sequence */
|
return (uint) (chbeg - beg); /* invalid sequence */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */
|
if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */
|
||||||
@ -8287,7 +8287,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
if (b >= (uchar*) end)
|
if (b >= (uchar*) end)
|
||||||
{
|
{
|
||||||
*error= 1;
|
*error= 1;
|
||||||
return chbeg - beg; /* unexpected EOL */
|
return (uint) (chbeg - beg); /* unexpected EOL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8295,9 +8295,9 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
|
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
|
||||||
continue;
|
continue;
|
||||||
*error= 1;
|
*error= 1;
|
||||||
return chbeg - beg; /* invalid sequence */
|
return (uint) (chbeg - beg); /* invalid sequence */
|
||||||
}
|
}
|
||||||
return b - (uchar *) beg;
|
return (uint) (b - (uchar *) beg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1932,7 +1932,7 @@ static uchar to_upper_utf8[] = {
|
|||||||
static inline int bincmp(const uchar *s, const uchar *se,
|
static inline int bincmp(const uchar *s, const uchar *se,
|
||||||
const uchar *t, const uchar *te)
|
const uchar *t, const uchar *te)
|
||||||
{
|
{
|
||||||
int slen=se-s, tlen=te-t;
|
int slen= (int) (se-s), tlen= (int) (te-t);
|
||||||
int len=min(slen,tlen);
|
int len=min(slen,tlen);
|
||||||
int cmp= memcmp(s,t,len);
|
int cmp= memcmp(s,t,len);
|
||||||
return cmp ? cmp : slen-tlen;
|
return cmp ? cmp : slen-tlen;
|
||||||
@ -2108,7 +2108,7 @@ static uint my_caseup_utf8(CHARSET_INFO *cs, char *src, uint srclen,
|
|||||||
src+= srcres;
|
src+= srcres;
|
||||||
dst+= dstres;
|
dst+= dstres;
|
||||||
}
|
}
|
||||||
return dst - dst0;
|
return (uint) (dst - dst0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen,
|
static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen,
|
||||||
@ -2141,7 +2141,7 @@ static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen,
|
|||||||
|
|
||||||
static void my_caseup_str_utf8(CHARSET_INFO * cs, char * s)
|
static void my_caseup_str_utf8(CHARSET_INFO * cs, char * s)
|
||||||
{
|
{
|
||||||
uint len= strlen(s);
|
uint len= (uint) strlen(s);
|
||||||
my_caseup_utf8(cs, s, len, s, len);
|
my_caseup_utf8(cs, s, len, s, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2165,12 +2165,12 @@ static uint my_casedn_utf8(CHARSET_INFO *cs, char *src, uint srclen,
|
|||||||
src+= srcres;
|
src+= srcres;
|
||||||
dst+= dstres;
|
dst+= dstres;
|
||||||
}
|
}
|
||||||
return dst - dst0;
|
return (uint) (dst - dst0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void my_casedn_str_utf8(CHARSET_INFO *cs, char * s)
|
static void my_casedn_str_utf8(CHARSET_INFO *cs, char * s)
|
||||||
{
|
{
|
||||||
uint len= strlen(s);
|
uint len= (uint) strlen(s);
|
||||||
my_casedn_utf8(cs, s, len, s, len);
|
my_casedn_utf8(cs, s, len, s, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2210,7 +2210,7 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs,
|
|||||||
s+=s_res;
|
s+=s_res;
|
||||||
t+=t_res;
|
t+=t_res;
|
||||||
}
|
}
|
||||||
return t_is_prefix ? t-te : ((se-s) - (te-t));
|
return (int) (t_is_prefix ? t-te : ((se-s) - (te-t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2284,8 +2284,8 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs,
|
|||||||
t+=t_res;
|
t+=t_res;
|
||||||
}
|
}
|
||||||
|
|
||||||
slen= se-s;
|
slen= (uint) (se-s);
|
||||||
tlen= te-t;
|
tlen= (uint) (te-t);
|
||||||
res= 0;
|
res= 0;
|
||||||
|
|
||||||
if (slen != tlen)
|
if (slen != tlen)
|
||||||
|
@ -216,7 +216,7 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, uint len)
|
|||||||
{
|
{
|
||||||
struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data;
|
struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data;
|
||||||
struct my_cs_file_section_st *s;
|
struct my_cs_file_section_st *s;
|
||||||
int state= (s=cs_file_sec(st->attr,strlen(st->attr))) ? s->state : 0;
|
int state= (int)((s=cs_file_sec(st->attr, (int) strlen(st->attr))) ? s->state : 0);
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
if(0){
|
if(0){
|
||||||
|
@ -472,7 +472,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
i= DIG_PER_DEC1 - 1;
|
i= DIG_PER_DEC1 - 1;
|
||||||
start= (buf_beg - from->buf) * DIG_PER_DEC1;
|
start= (int) ((buf_beg - from->buf) * DIG_PER_DEC1);
|
||||||
}
|
}
|
||||||
if (buf_beg < end)
|
if (buf_beg < end)
|
||||||
for (; *buf_beg < powers10[i--]; start++) ;
|
for (; *buf_beg < powers10[i--]; start++) ;
|
||||||
@ -484,13 +484,13 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result)
|
|||||||
/* find non-zero decimal digit from the end */
|
/* find non-zero decimal digit from the end */
|
||||||
if (buf_end == end - 1 && from->frac)
|
if (buf_end == end - 1 && from->frac)
|
||||||
{
|
{
|
||||||
stop= ((buf_end - from->buf) * DIG_PER_DEC1 +
|
stop= (int) (((buf_end - from->buf) * DIG_PER_DEC1 +
|
||||||
(i= ((from->frac - 1) % DIG_PER_DEC1 + 1)));
|
(i= ((from->frac - 1) % DIG_PER_DEC1 + 1))));
|
||||||
i= DIG_PER_DEC1 - i + 1;
|
i= DIG_PER_DEC1 - i + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stop= (buf_end - from->buf + 1) * DIG_PER_DEC1;
|
stop= (int) ((buf_end - from->buf + 1) * DIG_PER_DEC1);
|
||||||
i= 1;
|
i= 1;
|
||||||
}
|
}
|
||||||
for (; *buf_end % powers10[i++] == 0; stop--);
|
for (; *buf_end % powers10[i++] == 0; stop--);
|
||||||
@ -794,13 +794,13 @@ internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed)
|
|||||||
s1=s;
|
s1=s;
|
||||||
while (s < end_of_string && my_isdigit(&my_charset_latin1, *s))
|
while (s < end_of_string && my_isdigit(&my_charset_latin1, *s))
|
||||||
s++;
|
s++;
|
||||||
intg=s-s1;
|
intg= (int) (s-s1);
|
||||||
if (s < end_of_string && *s=='.')
|
if (s < end_of_string && *s=='.')
|
||||||
{
|
{
|
||||||
endp= s+1;
|
endp= s+1;
|
||||||
while (endp < end_of_string && my_isdigit(&my_charset_latin1, *endp))
|
while (endp < end_of_string && my_isdigit(&my_charset_latin1, *endp))
|
||||||
endp++;
|
endp++;
|
||||||
frac= endp - s - 1;
|
frac= (int) (endp - s - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1715,14 +1715,14 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
|
|||||||
while (buf1 < stop1 && *buf1 == 0)
|
while (buf1 < stop1 && *buf1 == 0)
|
||||||
buf1++;
|
buf1++;
|
||||||
start1=buf1;
|
start1=buf1;
|
||||||
intg1=stop1-buf1;
|
intg1= (int) (stop1-buf1);
|
||||||
}
|
}
|
||||||
if (unlikely(*buf2 == 0))
|
if (unlikely(*buf2 == 0))
|
||||||
{
|
{
|
||||||
while (buf2 < stop2 && *buf2 == 0)
|
while (buf2 < stop2 && *buf2 == 0)
|
||||||
buf2++;
|
buf2++;
|
||||||
start2=buf2;
|
start2=buf2;
|
||||||
intg2=stop2-buf2;
|
intg2= (int) (stop2-buf2);
|
||||||
}
|
}
|
||||||
if (intg2 > intg1)
|
if (intg2 > intg1)
|
||||||
carry=1;
|
carry=1;
|
||||||
@ -1734,8 +1734,8 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
|
|||||||
end1--;
|
end1--;
|
||||||
while (unlikely((buf2 <= end2) && (*end2 == 0)))
|
while (unlikely((buf2 <= end2) && (*end2 == 0)))
|
||||||
end2--;
|
end2--;
|
||||||
frac1= (end1 - stop1) + 1;
|
frac1= (int) (end1 - stop1) + 1;
|
||||||
frac2= (end2 - stop2) + 1;
|
frac2= (int) (end2 - stop2) + 1;
|
||||||
while (buf1 <=end1 && buf2 <= end2 && *buf1 == *buf2)
|
while (buf1 <=end1 && buf2 <= end2 && *buf1 == *buf2)
|
||||||
buf1++, buf2++;
|
buf1++, buf2++;
|
||||||
if (buf1 <= end1)
|
if (buf1 <= end1)
|
||||||
@ -2086,7 +2086,7 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2,
|
|||||||
/* removing end zeroes */
|
/* removing end zeroes */
|
||||||
while (*stop2 == 0 && stop2 >= start2)
|
while (*stop2 == 0 && stop2 >= start2)
|
||||||
stop2--;
|
stop2--;
|
||||||
len2= stop2++ - start2;
|
len2= (int) (stop2++ - start2);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
calculating norm2 (normalized *start2) - we need *start2 to be large
|
calculating norm2 (normalized *start2) - we need *start2 to be large
|
||||||
@ -2173,7 +2173,7 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2,
|
|||||||
if (dcarry)
|
if (dcarry)
|
||||||
*--start1=dcarry;
|
*--start1=dcarry;
|
||||||
buf0=to->buf;
|
buf0=to->buf;
|
||||||
intg0=ROUND_UP(prec1-frac1)-(start1-tmp1);
|
intg0=(int) (ROUND_UP(prec1-frac1)-(start1-tmp1));
|
||||||
frac0=ROUND_UP(to->frac);
|
frac0=ROUND_UP(to->frac);
|
||||||
error=E_DEC_OK;
|
error=E_DEC_OK;
|
||||||
if (unlikely(frac0==0 && intg0==0))
|
if (unlikely(frac0==0 && intg0==0))
|
||||||
|
@ -148,7 +148,7 @@ static int my_xml_enter(MY_XML_PARSER *st, const char *str, uint len)
|
|||||||
memcpy(st->attrend,str,len);
|
memcpy(st->attrend,str,len);
|
||||||
st->attrend+=len;
|
st->attrend+=len;
|
||||||
st->attrend[0]='\0';
|
st->attrend[0]='\0';
|
||||||
return st->enter ? st->enter(st,st->attr,st->attrend-st->attr) : MY_XML_OK;
|
return st->enter ? st->enter(st,st->attr,st->attrend-st->attr) : MY_XML_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, uint slen)
|
|||||||
|
|
||||||
/* Find previous '.' or beginning */
|
/* Find previous '.' or beginning */
|
||||||
for( e=p->attrend; (e>p->attr) && (e[0]!='.') ; e--);
|
for( e=p->attrend; (e>p->attr) && (e[0]!='.') ; e--);
|
||||||
glen = (e[0]=='.') ? (p->attrend-e-1) : p->attrend-e;
|
glen = (uint) ((e[0]=='.') ? (p->attrend-e-1) : p->attrend-e);
|
||||||
|
|
||||||
if (str && (slen != glen))
|
if (str && (slen != glen))
|
||||||
{
|
{
|
||||||
@ -180,7 +180,7 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, uint slen)
|
|||||||
return MY_XML_ERROR;
|
return MY_XML_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = p->leave_xml ? p->leave_xml(p,p->attr,p->attrend-p->attr) : MY_XML_OK;
|
rc = p->leave_xml ? p->leave_xml(p,p->attr,p->attrend-p->attr) : MY_XML_OK;
|
||||||
|
|
||||||
*e='\0';
|
*e='\0';
|
||||||
p->attrend=e;
|
p->attrend=e;
|
||||||
@ -221,7 +221,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
|
|||||||
sprintf(p->errstr,"1: %s unexpected (ident wanted)",lex2str(lex));
|
sprintf(p->errstr,"1: %s unexpected (ident wanted)",lex2str(lex));
|
||||||
return MY_XML_ERROR;
|
return MY_XML_ERROR;
|
||||||
}
|
}
|
||||||
if(MY_XML_OK!=my_xml_leave(p,a.beg,a.end-a.beg))
|
if(MY_XML_OK!=my_xml_leave(p,a.beg,(uint) (a.end-a.beg)))
|
||||||
return MY_XML_ERROR;
|
return MY_XML_ERROR;
|
||||||
lex=my_xml_scan(p,&a);
|
lex=my_xml_scan(p,&a);
|
||||||
goto gt;
|
goto gt;
|
||||||
@ -240,7 +240,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
|
|||||||
|
|
||||||
if (MY_XML_IDENT==lex)
|
if (MY_XML_IDENT==lex)
|
||||||
{
|
{
|
||||||
if(MY_XML_OK!=my_xml_enter(p,a.beg,a.end-a.beg))
|
if(MY_XML_OK!=my_xml_enter(p,a.beg,(uint) (a.end-a.beg)))
|
||||||
return MY_XML_ERROR;
|
return MY_XML_ERROR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -258,9 +258,9 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
|
|||||||
lex=my_xml_scan(p,&b);
|
lex=my_xml_scan(p,&b);
|
||||||
if ( (lex==MY_XML_IDENT) || (lex==MY_XML_STRING) )
|
if ( (lex==MY_XML_IDENT) || (lex==MY_XML_STRING) )
|
||||||
{
|
{
|
||||||
if((MY_XML_OK!=my_xml_enter(p,a.beg,a.end-a.beg)) ||
|
if((MY_XML_OK!=my_xml_enter(p,a.beg,(uint) (a.end-a.beg))) ||
|
||||||
(MY_XML_OK!=my_xml_value(p,b.beg,b.end-b.beg)) ||
|
(MY_XML_OK!=my_xml_value(p,b.beg,(uint) (b.end-b.beg))) ||
|
||||||
(MY_XML_OK!=my_xml_leave(p,a.beg,a.end-a.beg)))
|
(MY_XML_OK!=my_xml_leave(p,a.beg,(uint) (a.end-a.beg))))
|
||||||
return MY_XML_ERROR;
|
return MY_XML_ERROR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -272,8 +272,8 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, uint len)
|
|||||||
}
|
}
|
||||||
else if ( (MY_XML_STRING==lex) || (MY_XML_IDENT==lex) )
|
else if ( (MY_XML_STRING==lex) || (MY_XML_IDENT==lex) )
|
||||||
{
|
{
|
||||||
if((MY_XML_OK!=my_xml_enter(p,a.beg,a.end-a.beg)) ||
|
if((MY_XML_OK!=my_xml_enter(p,a.beg,(uint) (a.end-a.beg))) ||
|
||||||
(MY_XML_OK!=my_xml_leave(p,a.beg,a.end-a.beg)))
|
(MY_XML_OK!=my_xml_leave(p,a.beg,(uint) (a.end-a.beg))))
|
||||||
return MY_XML_ERROR;
|
return MY_XML_ERROR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -321,7 +321,7 @@ gt:
|
|||||||
my_xml_norm_text(&a);
|
my_xml_norm_text(&a);
|
||||||
if (a.beg!=a.end)
|
if (a.beg!=a.end)
|
||||||
{
|
{
|
||||||
my_xml_value(p,a.beg,a.end-a.beg);
|
my_xml_value(p,a.beg,(uint) (a.end-a.beg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -384,7 +384,7 @@ uint my_xml_error_pos(MY_XML_PARSER *p)
|
|||||||
if (s[0]=='\n')
|
if (s[0]=='\n')
|
||||||
beg=s;
|
beg=s;
|
||||||
}
|
}
|
||||||
return p->cur-beg;
|
return (uint) (p->cur-beg);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint my_xml_error_lineno(MY_XML_PARSER *p)
|
uint my_xml_error_lineno(MY_XML_PARSER *p)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user