From eba44874ca9fc317696630cb371623142289fa99 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 19 Sep 2017 17:45:17 +0000 Subject: 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. --- sql/opt_range.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sql/opt_range.cc') diff --git a/sql/opt_range.cc b/sql/opt_range.cc index c15810ba686..f8f1d0a3efd 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1321,7 +1321,7 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT() file->ha_end_keyread(); if (free_file) { - DBUG_PRINT("info", ("Freeing separate handler 0x%lx (free: %d)", (long) file, + DBUG_PRINT("info", ("Freeing separate handler %p (free: %d)", file, free_file)); file->ha_external_lock(current_thd, F_UNLCK); file->ha_close(); @@ -1483,7 +1483,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler, in_ror_merged_scan= 1; if (reuse_handler) { - DBUG_PRINT("info", ("Reusing handler 0x%lx", (long) file)); + DBUG_PRINT("info", ("Reusing handler %p", file)); if (init()) { DBUG_RETURN(1); @@ -10217,7 +10217,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root) ulong count=count_key_part_usage(root,pos->next_key_part); if (count > pos->next_key_part->use_count) { - sql_print_information("Use_count: Wrong count for key at 0x%lx, %lu " + sql_print_information("Use_count: Wrong count for key at %p, %lu " "should be %lu", (long unsigned int)pos, pos->next_key_part->use_count, count); return; @@ -10226,7 +10226,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root) } } if (e_count != elements) - sql_print_warning("Wrong use count: %u (should be %u) for tree at 0x%lx", + sql_print_warning("Wrong use count: %u (should be %u) for tree at %p", e_count, elements, (long unsigned int) this); } #endif @@ -14612,7 +14612,7 @@ static void print_sel_tree(PARAM *param, SEL_TREE *tree, key_map *tree_map, if (!tmp.length()) tmp.append(STRING_WITH_LEN("(empty)")); - DBUG_PRINT("info", ("SEL_TREE: 0x%lx (%s) scans: %s", (long) tree, msg, + DBUG_PRINT("info", ("SEL_TREE: %p (%s) scans: %s", tree, msg, tmp.c_ptr_safe())); DBUG_VOID_RETURN; -- cgit v1.2.1