Skip to content

Commit

Permalink
Fix compiler error on gcc 6.x and most of the compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Lindström committed Apr 5, 2017
1 parent ea2695c commit 19b9fe0
Show file tree
Hide file tree
Showing 59 changed files with 41 additions and 199 deletions.
4 changes: 2 additions & 2 deletions sql/sql_class.cc
Original file line number Diff line number Diff line change
Expand Up @@ -853,11 +853,11 @@ extern "C" wsrep_ws_handle_t* wsrep_thd_ws_handle(THD *thd)
return &thd->wsrep_ws_handle;
}

extern "C"void wsrep_thd_LOCK(THD *thd)
extern "C" void wsrep_thd_LOCK(THD *thd)
{
mysql_mutex_lock(&thd->LOCK_wsrep_thd);
}
extern "C"void wsrep_thd_UNLOCK(THD *thd)
extern "C" void wsrep_thd_UNLOCK(THD *thd)
{
mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
}
Expand Down
4 changes: 2 additions & 2 deletions sql/wsrep_sst.cc
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ static int sst_donate_mysqldump (const char* addr,
"%s",
host, port, mysqld_port, mysqld_unix_port,
mysql_real_data_home, wsrep_defaults_file, uuid_str,
(long long)seqno, bypass ? " "WSREP_SST_OPT_BYPASS : "");
(long long)seqno, bypass ? " " WSREP_SST_OPT_BYPASS : "");

if (ret < 0 || ret >= cmd_len)
{
Expand Down Expand Up @@ -1023,7 +1023,7 @@ static int sst_donate_other (const char* method,
method, addr, mysqld_unix_port,
mysql_real_data_home, wsrep_defaults_file,
uuid, (long long) seqno,
bypass ? " "WSREP_SST_OPT_BYPASS : "");
bypass ? " " WSREP_SST_OPT_BYPASS : "");

if (ret < 0 || ret >= cmd_len)
{
Expand Down
1 change: 0 additions & 1 deletion storage/innobase/btr/btr0btr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2932,7 +2932,6 @@ btr_level_list_remove_func(
ulint prev_page_no;
ulint next_page_no;

ut_ad(page && mtr);
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
ut_ad(space == page_get_space_id(page));
/* Get the previous and next page numbers of page */
Expand Down
8 changes: 1 addition & 7 deletions storage/innobase/btr/btr0cur.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,6 @@ btr_cur_update_alloc_zip(
mtr_t* mtr) /*!< in: mini-transaction */
{
ut_a(page_zip == buf_block_get_page_zip(block));
ut_ad(page_zip);
ut_ad(!dict_index_is_ibuf(index));

if (page_zip_available(page_zip, dict_index_is_clust(index),
Expand Down Expand Up @@ -2837,7 +2836,7 @@ btr_cur_del_mark_set_clust_rec(
ut_ad(page_is_leaf(page_align(rec)));

#ifdef UNIV_DEBUG
if (btr_cur_print_record_ops && thr) {
if (btr_cur_print_record_ops) {
btr_cur_trx_report(thr_get_trx(thr), index, "del mark ");
rec_print_new(stderr, rec, offsets);
}
Expand Down Expand Up @@ -4128,7 +4127,6 @@ btr_cur_disown_inherited_fields(
ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(!rec_offs_comp(offsets) || !rec_get_node_ptr_flag(rec));
ut_ad(rec_offs_any_extern(offsets));
ut_ad(mtr);

for (i = 0; i < rec_offs_n_fields(offsets); i++) {
if (rec_offs_nth_extern(offsets, i)
Expand Down Expand Up @@ -4191,9 +4189,6 @@ btr_push_update_extern_fields(
ulint n;
const upd_field_t* uf;

ut_ad(tuple);
ut_ad(update);

uf = update->fields;
n = upd_get_n_fields(update);

Expand Down Expand Up @@ -4366,7 +4361,6 @@ btr_store_big_rec_extern_fields(

ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(rec_offs_any_extern(offsets));
ut_ad(btr_mtr);
ut_ad(mtr_memo_contains(btr_mtr, dict_index_get_lock(index),
MTR_MEMO_X_LOCK));
ut_ad(mtr_memo_contains(btr_mtr, rec_block, MTR_MEMO_PAGE_X_FIX));
Expand Down
1 change: 0 additions & 1 deletion storage/innobase/buf/buf0buddy.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ buf_buddy_alloc_low(
{
buf_block_t* block;

ut_ad(lru);
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(!mutex_own(&buf_pool->zip_mutex));
ut_ad(i >= buf_buddy_get_slot(PAGE_ZIP_MIN_SIZE));
Expand Down
10 changes: 5 additions & 5 deletions storage/innobase/dict/dict0crea.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ dict_create_sys_tables_tuple(
dfield = dtuple_get_nth_field(entry, 3/*TYPE*/);

ptr = mem_heap_alloc(heap, 4);
if (table->flags & (~DICT_TF_COMPACT & ~(~0 << DICT_TF_BITS))) {
if (table->flags & (~DICT_TF_COMPACT & ~(~0U << DICT_TF_BITS))) {
ut_a(table->flags & DICT_TF_COMPACT);
ut_a(dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP);
ut_a((table->flags & DICT_TF_ZSSIZE_MASK)
<= (DICT_TF_ZSSIZE_MAX << DICT_TF_ZSSIZE_SHIFT));
ut_a(!(table->flags & (~0 << DICT_TF2_BITS)));
mach_write_to_4(ptr, table->flags & ~(~0 << DICT_TF_BITS));
ut_a(!(table->flags & (~0U << DICT_TF2_BITS)));
mach_write_to_4(ptr, table->flags & ~(~0U << DICT_TF_BITS));
} else {
mach_write_to_4(ptr, DICT_TABLE_ORDINARY);
}
Expand Down Expand Up @@ -306,7 +306,7 @@ dict_build_table_def_step(
ut_ad(!dict_table_zip_size(table)
|| dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP);

flags = table->flags & ~(~0 << DICT_TF_BITS);
flags = table->flags & ~(~0U << DICT_TF_BITS);
error = fil_create_new_single_table_tablespace(
space, path_or_name, is_path,
flags == DICT_TF_COMPACT ? 0 : flags,
Expand All @@ -325,7 +325,7 @@ dict_build_table_def_step(
mtr_commit(&mtr);
} else {
/* Create in the system tablespace: disallow new features */
table->flags &= (~0 << DICT_TF_BITS) | DICT_TF_COMPACT;
table->flags &= (~0U << DICT_TF_BITS) | DICT_TF_COMPACT;
}

row = dict_create_sys_tables_tuple(table, node->heap);
Expand Down
1 change: 0 additions & 1 deletion storage/innobase/dict/dict0dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -5868,7 +5868,6 @@ dict_set_corrupted(
const char* status;
btr_cur_t cursor;

ut_ad(index);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(!dict_table_is_comp(dict_sys->sys_tables));
ut_ad(!dict_table_is_comp(dict_sys->sys_indexes));
Expand Down
10 changes: 5 additions & 5 deletions storage/innobase/dict/dict0load.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ dict_sys_tables_get_flags(
return(ULINT_UNDEFINED);
}

if (UNIV_UNLIKELY(flags & (~0 << DICT_TF_BITS))) {
if (UNIV_UNLIKELY(flags & (~0U << DICT_TF_BITS))) {
/* Some unused bits are set. */
return(ULINT_UNDEFINED);
}
Expand Down Expand Up @@ -1332,7 +1332,7 @@ dict_load_index_low(
goto err_len;
}
type = mach_read_from_4(field);
if (UNIV_UNLIKELY(type & (~0 << DICT_IT_BITS))) {
if (UNIV_UNLIKELY(type & (~0U << DICT_IT_BITS))) {
return("unknown SYS_INDEXES.TYPE bits");
}

Expand Down Expand Up @@ -1696,7 +1696,7 @@ dict_load_table_low(

flags2 = mach_read_from_4(field);

if (flags2 & (~0 << (DICT_TF2_BITS - DICT_TF2_SHIFT))) {
if (flags2 & (~0U << (DICT_TF2_BITS - DICT_TF2_SHIFT))) {
ut_print_timestamp(stderr);
fputs(" InnoDB: Warning: table ", stderr);
ut_print_filename(stderr, name);
Expand All @@ -1705,7 +1705,7 @@ dict_load_table_low(
" has unknown flags %lx.\n",
(ulong) flags2);

flags2 &= ~(~0 << (DICT_TF2_BITS - DICT_TF2_SHIFT));
flags2 &= ~(~0U << (DICT_TF2_BITS - DICT_TF2_SHIFT));
}

flags |= flags2 << DICT_TF2_SHIFT;
Expand Down Expand Up @@ -1838,7 +1838,7 @@ dict_load_table(
if (!fil_open_single_table_tablespace(
TRUE, table->space,
table->flags == DICT_TF_COMPACT ? 0 :
table->flags & ~(~0 << DICT_TF_BITS), name)) {
table->flags & ~(~0U << DICT_TF_BITS), name)) {
/* We failed to find a sensible
tablespace file */

Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/dict/dict0mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dict_mem_table_create(
DBUG_ENTER("dict_mem_table_create");

ut_ad(name);
ut_a(!(flags & (~0 << DICT_TF2_BITS)));
ut_a(!(flags & (~0U << DICT_TF2_BITS)));

heap = mem_heap_create(DICT_HEAP_SIZE);

Expand Down
1 change: 0 additions & 1 deletion storage/innobase/dyn/dyn0dyn.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dyn_array_add_block(
mem_heap_t* heap;
dyn_block_t* block;

ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);

if (arr->heap == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/fil/fil0fil.c
Original file line number Diff line number Diff line change
Expand Up @@ -3308,7 +3308,7 @@ fil_open_single_table_tablespace(
}

if (space_id != id
|| space_flags != (flags & ~(~0 << DICT_TF_BITS))) {
|| space_flags != (flags & ~(~0U << DICT_TF_BITS))) {
ut_print_timestamp(stderr);

fputs(" InnoDB: Error: tablespace id and flags in file ",
Expand Down
5 changes: 0 additions & 5 deletions storage/innobase/fsp/fsp0fsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,6 @@ fsp_fill_free_list(
ulint i;
mtr_t ibuf_mtr;

ut_ad(header && mtr);
ut_ad(page_offset(header) == FSP_HEADER_OFFSET);

/* Check if we can fill free list from above the free list limit */
Expand Down Expand Up @@ -1584,9 +1583,6 @@ fsp_alloc_free_page(
ulint page_no;
ulint space_size;

ut_ad(mtr);
ut_ad(init_mtr);

header = fsp_get_space_header(space, zip_size, mtr);

/* Get the hinted descriptor */
Expand Down Expand Up @@ -2602,7 +2598,6 @@ fseg_alloc_free_page_low(
ibool success;
ulint n;

ut_ad(mtr);
ut_ad((direction >= FSP_UP) && (direction <= FSP_NO_DIR));
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N)
== FSEG_MAGIC_N_VALUE);
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/handler/ha_innodb.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ extern "C" void wsrep_thd_set_conflict_state(

extern "C" void wsrep_thd_set_trx_to_replay(THD *thd, uint64 trx_id);

extern "C"void wsrep_thd_LOCK(THD *thd);
extern "C"void wsrep_thd_UNLOCK(THD *thd);
extern "C" void wsrep_thd_LOCK(THD *thd);
extern "C" void wsrep_thd_UNLOCK(THD *thd);
extern "C" uint32 wsrep_thd_wsrep_rand(THD *thd);
extern "C" time_t wsrep_thd_query_start(THD *thd);
extern "C" my_thread_id wsrep_thd_thread_id(THD *thd);
Expand Down
7 changes: 0 additions & 7 deletions storage/innobase/include/dict0dict.ic
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ dict_index_is_clust(
/*================*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);

return(UNIV_UNLIKELY(index->type & DICT_CLUSTERED));
Expand All @@ -261,7 +260,6 @@ dict_index_is_unique(
/*=================*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);

return(UNIV_UNLIKELY(index->type & DICT_UNIQUE));
Expand All @@ -276,7 +274,6 @@ dict_index_is_ibuf(
/*===============*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);

return(UNIV_UNLIKELY(index->type & DICT_IBUF));
Expand All @@ -293,7 +290,6 @@ dict_index_is_sec_or_ibuf(
{
ulint type;

ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);

type = index->type;
Expand All @@ -311,7 +307,6 @@ dict_table_get_n_user_cols(
/*=======================*/
const dict_table_t* table) /*!< in: table */
{
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);

return(table->n_cols - DATA_N_SYS_COLS);
Expand Down Expand Up @@ -343,7 +338,6 @@ dict_table_get_n_cols(
/*==================*/
const dict_table_t* table) /*!< in: table */
{
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);

return(table->n_cols);
Expand Down Expand Up @@ -937,7 +931,6 @@ dict_index_is_corrupted(
/*====================*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);

return(UNIV_UNLIKELY((index->type & DICT_CORRUPT)
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/include/dict0mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ combination of types */
/* @{ */
#define DICT_TF_FORMAT_SHIFT 5 /* file format */
#define DICT_TF_FORMAT_MASK \
((~(~0 << (DICT_TF_BITS - DICT_TF_FORMAT_SHIFT))) << DICT_TF_FORMAT_SHIFT)
((~(~0U << (DICT_TF_BITS - DICT_TF_FORMAT_SHIFT))) << DICT_TF_FORMAT_SHIFT)
#define DICT_TF_FORMAT_51 0 /*!< InnoDB/MySQL up to 5.1 */
#define DICT_TF_FORMAT_ZIP 1 /*!< InnoDB plugin for 5.1:
compressed tables,
Expand Down
10 changes: 0 additions & 10 deletions storage/innobase/include/dyn0dyn.ic
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ dyn_block_get_used(
/*===============*/
const dyn_block_t* block) /*!< in: dyn array block */
{
ut_ad(block);

return((block->used) & ~DYN_BLOCK_FULL_FLAG);
}

Expand All @@ -61,8 +59,6 @@ dyn_block_get_data(
/*===============*/
const dyn_block_t* block) /*!< in: dyn array block */
{
ut_ad(block);

return((byte*) block->data);
}

Expand All @@ -76,7 +72,6 @@ dyn_array_create(
dyn_array_t* arr) /*!< in/out: memory buffer of
size sizeof(dyn_array_t) */
{
ut_ad(arr);
#if DYN_ARRAY_DATA_SIZE >= DYN_BLOCK_FULL_FLAG
# error "DYN_ARRAY_DATA_SIZE >= DYN_BLOCK_FULL_FLAG"
#endif
Expand Down Expand Up @@ -119,7 +114,6 @@ dyn_array_push(
dyn_block_t* block;
ulint used;

ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
ut_ad(size <= DYN_ARRAY_DATA_SIZE);
ut_ad(size);
Expand Down Expand Up @@ -159,7 +153,6 @@ dyn_array_open(
{
dyn_block_t* block;

ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
ut_ad(size <= DYN_ARRAY_DATA_SIZE);
ut_ad(size);
Expand Down Expand Up @@ -195,7 +188,6 @@ dyn_array_close(
{
dyn_block_t* block;

ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);

block = dyn_array_get_last_block(arr);
Expand All @@ -222,7 +214,6 @@ dyn_array_get_element(
{
const dyn_block_t* block;

ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);

/* Get the first array block */
Expand Down Expand Up @@ -260,7 +251,6 @@ dyn_array_get_data_size(
const dyn_block_t* block;
ulint sum = 0;

ut_ad(arr);
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);

if (arr->heap == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/include/fsp0fsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Created 12/18/1995 Heikki Tuuri
#define FSP_FLAGS_POS_PAGE_SSIZE 6
/** 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)
/** Return the value of the PAGE_SSIZE field */
#define FSP_FLAGS_GET_PAGE_SSIZE(flags) \
Expand Down
Loading

0 comments on commit 19b9fe0

Please sign in to comment.