diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2017-09-19 17:45:17 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2017-09-28 17:20:46 +0000 |
commit | eba44874ca9fc317696630cb371623142289fa99 (patch) | |
tree | f67cd5dbcaf102abef2fb26f76357d14feaded04 /storage/myisam | |
parent | de7c2e5e545df90fc9814c60a8a5a8d20f22b2c3 (diff) | |
download | mariadb-git-eba44874ca9fc317696630cb371623142289fa99.tar.gz |
MDEV-13844 : Fix Windows warnings. Fix DBUG_PRINT.
- Fix win64 pointer truncation warnings
(usually coming from misusing 0x%lx and long cast in DBUG)
- Also fix printf-format warnings
Make the above mentioned warnings fatal.
- fix pthread_join on Windows to set return value.
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/ha_myisam.cc | 4 | ||||
-rw-r--r-- | storage/myisam/mi_check.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_close.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_delete.c | 14 | ||||
-rw-r--r-- | storage/myisam/mi_dynrec.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_rkey.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_search.c | 50 | ||||
-rw-r--r-- | storage/myisam/mi_write.c | 14 |
8 files changed, 49 insertions, 49 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 20bb672868d..69301390003 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -340,8 +340,8 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out, } } } - DBUG_PRINT("loop", ("found: 0x%lx recpos: %d minpos: %d length: %d", - (long) found, recpos, minpos, length)); + DBUG_PRINT("loop", ("found: %p recpos: %d minpos: %d length: %d", + found, recpos, minpos, length)); if (recpos != minpos) { /* reserve space for null bits */ diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 71ab372f2aa..8fd2bf74ccb 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -2916,8 +2916,8 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info, */ sort_param[i].read_cache= ((rep_quick || !i) ? param->read_cache : new_data_cache); - DBUG_PRINT("io_cache_share", ("thread: %u read_cache: 0x%lx", - i, (long) &sort_param[i].read_cache)); + DBUG_PRINT("io_cache_share", ("thread: %u read_cache: %p", + i, &sort_param[i].read_cache)); /* two approaches: the same amount of memory for each thread diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c index f0a82bcef04..ad1d3074a27 100644 --- a/storage/myisam/mi_close.c +++ b/storage/myisam/mi_close.c @@ -27,8 +27,8 @@ int mi_close(register MI_INFO *info) int error=0,flag; MYISAM_SHARE *share=info->s; DBUG_ENTER("mi_close"); - DBUG_PRINT("enter",("base: 0x%lx reopen: %u locks: %u", - (long) info, (uint) share->reopen, + DBUG_PRINT("enter",("base: %p reopen: %u locks: %u", + info, (uint) share->reopen, (uint) share->tot_locks)); if (info->open_list.data) diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c index 99185844b72..92b368d92dc 100644 --- a/storage/myisam/mi_delete.c +++ b/storage/myisam/mi_delete.c @@ -410,8 +410,8 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key, MYISAM_SHARE *share=info->s; MI_KEY_PARAM s_temp; DBUG_ENTER("del"); - DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx", (long) leaf_page, - (ulong) keypos)); + DBUG_PRINT("enter",("leaf_page: %lld keypos: %p", leaf_page, + keypos)); DBUG_DUMP("leaf_buff",(uchar*) leaf_buff,mi_getint(leaf_buff)); endpos=leaf_buff+mi_getint(leaf_buff); @@ -516,8 +516,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo, MI_KEY_PARAM s_temp; MYISAM_SHARE *share=info->s; DBUG_ENTER("underflow"); - DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx",(long) leaf_page, - (ulong) keypos)); + DBUG_PRINT("enter",("leaf_page: %lld keypos: %p",leaf_page, + keypos)); DBUG_DUMP("anc_buff",(uchar*) anc_buff,mi_getint(anc_buff)); DBUG_DUMP("leaf_buff",(uchar*) leaf_buff,mi_getint(leaf_buff)); @@ -597,8 +597,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo, else { /* Page is full */ endpos=anc_buff+anc_length; - DBUG_PRINT("test",("anc_buff: 0x%lx endpos: 0x%lx", - (long) anc_buff, (long) endpos)); + DBUG_PRINT("test",("anc_buff: %p endpos: %p", + anc_buff, endpos)); if (keypos != anc_buff+2+key_reflength && !_mi_get_last_key(info,keyinfo,anc_buff,anc_key,keypos,&length)) goto err; @@ -776,7 +776,7 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag, int s_length; uchar *start; DBUG_ENTER("remove_key"); - DBUG_PRINT("enter",("keypos: 0x%lx page_end: 0x%lx",(long) keypos, (long) page_end)); + DBUG_PRINT("enter",("keypos: %p page_end: %p",keypos, page_end)); start=keypos; if (!(keyinfo->flag & diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index 5241d72014c..c4baca3d89f 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -1344,8 +1344,8 @@ ulong _mi_rec_unpack(register MI_INFO *info, register uchar *to, uchar *from, err: my_errno= HA_ERR_WRONG_IN_RECORD; - DBUG_PRINT("error",("to_end: 0x%lx -> 0x%lx from_end: 0x%lx -> 0x%lx", - (long) to, (long) to_end, (long) from, (long) from_end)); + DBUG_PRINT("error",("to_end: %p -> %p from_end: %p -> %p", + to, to_end, from, from_end)); DBUG_DUMP("from",(uchar*) info->rec_buff,info->s->base.min_pack_length); DBUG_RETURN(MY_FILE_ERROR); } /* _mi_rec_unpack */ diff --git a/storage/myisam/mi_rkey.c b/storage/myisam/mi_rkey.c index b70922b0505..1dddb8b49ad 100644 --- a/storage/myisam/mi_rkey.c +++ b/storage/myisam/mi_rkey.c @@ -32,8 +32,8 @@ int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key, uint pack_key_length, use_key_length, nextflag; ICP_RESULT res= ICP_NO_MATCH; DBUG_ENTER("mi_rkey"); - DBUG_PRINT("enter", ("base: 0x%lx buf: 0x%lx inx: %d search_flag: %d", - (long) info, (long) buf, inx, search_flag)); + DBUG_PRINT("enter", ("base: %p buf: %p inx: %d search_flag: %d", + info, buf, inx, search_flag)); if ((inx = _mi_check_index(info,inx)) < 0) DBUG_RETURN(my_errno); diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c index 60a34c641ad..79ed846ce7e 100644 --- a/storage/myisam/mi_search.c +++ b/storage/myisam/mi_search.c @@ -267,8 +267,8 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, mi_print_error(info->s, HA_ERR_CRASHED); my_errno=HA_ERR_CRASHED; DBUG_PRINT("error", - ("Found wrong key: length: %u page: 0x%lx end: 0x%lx", - length, (long) page, (long) end)); + ("Found wrong key: length: %u page: %p end: %p", + length, page, end)); DBUG_RETURN(MI_FOUND_WRONG_KEY); } if ((flag=ha_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag, @@ -284,7 +284,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, if (flag == 0) memcpy(buff,t_buff,length); /* Result is first key */ *last_key= page == end; - DBUG_PRINT("exit",("flag: %d ret_pos: 0x%lx", flag, (long) *ret_pos)); + DBUG_PRINT("exit",("flag: %d ret_pos: %p", flag, *ret_pos)); DBUG_RETURN(flag); } /* _mi_seq_search */ @@ -419,8 +419,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, mi_print_error(info->s, HA_ERR_CRASHED); my_errno=HA_ERR_CRASHED; DBUG_PRINT("error", - ("Found wrong key: length: %u page: 0x%lx end: %lx", - length, (long) page, (long) end)); + ("Found wrong key: length: %u page: %p end: %p", + length, page, end)); DBUG_RETURN(MI_FOUND_WRONG_KEY); } @@ -554,7 +554,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, *last_key= page == end; - DBUG_PRINT("exit",("flag: %d ret_pos: 0x%lx", flag, (long) *ret_pos)); + DBUG_PRINT("exit",("flag: %d ret_pos: %p", flag, *ret_pos)); DBUG_RETURN(flag); } /* _mi_prefix_search */ @@ -816,8 +816,8 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, if (length > keyseg->length) { DBUG_PRINT("error", - ("Found too long null packed key: %u of %u at 0x%lx", - length, keyseg->length, (long) *page_pos)); + ("Found too long null packed key: %u of %u at %p", + length, keyseg->length, *page_pos)); DBUG_DUMP("key", *page_pos, 16); mi_print_error(keyinfo->share, HA_ERR_CRASHED); my_errno=HA_ERR_CRASHED; @@ -873,8 +873,8 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, } if (length > (uint) keyseg->length) { - DBUG_PRINT("error",("Found too long packed key: %u of %u at 0x%lx", - length, keyseg->length, (long) *page_pos)); + DBUG_PRINT("error",("Found too long packed key: %u of %u at %p", + length, keyseg->length, *page_pos)); DBUG_DUMP("key", *page_pos, 16); mi_print_error(keyinfo->share, HA_ERR_CRASHED); my_errno=HA_ERR_CRASHED; @@ -945,8 +945,8 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, if (length > keyinfo->maxlength) { DBUG_PRINT("error", - ("Found too long binary packed key: %u of %u at 0x%lx", - length, keyinfo->maxlength, (long) *page_pos)); + ("Found too long binary packed key: %u of %u at %p", + length, keyinfo->maxlength, *page_pos)); DBUG_DUMP("key", *page_pos, 16); goto crashed; /* Wrong key */ } @@ -1003,8 +1003,8 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, length-=tmp; from=page; from_end=page_end; } - DBUG_PRINT("info",("key: 0x%lx from: 0x%lx length: %u", - (long) key, (long) from, length)); + DBUG_PRINT("info",("key: %p from: %p length: %u", + key, from, length)); memmove((uchar*) key, (uchar*) from, (size_t) length); key+=length; from+=length; @@ -1077,7 +1077,7 @@ uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, } } } - DBUG_PRINT("exit",("page: 0x%lx length: %u", (long) page, + DBUG_PRINT("exit",("page: %p length: %u", page, *return_key_length)); DBUG_RETURN(page); } /* _mi_get_key */ @@ -1130,8 +1130,8 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uint nod_flag; uchar *lastpos; DBUG_ENTER("_mi_get_last_key"); - DBUG_PRINT("enter",("page: 0x%lx endpos: 0x%lx", (long) page, - (long) endpos)); + DBUG_PRINT("enter",("page:%p endpos: %p", page, + endpos)); nod_flag=mi_test_if_nod(page); if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) @@ -1151,15 +1151,15 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, *return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,lastkey); if (*return_key_length == 0) { - DBUG_PRINT("error",("Couldn't find last key: page: 0x%lx", - (long) page)); + DBUG_PRINT("error",("Couldn't find last key: page: %p", + page)); mi_print_error(info->s, HA_ERR_CRASHED); my_errno=HA_ERR_CRASHED; DBUG_RETURN(0); } } } - DBUG_PRINT("exit",("lastpos: 0x%lx length: %u", (long) lastpos, + DBUG_PRINT("exit",("lastpos: %p length: %u", lastpos, *return_key_length)); DBUG_RETURN(lastpos); } /* _mi_get_last_key */ @@ -1245,9 +1245,9 @@ int _mi_search_next(register MI_INFO *info, register MI_KEYDEF *keyinfo, uint nod_flag; uchar lastkey[HA_MAX_KEY_BUFF]; DBUG_ENTER("_mi_search_next"); - DBUG_PRINT("enter",("nextflag: %u lastpos: %lu int_keypos: %lu", - nextflag, (ulong) info->lastpos, - (ulong) info->int_keypos)); + DBUG_PRINT("enter",("nextflag: %u lastpos: %llu int_keypos: %p", + nextflag, info->lastpos, + info->int_keypos)); DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,key_length);); /* Force full read if we are at last key or if we are not on a leaf @@ -1697,8 +1697,8 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, ref_length=0; next_length_pack=0; } - DBUG_PRINT("test",("length: %d next_key: 0x%lx", length, - (long) next_key)); + DBUG_PRINT("test",("length: %d next_key: %p", length, + next_key)); { uint tmp_length; diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c index ff12f335af1..3ba25d84e62 100644 --- a/storage/myisam/mi_write.c +++ b/storage/myisam/mi_write.c @@ -471,7 +471,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: 0x%lx", (long) key_pos)); + DBUG_PRINT("enter",("key_pos: %p", key_pos)); DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,USE_WHOLE_KEY);); nod_flag=mi_test_if_nod(anc_buff); @@ -492,8 +492,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: 0x%lx", - s_temp.n_ref_length,s_temp.n_length, (long) s_temp.key)); + DBUG_PRINT("test",("n_ref_len: %d n_length: %d key_pos: %p", + s_temp.n_ref_length,s_temp.n_length, s_temp.key)); } #endif if (t_length > 0) @@ -693,8 +693,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: 0x%lx page: 0x%lx half: 0x%lx", - (long) lastpos, (long) page, (long) end)); + DBUG_PRINT("exit",("returns: %p page: %p half: %p", + lastpos, page, end)); DBUG_RETURN(lastpos); } /* _mi_find_half_pos */ @@ -750,8 +750,8 @@ static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page, *return_key_length=last_length; *after_key=lastpos; - DBUG_PRINT("exit",("returns: 0x%lx page: 0x%lx end: 0x%lx", - (long) prevpos,(long) page,(long) end)); + DBUG_PRINT("exit",("returns: %p page: %p end: %p", + prevpos, page, end)); DBUG_RETURN(prevpos); } /* _mi_find_last_pos */ |