Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Bug#21803314: FIX NEW COMPILATION ERRORS AND WARNINGS WITH CLANG 3.7
Browse files Browse the repository at this point in the history
Fix a number of new errors and warnings reported by Clang 3.7:
-Wconditional-uninitialized and -Wshift-negative-value.
  • Loading branch information
jhauglid committed Sep 11, 2015
1 parent d048c0f commit 2ffd667
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions libmysql/libmysql.c
Expand Up @@ -1092,8 +1092,8 @@ my_bool STDCALL mysql_embedded(void)

void my_net_local_init(NET *net)
{
ulong local_net_buffer_length;
ulong local_max_allowed_packet;
ulong local_net_buffer_length= 0;
ulong local_max_allowed_packet= 0;

(void) mysql_get_option(NULL, MYSQL_OPT_MAX_ALLOWED_PACKET,
&local_max_allowed_packet);
Expand Down
1 change: 1 addition & 0 deletions mysys/my_copy.c
Expand Up @@ -57,6 +57,7 @@ int my_copy(const char *from, const char *to, myf MyFlags)
DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));

from_file=to_file= -1;
memset(&new_stat_buff, 0, sizeof(MY_STAT));
DBUG_ASSERT(!(MyFlags & (MY_FNABP | MY_NABP))); /* for my_read/my_write */
if (MyFlags & MY_HOLD_ORIGINAL_MODES) /* Copy stat if possible */
new_file_stat= MY_TEST(my_stat((char*) to, &new_stat_buff, MYF(0)));
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/dict/dict0load.cc
Expand Up @@ -2354,7 +2354,7 @@ dict_load_index_low(
goto err_len;
}
type = mach_read_from_4(field);
if (type & (~0 << DICT_IT_BITS)) {
if (type & (~0U << DICT_IT_BITS)) {
return("unknown SYS_INDEXES.TYPE bits");
}

Expand Down
12 changes: 6 additions & 6 deletions storage/innobase/include/dict0mem.h
Expand Up @@ -171,23 +171,23 @@ to open the table and allows InnoDB to quickly find the tablespace. */

/** Bit mask of the COMPACT field */
#define DICT_TF_MASK_COMPACT \
((~(~0 << DICT_TF_WIDTH_COMPACT)) \
((~(~0U << DICT_TF_WIDTH_COMPACT)) \
<< DICT_TF_POS_COMPACT)
/** Bit mask of the ZIP_SSIZE field */
#define DICT_TF_MASK_ZIP_SSIZE \
((~(~0 << DICT_TF_WIDTH_ZIP_SSIZE)) \
((~(~0U << DICT_TF_WIDTH_ZIP_SSIZE)) \
<< DICT_TF_POS_ZIP_SSIZE)
/** Bit mask of the ATOMIC_BLOBS field */
#define DICT_TF_MASK_ATOMIC_BLOBS \
((~(~0 << DICT_TF_WIDTH_ATOMIC_BLOBS)) \
((~(~0U << DICT_TF_WIDTH_ATOMIC_BLOBS)) \
<< DICT_TF_POS_ATOMIC_BLOBS)
/** Bit mask of the DATA_DIR field */
#define DICT_TF_MASK_DATA_DIR \
((~(~0 << DICT_TF_WIDTH_DATA_DIR)) \
((~(~0U << DICT_TF_WIDTH_DATA_DIR)) \
<< DICT_TF_POS_DATA_DIR)
/** Bit mask of the SHARED_SPACE field */
#define DICT_TF_MASK_SHARED_SPACE \
((~(~0 << DICT_TF_WIDTH_SHARED_SPACE)) \
((~(~0U << DICT_TF_WIDTH_SHARED_SPACE)) \
<< DICT_TF_POS_SHARED_SPACE)

/** Return the value of the COMPACT field */
Expand Down Expand Up @@ -225,7 +225,7 @@ for unknown bits in order to protect backward incompatibility. */
/* @{ */
/** Total number of bits in table->flags2. */
#define DICT_TF2_BITS 8
#define DICT_TF2_UNUSED_BIT_MASK (~0 << DICT_TF2_BITS)
#define DICT_TF2_UNUSED_BIT_MASK (~0U << DICT_TF2_BITS)
#define DICT_TF2_BIT_MASK ~DICT_TF2_UNUSED_BIT_MASK

/** TEMPORARY; TRUE for tables from CREATE TEMPORARY TABLE. */
Expand Down
14 changes: 7 additions & 7 deletions storage/innobase/include/fsp0types.h
Expand Up @@ -286,31 +286,31 @@ it is for a single client and should be deleted upon startup if it exists. */

/** Bit mask of the POST_ANTELOPE field */
#define FSP_FLAGS_MASK_POST_ANTELOPE \
((~(~0 << FSP_FLAGS_WIDTH_POST_ANTELOPE)) \
((~(~0U << FSP_FLAGS_WIDTH_POST_ANTELOPE)) \
<< FSP_FLAGS_POS_POST_ANTELOPE)
/** Bit mask of the ZIP_SSIZE field */
#define FSP_FLAGS_MASK_ZIP_SSIZE \
((~(~0 << FSP_FLAGS_WIDTH_ZIP_SSIZE)) \
((~(~0U << FSP_FLAGS_WIDTH_ZIP_SSIZE)) \
<< FSP_FLAGS_POS_ZIP_SSIZE)
/** Bit mask of the ATOMIC_BLOBS field */
#define FSP_FLAGS_MASK_ATOMIC_BLOBS \
((~(~0 << FSP_FLAGS_WIDTH_ATOMIC_BLOBS)) \
((~(~0U << FSP_FLAGS_WIDTH_ATOMIC_BLOBS)) \
<< FSP_FLAGS_POS_ATOMIC_BLOBS)
/** Bit mask of the PAGE_SSIZE field */
#define FSP_FLAGS_MASK_PAGE_SSIZE \
((~(~0 << FSP_FLAGS_WIDTH_PAGE_SSIZE)) \
((~(~0U << FSP_FLAGS_WIDTH_PAGE_SSIZE)) \
<< FSP_FLAGS_POS_PAGE_SSIZE)
/** Bit mask of the DATA_DIR field */
#define FSP_FLAGS_MASK_DATA_DIR \
((~(~0 << FSP_FLAGS_WIDTH_DATA_DIR)) \
((~(~0U << FSP_FLAGS_WIDTH_DATA_DIR)) \
<< FSP_FLAGS_POS_DATA_DIR)
/** Bit mask of the SHARED field */
#define FSP_FLAGS_MASK_SHARED \
((~(~0 << FSP_FLAGS_WIDTH_SHARED)) \
((~(~0U << FSP_FLAGS_WIDTH_SHARED)) \
<< FSP_FLAGS_POS_SHARED)
/** Bit mask of the TEMPORARY field */
#define FSP_FLAGS_MASK_TEMPORARY \
((~(~0 << FSP_FLAGS_WIDTH_TEMPORARY)) \
((~(~0U << FSP_FLAGS_WIDTH_TEMPORARY)) \
<< FSP_FLAGS_POS_TEMPORARY)

/** Return the value of the POST_ANTELOPE field */
Expand Down
1 change: 1 addition & 0 deletions storage/myisam/mi_check.c
Expand Up @@ -2644,6 +2644,7 @@ int mi_repair_parallel(MI_CHECK *param, MI_INFO *info,
int error;
DBUG_ENTER("mi_repair_parallel");

memset(&new_data_cache, 0, sizeof(IO_CACHE));
start_records=info->state->records;
got_error=1;
new_file= -1;
Expand Down
8 changes: 4 additions & 4 deletions testclients/mysql_client_test.c
Expand Up @@ -20475,10 +20475,10 @@ static void test_bug20821550()
int ret_val;
ulong max_allowed_packet_value= 8192*2;
ulong net_buffer_length_value= 8192*4;
ulong save_max_allowed_packet_value;
ulong save_net_buffer_length_value;
ulong ret_max_allowed_packet_value;
ulong ret_net_buffer_length_value;
ulong save_max_allowed_packet_value= 0;
ulong save_net_buffer_length_value= 0;
ulong ret_max_allowed_packet_value= 0;
ulong ret_net_buffer_length_value= 0;

myheader("test_bug20821550");

Expand Down

0 comments on commit 2ffd667

Please sign in to comment.