Fix compilation warnings (#9544)
Vladimir Kobal committed
Jul 15, 2020 at 13:46 UTC
013d0ec2357da97ff60ecb6d03d6b2d95b8135aa
6 files changed
+12
-12
database/engine/journalfile.c
+2
-2
@@ -64,7 +64,7 @@ void * wal_get_transaction_buffer(struct rrdengine_worker_config* wc, unsigned s
64
{
65
struct rrdengine_instance *ctx = wc->ctx;
66
int ret;
67
- unsigned buf_pos, buf_size;
67
+ unsigned buf_pos = 0, buf_size;
68
69
fatal_assert(size);
70
if (ctx->commit_log.buf) {
@@ -275,7 +275,7 @@ static void restore_extent_metadata(struct rrdengine_instance *ctx, struct rrden
275
for (i = 0, valid_pages = 0 ; i < count ; ++i) {
276
uuid_t *temp_id;
277
Pvoid_t *PValue;
278
- struct pg_cache_page_index *page_index;
278
+ struct pg_cache_page_index *page_index = NULL;
279
280
if (PAGE_METRICS != jf_metric_data->descr[i].type) {
281
error("Unknown page type encountered.");
database/engine/metadata_log/compaction.c
+1
-1
@@ -312,7 +312,7 @@ int compaction_failure_recovery(struct metalog_instance *ctx, struct metadata_lo
312
{
313
int ret;
314
unsigned starting_fileno, fileno, i, j, recovered_files;
315
- struct metadata_logfile *metalogfile, *compactionfile, **tmp_metalogfiles;
315
+ struct metadata_logfile *metalogfile = NULL, *compactionfile = NULL, **tmp_metalogfiles;
316
char *dbfiles_path = ctx->rrdeng_ctx->dbfiles_path;
317
318
for (i = 0 ; i < *matched_files ; ++i) {
database/engine/metadata_log/logfile.c
+1
-1
@@ -130,7 +130,7 @@ void *mlf_get_records_buffer(struct metalog_worker_config *wc, struct metadata_r
130
struct metadata_logfile_list *metadata_logfiles, unsigned size)
131
{
132
int ret;
133
- unsigned buf_pos, buf_size;
133
+ unsigned buf_pos = 0, buf_size;
134
135
fatal_assert(size);
136
if (records_log->buf) {
database/engine/pagecache.c
+5
-5
@@ -400,7 +400,7 @@ uint8_t pg_cache_punch_hole(struct rrdengine_instance *ctx, struct rrdeng_page_d
400
struct page_cache *pg_cache = &ctx->pg_cache;
401
struct page_cache_descr *pg_cache_descr = NULL;
402
Pvoid_t *PValue;
403
- struct pg_cache_page_index *page_index;
403
+ struct pg_cache_page_index *page_index = NULL;
404
int ret;
405
uint8_t can_delete_metric = 0;
406
@@ -622,7 +622,7 @@ usec_t pg_cache_oldest_time_in_range(struct rrdengine_instance *ctx, uuid_t *id,
622
struct page_cache *pg_cache = &ctx->pg_cache;
623
struct rrdeng_page_descr *descr = NULL;
624
Pvoid_t *PValue;
625
- struct pg_cache_page_index *page_index;
625
+ struct pg_cache_page_index *page_index = NULL;
626
627
uv_rwlock_rdlock(&pg_cache->metrics_index.lock);
628
PValue = JudyHSGet(pg_cache->metrics_index.JudyHS_array, id, sizeof(uuid_t));
@@ -703,7 +703,7 @@ unsigned pg_cache_preload(struct rrdengine_instance *ctx, uuid_t *id, usec_t sta
703
unsigned i, j, k, preload_count, count, page_info_array_max_size;
704
unsigned long flags;
705
Pvoid_t *PValue;
706
- struct pg_cache_page_index *page_index;
706
+ struct pg_cache_page_index *page_index = NULL;
707
Word_t Index;
708
uint8_t failed_to_reserve;
709
@@ -849,7 +849,7 @@ struct rrdeng_page_descr *
849
struct page_cache_descr *pg_cache_descr = NULL;
850
unsigned long flags;
851
Pvoid_t *PValue;
852
- struct pg_cache_page_index *page_index;
852
+ struct pg_cache_page_index *page_index = NULL;
853
Word_t Index;
854
uint8_t page_not_in_cache;
855
@@ -956,7 +956,7 @@ pg_cache_lookup_next(struct rrdengine_instance *ctx, struct pg_cache_page_index
956
struct page_cache_descr *pg_cache_descr = NULL;
957
unsigned long flags;
958
Pvoid_t *PValue;
959
- struct pg_cache_page_index *page_index;
959
+ struct pg_cache_page_index *page_index = NULL;
960
uint8_t page_not_in_cache;
961
962
if (unlikely(NULL == index)) {
database/engine/rrdengineapi.c
+2
-2
@@ -49,7 +49,7 @@ void rrdeng_metric_init(RRDDIM *rd, uuid_t *dim_uuid)
49
struct rrdengine_instance *ctx;
50
uuid_t legacy_uuid;
51
Pvoid_t *PValue;
52
- struct pg_cache_page_index *page_index;
52
+ struct pg_cache_page_index *page_index = NULL;
53
int replace_instead_of_generate = 0;
54
55
ctx = rd->rrdset->rrdhost->rrdeng_ctx;
@@ -555,7 +555,7 @@ storage_number rrdeng_load_metric_next(struct rrddim_query_handle *rrdimm_handle
555
struct rrdeng_page_descr *descr;
556
storage_number *page, ret;
557
unsigned position, entries;
558
- usec_t next_page_time, current_position_time, page_end_time;
558
+ usec_t next_page_time = 0, current_position_time, page_end_time = 0;
559
uint32_t page_length;
560
561
handle = &rrdimm_handle->rrdeng;
database/engine/rrdenginelib.c
+1
-1
@@ -90,7 +90,7 @@ int check_file_properties(uv_file file, uint64_t *file_size, size_t min_size)
90
int open_file_for_io(char *path, int flags, uv_file *file, int direct)
91
{
92
uv_fs_t req;
93
- int fd, current_flags;
93
+ int fd = -1, current_flags;
94
95
fatal_assert(0 == direct || 1 == direct);
96
for ( ; direct >= 0 ; --direct) {