@cryptotaxi247 / netdata-1 / commits / 454387fcf

Cleanup compilation warnings (#11810)

* Fix compilation warnings (variables used when debugging is enabled using NETDATA_INTERNAL_CHECKS) * Fix compilation warning (casting)

Stelios Fragkakis committed Nov 19, 2021 at 22:12 UTC 454387fcf4d30b57f0f2264f9d4acce081808d7a
11 files changed +18 -7
aclk/aclk_util.c
+1 -1
@@ -55,7 +55,7 @@ void aclk_env_t_destroy(aclk_env_t *env) {
55
56 int aclk_env_has_capa(const char *capa)
57 {
58 - for (int i = 0; i < aclk_env->capability_count; i++) {
58 + for (int i = 0; i < (int) aclk_env->capability_count; i++) {
59 if (!strcasecmp(capa, aclk_env->capabilities[i]))
60 return 1;
61 }
daemon/global_statistics.c
+1 -1
@@ -157,7 +157,7 @@ static inline void global_statistics_copy(struct global_statistics *gs, uint8_t
157
158 if(options & GLOBAL_STATS_RESET_WEB_USEC_MAX) {
159 uint64_t n = 0;
160 - __atomic_compare_exchange(&global_statistics.web_usec_max, &gs->web_usec_max, &n, 1, __ATOMIC_SEQ_CST,
160 + __atomic_compare_exchange(&global_statistics.web_usec_max, (uint64_t *) &gs->web_usec_max, &n, 1, __ATOMIC_SEQ_CST,
161 __ATOMIC_SEQ_CST);
162 }
163 #else
database/sqlite/sqlite_aclk_alert.c
+1 -1
@@ -374,7 +374,7 @@ void aclk_push_alarm_health_log(struct aclk_database_worker_config *wc, struct a
374 wc->alert_sequence_id = last_sequence;
375
376 aclk_send_alarm_log_health(&alarm_log);
377 - log_access("OG [%s (%s)]: Alarm health log sent, first sequence id %ld, last sequence id %ld.", wc->node_id, wc->host ? wc->host->hostname : "N/A", first_sequence, last_sequence);
377 + log_access("OG [%s (%s)]: Alarm health log sent, first sequence id %"PRIu64", last sequence id %"PRIu64, wc->node_id, wc->host ? wc->host->hostname : "N/A", first_sequence, last_sequence);
378
379 rc = sqlite3_finalize(res);
380 if (unlikely(rc != SQLITE_OK))
database/sqlite/sqlite_aclk_chart.c
+2 -2
@@ -406,7 +406,7 @@ void aclk_send_chart_event(struct aclk_database_worker_config *wc, struct aclk_d
406 db_unlock();
407
408 aclk_chart_inst_and_dim_update(payload_list, payload_list_size, is_dim, position_list, wc->batch_id);
409 - log_access("OG [%s (%s)]: Sending charts and dimensions update, batch_id %ld, first sequence %ld, last sequence %ld", wc->node_id, wc->host ? wc->host->hostname : "N/A", wc->batch_id, first_sequence, last_sequence);
409 + log_access("OG [%s (%s)]: Sending charts and dimensions update, batch_id %"PRIu64", first sequence %"PRIu64", last sequence %"PRIu64, wc->node_id, wc->host ? wc->host->hostname : "N/A", wc->batch_id, first_sequence, last_sequence);
410 wc->chart_sequence_id = last_sequence;
411 wc->chart_timestamp = last_timestamp;
412 }
@@ -519,7 +519,7 @@ void aclk_receive_chart_ack(struct aclk_database_worker_config *wc, struct aclk_
519 int rc;
520 sqlite3_stmt *res = NULL;
521
522 - log_access("IN [%s (%s)]: Received ack chart sequence id %ld.", wc->node_id, wc->host ? wc->host->hostname : "N/A", cmd.param1);
522 + log_access("IN [%s (%s)]: Received ack chart sequence id %"PRIu64, wc->node_id, wc->host ? wc->host->hostname : "N/A", cmd.param1);
523
524 BUFFER *sql = buffer_create(1024);
525
exporting/check_filters.c
+2
@@ -43,7 +43,9 @@ int rrdhost_is_exportable(struct instance *instance, RRDHOST *host)
43 */
44 int rrdset_is_exportable(struct instance *instance, RRDSET *st)
45 {
46 +#ifdef NETDATA_INTERNAL_CHECKS
47 RRDHOST *host = st->rrdhost;
48 +#endif
49
50 if (st->exporting_flags == NULL)
51 st->exporting_flags = callocz(instance->engine->instance_num, sizeof(size_t));
exporting/mongodb/mongodb.c
+2
@@ -276,7 +276,9 @@ void mongodb_cleanup(struct instance *instance)
276 void mongodb_connector_worker(void *instance_p)
277 {
278 struct instance *instance = (struct instance *)instance_p;
279 +#ifdef NETDATA_INTERNAL_CHECKS
280 struct mongodb_specific_config *connector_specific_config = instance->config.connector_specific_config;
281 +#endif
282 struct mongodb_specific_data *connector_specific_data =
283 (struct mongodb_specific_data *)instance->connector_specific_data;
284
exporting/process_data.c
+2
@@ -70,7 +70,9 @@ calculated_number exporting_calculate_value_from_stored_data(
70 time_t *last_timestamp)
71 {
72 RRDSET *st = rd->rrdset;
73 +#ifdef NETDATA_INTERNAL_CHECKS
74 RRDHOST *host = st->rrdhost;
75 +#endif
76 time_t after = instance->after;
77 time_t before = instance->before;
78
exporting/prometheus/prometheus.c
+2
@@ -16,7 +16,9 @@
16 */
17 inline int can_send_rrdset(struct instance *instance, RRDSET *st)
18 {
19 +#ifdef NETDATA_INTERNAL_CHECKS
20 RRDHOST *host = st->rrdhost;
21 +#endif
22
23 if (unlikely(rrdset_flag_check(st, RRDSET_FLAG_EXPORTING_IGNORE)))
24 return 0;
streaming/receiver.c
+1 -2
@@ -346,13 +346,12 @@ static int rrdpush_receive(struct receiver_state *rpt)
346 netdata_mutex_unlock(&rpt->host->receiver_lock);
347 }
348
349 +#ifdef NETDATA_INTERNAL_CHECKS
350 int ssl = 0;
351 #ifdef ENABLE_HTTPS
352 if (rpt->ssl.conn != NULL)
353 ssl = 1;
354 #endif
354 -
355 -#ifdef NETDATA_INTERNAL_CHECKS
355 info("STREAM %s [receive from [%s]:%s]: client willing to stream metrics for host '%s' with machine_guid '%s': update every = %d, history = %ld, memory mode = %s, health %s,%s tags '%s'"
356 , rpt->hostname
357 , rpt->client_ip
streaming/sender.c
+2
@@ -427,7 +427,9 @@ void attempt_to_send(struct sender_state *s) {
427
428 rrdpush_send_labels(s->host);
429
430 +#ifdef NETDATA_INTERNAL_CHECKS
431 struct circular_buffer *cb = s->buffer;
432 +#endif
433
434 netdata_thread_disable_cancelability();
435 netdata_mutex_lock(&s->mutex);
web/api/queries/query.c
+2
@@ -537,7 +537,9 @@ static inline void do_dimension_fixedstep(
537 , time_t before_wanted
538 , uint32_t options
539 ){
540 +#ifdef NETDATA_INTERNAL_CHECKS
541 RRDSET *st = r->st;
542 +#endif
543
544 time_t
545 now = after_wanted,