diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-10-29 20:40:03 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-10-29 20:40:03 +0200 |
commit | 3794110f0215f0631107c2694dc0f1675a4bb520 (patch) | |
tree | 3400a806088335fffbb0c567d5ee7f40ca9a90ce /storage | |
parent | 949027f7c7b8704f2a329c85b8725af5158f3ade (diff) | |
download | mariadb-git-3794110f0215f0631107c2694dc0f1675a4bb520.tar.gz |
fix the build and compiler warnings (few of which were real bugs)
for "cmake ." builds
Diffstat (limited to 'storage')
-rw-r--r-- | storage/maria/ma_bitmap.c | 9 | ||||
-rw-r--r-- | storage/maria/ma_blockrec.c | 13 | ||||
-rw-r--r-- | storage/maria/ma_check.c | 13 | ||||
-rw-r--r-- | storage/maria/ma_checkpoint.c | 10 | ||||
-rw-r--r-- | storage/maria/ma_create.c | 4 | ||||
-rw-r--r-- | storage/maria/ma_dynrec.c | 9 | ||||
-rw-r--r-- | storage/maria/ma_ft_boolean_search.c | 3 | ||||
-rw-r--r-- | storage/maria/ma_loghandler.c | 13 | ||||
-rw-r--r-- | storage/maria/ma_packrec.c | 3 | ||||
-rw-r--r-- | storage/maria/ma_recovery.c | 3 | ||||
-rw-r--r-- | storage/maria/ma_search.c | 18 | ||||
-rw-r--r-- | storage/maria/ma_sort.c | 6 | ||||
-rw-r--r-- | storage/myisam/mi_create.c | 4 |
13 files changed, 29 insertions, 79 deletions
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c index c2cf7d32d48..483a7dd5c12 100644 --- a/storage/maria/ma_bitmap.c +++ b/storage/maria/ma_bitmap.c @@ -1415,17 +1415,12 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap, uchar *page_end= data + bitmap->total_size; uchar *best_data= 0; uint min_size; - uint best_area_size, best_prefix_area_size, best_suffix_area_size; + uint best_area_size, UNINIT_VAR(best_prefix_area_size), best_suffix_area_size; uint page, size; - ulonglong best_prefix_bits; + ulonglong UNINIT_VAR(best_prefix_bits); DBUG_ENTER("allocate_full_pages"); DBUG_PRINT("enter", ("pages_needed: %lu", pages_needed)); - /* Following variables are only used if best_data is set */ - LINT_INIT(best_prefix_bits); - LINT_INIT(best_prefix_area_size); - LINT_INIT(best_suffix_area_size); - min_size= pages_needed; if (!full_page && min_size > BLOB_SEGMENT_MIN_SIZE) min_size= BLOB_SEGMENT_MIN_SIZE; diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 669dbe84fdc..2d2a770ba82 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -2596,7 +2596,7 @@ static my_bool write_block_record(MARIA_HA *info, ha_checksum old_record_checksum) { uchar *data, *end_of_data, *tmp_data_used, *tmp_data; - uchar *row_extents_first_part, *row_extents_second_part; + uchar *UNINIT_VAR(row_extents_first_part), *UNINIT_VAR(row_extents_second_part); uchar *field_length_data; uchar *page_buff; MARIA_BITMAP_BLOCK *block, *head_block; @@ -2611,9 +2611,6 @@ static my_bool write_block_record(MARIA_HA *info, uint save_my_errno; DBUG_ENTER("write_block_record"); - LINT_INIT(row_extents_first_part); - LINT_INIT(row_extents_second_part); - head_block= bitmap_blocks->block; block_size= share->block_size; @@ -4672,7 +4669,7 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record, uchar *data, uchar *end_of_data) { MARIA_SHARE *share= info->s; - uchar *field_length_data, *blob_buffer, *start_of_data; + uchar *UNINIT_VAR(field_length_data), *blob_buffer, *start_of_data; uint flag, null_bytes, cur_null_bytes, row_extents, field_lengths; my_bool found_blob= 0; MARIA_EXTENT_CURSOR extent; @@ -4680,9 +4677,6 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record, MARIA_ROW *cur_row= &info->cur_row; DBUG_ENTER("_ma_read_block_record2"); - LINT_INIT(field_length_data); - LINT_INIT(blob_buffer); - start_of_data= data; flag= (uint) (uchar) data[0]; cur_null_bytes= share->base.original_null_bytes; @@ -7213,11 +7207,10 @@ my_bool _ma_apply_undo_row_update(MARIA_HA *info, LSN undo_lsn, const uchar *field_length_data, *field_length_data_end, *extent_info; uchar *current_record, *orig_record; pgcache_page_no_t page; - ha_checksum checksum_delta; + ha_checksum UNINIT_VAR(checksum_delta); uint rownr, field_length_header, extent_count, length_on_head_page; int error; DBUG_ENTER("_ma_apply_undo_row_update"); - LINT_INIT(checksum_delta); page= page_korr(header); header+= PAGE_STORE_SIZE; diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index e183e715a6e..7f686c28532 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -192,12 +192,10 @@ int maria_chk_del(HA_CHECK *param, register MARIA_HA *info, MARIA_SHARE *share= info->s; reg2 ha_rows i; uint delete_link_length; - my_off_t empty,next_link,old_link; + my_off_t empty,next_link,UNINIT_VAR(old_link); char buff[22],buff2[22]; DBUG_ENTER("maria_chk_del"); - LINT_INIT(old_link); - param->record_checksum=0; if (share->data_file_type == BLOCK_RECORD) @@ -3652,13 +3650,12 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info, double *rec_per_key_part; char llbuff[22]; MARIA_SORT_INFO sort_info; - ulonglong key_map; + ulonglong UNINIT_VAR(key_map); myf sync_dir= ((share->now_transactional && !share->temporary) ? MY_SYNC_DIR : 0); my_bool scan_inited= 0, reenable_logging= 0; MARIA_SHARE backup_share; DBUG_ENTER("maria_repair_by_sort"); - LINT_INIT(key_map); got_error= 1; new_file= -1; @@ -4176,13 +4173,12 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info, IO_CACHE_SHARE io_share; MARIA_SORT_INFO sort_info; MARIA_SHARE backup_share; - ulonglong key_map; + ulonglong UNINIT_VAR(key_map); pthread_attr_t thr_attr; myf sync_dir= ((share->now_transactional && !share->temporary) ? MY_SYNC_DIR : 0); my_bool reenable_logging= 0; DBUG_ENTER("maria_repair_parallel"); - LINT_INIT(key_map); got_error= 1; new_file= -1; @@ -4908,9 +4904,8 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param) } case DYNAMIC_RECORD: { - uchar *to; + uchar *UNINIT_VAR(to); ha_checksum checksum= 0; - LINT_INIT(to); pos=sort_param->pos; param->progress= pos; diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c index 71f03f4db16..dd188501f4e 100644 --- a/storage/maria/ma_checkpoint.c +++ b/storage/maria/ma_checkpoint.c @@ -552,13 +552,10 @@ pthread_handler_t ma_checkpoint_background(void *arg) translog_get_horizon(); ulonglong pagecache_flushes_at_last_checkpoint= maria_pagecache->global_cache_write; - uint pages_bunch_size; + uint UNINIT_VAR(pages_bunch_size); struct st_filter_param filter_param; - PAGECACHE_FILE *dfile; /**< data file currently being flushed */ - PAGECACHE_FILE *kfile; /**< index file currently being flushed */ - LINT_INIT(kfile); - LINT_INIT(dfile); - LINT_INIT(pages_bunch_size); + PAGECACHE_FILE *UNINIT_VAR(dfile); /**< data file currently being flushed */ + PAGECACHE_FILE *UNINIT_VAR(kfile); /**< index file currently being flushed */ my_thread_init(); DBUG_PRINT("info",("Maria background checkpoint thread starts")); @@ -756,7 +753,6 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon) PAGECACHE_FLUSH_FILTER filter; DBUG_ENTER("collect_tables"); - LINT_INIT(state_copies_horizon); /* let's make a list of distinct shares */ mysql_mutex_lock(&THR_LOCK_maria); for (nb= 0, pos= maria_open_list; pos; pos= pos->next) diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c index c89700be29a..5be819f341b 100644 --- a/storage/maria/ma_create.c +++ b/storage/maria/ma_create.c @@ -43,7 +43,7 @@ int maria_create(const char *name, enum data_file_type datafile_type, MARIA_CREATE_INFO *ci,uint flags) { register uint i,j; - File dfile,file; + File UNINIT_VAR(dfile), UNINIT_VAR(file); int errpos,save_errno, create_mode= O_RDWR | O_TRUNC, res; myf create_flag; uint length,max_key_length,packed,pack_bytes,pointer,real_length_diff, @@ -76,8 +76,6 @@ int maria_create(const char *name, enum data_file_type datafile_type, keys, columns, uniques, flags)); DBUG_ASSERT(maria_inited); - LINT_INIT(dfile); - LINT_INIT(file); if (!ci) { diff --git a/storage/maria/ma_dynrec.c b/storage/maria/ma_dynrec.c index cc03d621a26..70ecac318cc 100644 --- a/storage/maria/ma_dynrec.c +++ b/storage/maria/ma_dynrec.c @@ -1452,15 +1452,13 @@ int _ma_read_dynamic_record(MARIA_HA *info, uchar *buf, uint b_type; MARIA_BLOCK_INFO block_info; File file; - uchar *to; - uint left_length; + uchar *UNINIT_VAR(to); + uint UNINIT_VAR(left_length); DBUG_ENTER("_ma_read_dynamic_record"); if (filepos == HA_OFFSET_ERROR) goto err; - LINT_INIT(to); - LINT_INIT(left_length); file= info->dfile.file; block_of_record= 0; /* First block of record is numbered as zero. */ block_info.second_read= 0; @@ -1738,13 +1736,12 @@ int _ma_read_rnd_dynamic_record(MARIA_HA *info, { int block_of_record, info_read; uint left_len,b_type; - uchar *to; + uchar *UNINIT_VAR(to); MARIA_BLOCK_INFO block_info; MARIA_SHARE *share= info->s; DBUG_ENTER("_ma_read_rnd_dynamic_record"); info_read=0; - LINT_INIT(to); if (info->lock_type == F_UNLCK) { diff --git a/storage/maria/ma_ft_boolean_search.c b/storage/maria/ma_ft_boolean_search.c index ce0dca9e75e..83ae08553ef 100644 --- a/storage/maria/ma_ft_boolean_search.c +++ b/storage/maria/ma_ft_boolean_search.c @@ -344,10 +344,9 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) int subkeys=1; my_bool can_go_down; MARIA_HA *info=ftb->info; - uint off, extra=HA_FT_WLEN+info->s->base.rec_reflength; + uint UNINIT_VAR(off), extra=HA_FT_WLEN+info->s->base.rec_reflength; uchar *lastkey_buf= ftbw->word+ftbw->off; MARIA_KEY key; - LINT_INIT(off); if (ftbw->flags & FTB_FLAG_TRUNC) lastkey_buf+=ftbw->len; diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index 2caf8d84a71..f437bf1399f 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -1260,7 +1260,6 @@ static my_bool translog_set_lsn_for_files(uint32 from_file, uint32 to_file, { LOGHANDLER_FILE_INFO info; File fd; - LINT_INIT(info.max_lsn); fd= open_logfile_by_number_no_cache(file); if ((fd < 0) || @@ -1367,12 +1366,10 @@ end: static void translog_mark_file_finished(uint32 file) { int i; - struct st_file_counter *fc_ptr; + struct st_file_counter *UNINIT_VAR(fc_ptr); DBUG_ENTER("translog_mark_file_finished"); DBUG_PRINT("enter", ("file: %lu", (ulong) file)); - LINT_INIT(fc_ptr); - mysql_mutex_lock(&log_descriptor.unfinished_files_lock); DBUG_ASSERT(log_descriptor.unfinished_files.elements > 0); @@ -7487,7 +7484,6 @@ static void translog_force_current_buffer_to_finish() (uint) old_buffer-> copy_to_buffer_in_progress)); translog_lock_assert_owner(); - LINT_INIT(current_page_fill); new_buff_beginning= old_buffer->offset; new_buff_beginning+= old_buffer->size; /* increase offset */ @@ -7770,9 +7766,8 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn, { dirty_buffer_mask_t dirty_buffer_mask; uint i; - uint8 last_buffer_no, start_buffer_no; + uint8 UNINIT_VAR(last_buffer_no), start_buffer_no; DBUG_ENTER("translog_flush_buffers"); - LINT_INIT(last_buffer_no); /* We will recheck information when will lock buffers one by @@ -7919,7 +7914,7 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn, my_bool translog_flush(TRANSLOG_ADDRESS lsn) { struct timespec abstime; - ulonglong flush_interval; + ulonglong UNINIT_VAR(flush_interval); ulonglong time_spent; LSN sent_to_disk= LSN_IMPOSSIBLE; TRANSLOG_ADDRESS flush_horizon; @@ -7929,8 +7924,6 @@ my_bool translog_flush(TRANSLOG_ADDRESS lsn) DBUG_PRINT("enter", ("Flush up to LSN: (%lu,0x%lx)", LSN_IN_PARTS(lsn))); DBUG_ASSERT(translog_status == TRANSLOG_OK || translog_status == TRANSLOG_READONLY); - LINT_INIT(sent_to_disk); - LINT_INIT(flush_interval); mysql_mutex_lock(&log_descriptor.log_flush_lock); DBUG_PRINT("info", ("Everything is flushed up to (%lu,0x%lx)", diff --git a/storage/maria/ma_packrec.c b/storage/maria/ma_packrec.c index 025787f4a10..c14e69414b5 100644 --- a/storage/maria/ma_packrec.c +++ b/storage/maria/ma_packrec.c @@ -1411,8 +1411,7 @@ uint _ma_pack_get_block_info(MARIA_HA *maria, MARIA_BIT_BUFF *bit_buff, File file, my_off_t filepos) { uchar *header= info->header; - uint head_length,ref_length; - LINT_INIT(ref_length); + uint head_length,UNINIT_VAR(ref_length); if (file >= 0) { diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c index d773c4fc343..b0ad778a4f2 100644 --- a/storage/maria/ma_recovery.c +++ b/storage/maria/ma_recovery.c @@ -3038,12 +3038,11 @@ static MARIA_HA *get_MARIA_HA_from_REDO_record(const TRANSLOG_HEADER_BUFFER *rec) { uint16 sid; - pgcache_page_no_t page; + pgcache_page_no_t UNINIT_VAR(page); MARIA_HA *info; MARIA_SHARE *share; char llbuf[22]; my_bool index_page_redo_entry= FALSE, page_redo_entry= FALSE; - LINT_INIT(page); print_redo_phase_progress(rec->lsn); sid= fileid_korr(rec->header); diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c index 5dd0296e17b..8bd24524f67 100644 --- a/storage/maria/ma_search.c +++ b/storage/maria/ma_search.c @@ -356,8 +356,8 @@ int _ma_seq_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page, uint32 comp_flag, uchar **ret_pos, uchar *buff, my_bool *last_key) { - int flag; - uint page_flag, nod_flag, length, not_used[2]; + int UNINIT_VAR(flag); + uint page_flag, nod_flag, UNINIT_VAR(length), not_used[2]; uchar t_buff[MARIA_MAX_KEY_BUFF], *end; uchar *page; MARIA_KEYDEF *keyinfo= key->keyinfo; @@ -365,9 +365,6 @@ int _ma_seq_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page, MARIA_KEY tmp_key; DBUG_ENTER("_ma_seq_search"); - LINT_INIT(flag); - LINT_INIT(length); - page_flag= ma_page->flag; nod_flag= ma_page->node; page= ma_page->buff; @@ -430,10 +427,10 @@ int _ma_prefix_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page, uint nod_flag, length, len, matched, cmplen, kseg_len; uint page_flag, prefix_len,suffix_len; int key_len_skip, seg_len_pack, key_len_left; - uchar *end, *vseg, *saved_vseg, *saved_from; + uchar *end, *vseg, *UNINIT_VAR(saved_vseg), *UNINIT_VAR(saved_from); uchar *page; uchar tt_buff[MARIA_MAX_KEY_BUFF+2], *t_buff=tt_buff+2; - uchar *saved_to; + uchar *UNINIT_VAR(saved_to); const uchar *kseg; uint saved_length=0, saved_prefix_len=0; uint length_pack; @@ -442,13 +439,6 @@ int _ma_prefix_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page, const uchar *sort_order= keyinfo->seg->charset->sort_order; DBUG_ENTER("_ma_prefix_search"); - LINT_INIT(length); - LINT_INIT(prefix_len); - LINT_INIT(seg_len_pack); - LINT_INIT(saved_from); - LINT_INIT(saved_to); - LINT_INIT(saved_vseg); - t_buff[0]=0; /* Avoid bugs */ page_flag= ma_page->flag; nod_flag= ma_page->node; diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index 88e82d647a8..e1e7b323683 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -506,7 +506,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param) { MARIA_SORT_INFO *sort_info=sort_param->sort_info; HA_CHECK *param=sort_info->param; - ulong length, keys; + ulong UNINIT_VAR(length), keys; double *rec_per_key_part= param->new_rec_per_key_part; int got_error=sort_info->got_error; uint i; @@ -515,7 +515,6 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param) MARIA_SORT_PARAM *sinfo; uchar *mergebuf=0; DBUG_ENTER("_ma_thr_write_keys"); - LINT_INIT(length); for (i= 0, sinfo= sort_param ; i < sort_info->total_keys ; @@ -941,7 +940,7 @@ merge_buffers(MARIA_SORT_PARAM *info, uint keys, IO_CACHE *from_file, int error; uint sort_length,maxcount; ha_rows count; - my_off_t to_start_filepos; + my_off_t UNINIT_VAR(to_start_filepos); uchar *strpos; BUFFPEK *buffpek,**refpek; QUEUE queue; @@ -950,7 +949,6 @@ merge_buffers(MARIA_SORT_PARAM *info, uint keys, IO_CACHE *from_file, count=error=0; maxcount=keys/((uint) (Tb-Fb) +1); DBUG_ASSERT(maxcount > 0); - LINT_INIT(to_start_filepos); if (to_file) to_start_filepos=my_b_tell(to_file); strpos= (uchar*) sort_keys; diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 8347c17260d..0a735f07088 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -34,7 +34,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, MI_CREATE_INFO *ci,uint flags) { register uint i,j; - File dfile,file; + File UNINIT_VAR(dfile),UNINIT_VAR(file); int errpos,save_errno, create_mode= O_RDWR | O_TRUNC; myf create_flag; uint fields,length,max_key_length,packed,pack_bytes,pointer,real_length_diff, @@ -69,8 +69,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, { DBUG_RETURN(my_errno=HA_WRONG_CREATE_OPTION); } - LINT_INIT(dfile); - LINT_INIT(file); errpos=0; options=0; |