Skip to content

Commit 108b211

Browse files
author
Jan Lindström
committed
Fix gcc 6.3.x compiler warnings.
These are caused by fact that functions are declared with __attribute__((nonnull)) or left shit like ~0 << macro when ~0U << macro should be used.
1 parent 2e8fa1c commit 108b211

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+43
-198
lines changed

storage/innobase/btr/btr0btr.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2932,7 +2932,6 @@ btr_level_list_remove_func(
29322932
ulint prev_page_no;
29332933
ulint next_page_no;
29342934

2935-
ut_ad(page && mtr);
29362935
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
29372936
ut_ad(space == page_get_space_id(page));
29382937
/* Get the previous and next page numbers of page */

storage/innobase/btr/btr0cur.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,7 +1877,6 @@ btr_cur_update_alloc_zip(
18771877
mtr_t* mtr) /*!< in: mini-transaction */
18781878
{
18791879
ut_a(page_zip == buf_block_get_page_zip(block));
1880-
ut_ad(page_zip);
18811880
ut_ad(!dict_index_is_ibuf(index));
18821881

18831882
if (page_zip_available(page_zip, dict_index_is_clust(index),
@@ -2837,7 +2836,7 @@ btr_cur_del_mark_set_clust_rec(
28372836
ut_ad(page_is_leaf(page_align(rec)));
28382837

28392838
#ifdef UNIV_DEBUG
2840-
if (btr_cur_print_record_ops && thr) {
2839+
if (btr_cur_print_record_ops) {
28412840
btr_cur_trx_report(thr_get_trx(thr), index, "del mark ");
28422841
rec_print_new(stderr, rec, offsets);
28432842
}
@@ -4128,7 +4127,6 @@ btr_cur_disown_inherited_fields(
41284127
ut_ad(rec_offs_validate(rec, index, offsets));
41294128
ut_ad(!rec_offs_comp(offsets) || !rec_get_node_ptr_flag(rec));
41304129
ut_ad(rec_offs_any_extern(offsets));
4131-
ut_ad(mtr);
41324130

41334131
for (i = 0; i < rec_offs_n_fields(offsets); i++) {
41344132
if (rec_offs_nth_extern(offsets, i)
@@ -4191,9 +4189,6 @@ btr_push_update_extern_fields(
41914189
ulint n;
41924190
const upd_field_t* uf;
41934191

4194-
ut_ad(tuple);
4195-
ut_ad(update);
4196-
41974192
uf = update->fields;
41984193
n = upd_get_n_fields(update);
41994194

@@ -4366,7 +4361,6 @@ btr_store_big_rec_extern_fields(
43664361

43674362
ut_ad(rec_offs_validate(rec, index, offsets));
43684363
ut_ad(rec_offs_any_extern(offsets));
4369-
ut_ad(btr_mtr);
43704364
ut_ad(mtr_memo_contains(btr_mtr, dict_index_get_lock(index),
43714365
MTR_MEMO_X_LOCK));
43724366
ut_ad(mtr_memo_contains(btr_mtr, rec_block, MTR_MEMO_PAGE_X_FIX));

storage/innobase/buf/buf0buddy.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ buf_buddy_alloc_low(
276276
{
277277
buf_block_t* block;
278278

279-
ut_ad(lru);
280279
ut_ad(buf_pool_mutex_own(buf_pool));
281280
ut_ad(!mutex_own(&buf_pool->zip_mutex));
282281
ut_ad(i >= buf_buddy_get_slot(PAGE_ZIP_MIN_SIZE));

storage/innobase/dict/dict0crea.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ dict_create_sys_tables_tuple(
112112
dfield = dtuple_get_nth_field(entry, 3/*TYPE*/);
113113

114114
ptr = mem_heap_alloc(heap, 4);
115-
if (table->flags & (~DICT_TF_COMPACT & ~(~0 << DICT_TF_BITS))) {
115+
if (table->flags & (~DICT_TF_COMPACT & ~(~0U << DICT_TF_BITS))) {
116116
ut_a(table->flags & DICT_TF_COMPACT);
117117
ut_a(dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP);
118118
ut_a((table->flags & DICT_TF_ZSSIZE_MASK)
119119
<= (DICT_TF_ZSSIZE_MAX << DICT_TF_ZSSIZE_SHIFT));
120-
ut_a(!(table->flags & (~0 << DICT_TF2_BITS)));
121-
mach_write_to_4(ptr, table->flags & ~(~0 << DICT_TF_BITS));
120+
ut_a(!(table->flags & (~0U << DICT_TF2_BITS)));
121+
mach_write_to_4(ptr, table->flags & ~(~0U << DICT_TF_BITS));
122122
} else {
123123
mach_write_to_4(ptr, DICT_TABLE_ORDINARY);
124124
}
@@ -306,7 +306,7 @@ dict_build_table_def_step(
306306
ut_ad(!dict_table_zip_size(table)
307307
|| dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP);
308308

309-
flags = table->flags & ~(~0 << DICT_TF_BITS);
309+
flags = table->flags & ~(~0U << DICT_TF_BITS);
310310
error = fil_create_new_single_table_tablespace(
311311
space, path_or_name, is_path,
312312
flags == DICT_TF_COMPACT ? 0 : flags,
@@ -325,7 +325,7 @@ dict_build_table_def_step(
325325
mtr_commit(&mtr);
326326
} else {
327327
/* Create in the system tablespace: disallow new features */
328-
table->flags &= (~0 << DICT_TF_BITS) | DICT_TF_COMPACT;
328+
table->flags &= (~0U << DICT_TF_BITS) | DICT_TF_COMPACT;
329329
}
330330

331331
row = dict_create_sys_tables_tuple(table, node->heap);

storage/innobase/dict/dict0dict.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5848,7 +5848,6 @@ dict_set_corrupted(
58485848
const char* status;
58495849
btr_cur_t cursor;
58505850

5851-
ut_ad(index);
58525851
ut_ad(mutex_own(&dict_sys->mutex));
58535852
ut_ad(!dict_table_is_comp(dict_sys->sys_tables));
58545853
ut_ad(!dict_table_is_comp(dict_sys->sys_indexes));

storage/innobase/dict/dict0load.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ dict_sys_tables_get_flags(
643643
return(ULINT_UNDEFINED);
644644
}
645645

646-
if (UNIV_UNLIKELY(flags & (~0 << DICT_TF_BITS))) {
646+
if (UNIV_UNLIKELY(flags & (~0U << DICT_TF_BITS))) {
647647
/* Some unused bits are set. */
648648
return(ULINT_UNDEFINED);
649649
}
@@ -1332,7 +1332,7 @@ dict_load_index_low(
13321332
goto err_len;
13331333
}
13341334
type = mach_read_from_4(field);
1335-
if (UNIV_UNLIKELY(type & (~0 << DICT_IT_BITS))) {
1335+
if (UNIV_UNLIKELY(type & (~0U << DICT_IT_BITS))) {
13361336
return("unknown SYS_INDEXES.TYPE bits");
13371337
}
13381338

@@ -1696,7 +1696,7 @@ dict_load_table_low(
16961696

16971697
flags2 = mach_read_from_4(field);
16981698

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

1708-
flags2 &= ~(~0 << (DICT_TF2_BITS - DICT_TF2_SHIFT));
1708+
flags2 &= ~(~0U << (DICT_TF2_BITS - DICT_TF2_SHIFT));
17091709
}
17101710

17111711
flags |= flags2 << DICT_TF2_SHIFT;

storage/innobase/dict/dict0mem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ dict_mem_table_create(
6969
DBUG_ENTER("dict_mem_table_create");
7070

7171
ut_ad(name);
72-
ut_a(!(flags & (~0 << DICT_TF2_BITS)));
72+
ut_a(!(flags & (~0U << DICT_TF2_BITS)));
7373

7474
heap = mem_heap_create(DICT_HEAP_SIZE);
7575

storage/innobase/dyn/dyn0dyn.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ dyn_array_add_block(
4040
mem_heap_t* heap;
4141
dyn_block_t* block;
4242

43-
ut_ad(arr);
4443
ut_ad(arr->magic_n == DYN_BLOCK_MAGIC_N);
4544

4645
if (arr->heap == NULL) {

storage/innobase/fil/fil0fil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3308,7 +3308,7 @@ fil_open_single_table_tablespace(
33083308
}
33093309

33103310
if (space_id != id
3311-
|| space_flags != (flags & ~(~0 << DICT_TF_BITS))) {
3311+
|| space_flags != (flags & ~(~0U << DICT_TF_BITS))) {
33123312
ut_print_timestamp(stderr);
33133313

33143314
fputs(" InnoDB: Error: tablespace id and flags in file ",

storage/innobase/fsp/fsp0fsp.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,6 @@ fsp_fill_free_list(
12851285
ulint i;
12861286
mtr_t ibuf_mtr;
12871287

1288-
ut_ad(header && mtr);
12891288
ut_ad(page_offset(header) == FSP_HEADER_OFFSET);
12901289

12911290
/* Check if we can fill free list from above the free list limit */
@@ -1584,9 +1583,6 @@ fsp_alloc_free_page(
15841583
ulint page_no;
15851584
ulint space_size;
15861585

1587-
ut_ad(mtr);
1588-
ut_ad(init_mtr);
1589-
15901586
header = fsp_get_space_header(space, zip_size, mtr);
15911587

15921588
/* Get the hinted descriptor */
@@ -2602,7 +2598,6 @@ fseg_alloc_free_page_low(
26022598
ibool success;
26032599
ulint n;
26042600

2605-
ut_ad(mtr);
26062601
ut_ad((direction >= FSP_UP) && (direction <= FSP_NO_DIR));
26072602
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N)
26082603
== FSEG_MAGIC_N_VALUE);

0 commit comments

Comments
 (0)