Bug#25213 - Compiler warnings in MyISAM code

Compiler warnings due to non-matching conversion
specifications in format strings in DBUG_PRINT calls,
due to non-used parameters (in non-debug mode), and
due to seemingly uninitialized variables.

Initialized variables, declared parameters unused, and
casted DBUG_PRINT arguments to get rid of warnings.
parent 1d69857c
......@@ -171,6 +171,7 @@ static double _mi_search_pos(register MI_INFO *info,
uchar *keypos,*buff;
double offset;
DBUG_ENTER("_mi_search_pos");
LINT_INIT(max_keynr);
if (pos == HA_OFFSET_ERROR)
DBUG_RETURN(0.5);
......
......@@ -562,7 +562,7 @@ static struct my_option my_long_options[] =
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
char *argument __attribute__((unused)))
{
switch(optid) {
case 'a':
......
......@@ -331,7 +331,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
my_bool was_last_key;
my_off_t next_page, dupp_key_pos;
DBUG_ENTER("w_search");
DBUG_PRINT("enter",("page: %ld",page));
DBUG_PRINT("enter",("page: %ld", (long) page));
search_key_length= (comp_flag & SEARCH_FIND) ? key_length : USE_WHOLE_KEY;
if (!(temp_buff= (uchar*) my_alloca((uint) keyinfo->block_length+
......@@ -453,7 +453,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
uchar *endpos, *prev_key;
MI_KEY_PARAM s_temp;
DBUG_ENTER("_mi_insert");
DBUG_PRINT("enter",("key_pos: %lx",key_pos));
DBUG_PRINT("enter",("key_pos: %lx", (ulong) key_pos));
DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,USE_WHOLE_KEY););
nod_flag=mi_test_if_nod(anc_buff);
......@@ -475,7 +475,8 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
DBUG_PRINT("test",("t_length: %d ref_len: %d",
t_length,s_temp.ref_length));
DBUG_PRINT("test",("n_ref_len: %d n_length: %d key_pos: %lx",
s_temp.n_ref_length,s_temp.n_length,s_temp.key));
s_temp.n_ref_length, s_temp.n_length,
(ulong) s_temp.key));
}
#endif
if (t_length > 0)
......@@ -572,6 +573,7 @@ int _mi_split_page(register MI_INFO *info, register MI_KEYDEF *keyinfo,
my_off_t new_pos;
MI_KEY_PARAM s_temp;
DBUG_ENTER("mi_split_page");
LINT_INIT(after_key);
DBUG_DUMP("buff",(byte*) buff,mi_getint(buff));
if (info->s->keyinfo+info->lastinx == keyinfo)
......@@ -664,7 +666,8 @@ uchar *_mi_find_half_pos(uint nod_flag, MI_KEYDEF *keyinfo, uchar *page,
} while (page < end);
*return_key_length=length;
*after_key=page;
DBUG_PRINT("exit",("returns: %lx page: %lx half: %lx",lastpos,page,end));
DBUG_PRINT("exit",("returns: %lx page: %lx half: %lx",
(ulong) lastpos, (ulong) page, (ulong) end));
DBUG_RETURN(lastpos);
} /* _mi_find_half_pos */
......@@ -718,7 +721,8 @@ static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page,
}
*return_key_length=last_length;
*after_key=lastpos;
DBUG_PRINT("exit",("returns: %lx page: %lx end: %lx",prevpos,page,end));
DBUG_PRINT("exit",("returns: %lx page: %lx end: %lx",
(ulong) prevpos, (ulong) page, (ulong) end));
DBUG_RETURN(prevpos);
} /* _mi_find_last_pos */
......@@ -754,7 +758,7 @@ static int _mi_balance_page(register MI_INFO *info, MI_KEYDEF *keyinfo,
next_page= _mi_kpos(info->s->base.key_reflength,
father_key_pos+father_keylength);
buff=info->buff;
DBUG_PRINT("test",("use right page: %lu",next_page));
DBUG_PRINT("test",("use right page: %lu", (ulong) next_page));
}
else
{
......@@ -763,7 +767,7 @@ static int _mi_balance_page(register MI_INFO *info, MI_KEYDEF *keyinfo,
next_page= _mi_kpos(info->s->base.key_reflength,father_key_pos);
/* Fix that curr_buff is to left */
buff=curr_buff; curr_buff=info->buff;
DBUG_PRINT("test",("use left page: %lu",next_page));
DBUG_PRINT("test",("use left page: %lu", (ulong) next_page));
} /* father_key_pos ptr to parting key */
if (!_mi_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,info->buff,0))
......
......@@ -188,6 +188,10 @@ static int split_rtree_node(SplitStruct *node, int n_entries,
int next_node;
int i;
SplitStruct *end = node + n_entries;
LINT_INIT(a);
LINT_INIT(b);
LINT_INIT(next);
LINT_INIT(next_node);
if (all_size < min_size * 2)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment