summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authoristruewing@chilla.local <>2006-12-20 15:32:02 +0100
committeristruewing@chilla.local <>2006-12-20 15:32:02 +0100
commitd9b9778e532730d8991251776513409f609352cd (patch)
treeff2566362975e320decb7048f8d122b28897bfd9 /myisam
parent1d69857c4d742f238a57205bd8426bc72a3e7332 (diff)
downloadmariadb-git-d9b9778e532730d8991251776513409f609352cd.tar.gz
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.
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_range.c1
-rw-r--r--myisam/mi_test1.c2
-rw-r--r--myisam/mi_write.c18
-rw-r--r--myisam/rt_split.c4
4 files changed, 17 insertions, 8 deletions
diff --git a/myisam/mi_range.c b/myisam/mi_range.c
index de042845d1e..4248fa7f04b 100644
--- a/myisam/mi_range.c
+++ b/myisam/mi_range.c
@@ -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);
diff --git a/myisam/mi_test1.c b/myisam/mi_test1.c
index 77c4d3dfbad..f6e1f7617d0 100644
--- a/myisam/mi_test1.c
+++ b/myisam/mi_test1.c
@@ -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':
diff --git a/myisam/mi_write.c b/myisam/mi_write.c
index 720c96b2d38..f8a5c6fa652 100644
--- a/myisam/mi_write.c
+++ b/myisam/mi_write.c
@@ -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))
diff --git a/myisam/rt_split.c b/myisam/rt_split.c
index 664dd2c75e3..87da22a93c7 100644
--- a/myisam/rt_split.c
+++ b/myisam/rt_split.c
@@ -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)
{