mirror of
https://github.com/netdata/netdata.git
synced 2025-04-28 22:52:30 +00:00
Cleanup compilation warnings (#11810)
* Fix compilation warnings (variables used when debugging is enabled using NETDATA_INTERNAL_CHECKS) * Fix compilation warning (casting)
This commit is contained in:
parent
11b8588c94
commit
454387fcf4
11 changed files with 18 additions and 7 deletions
aclk
daemon
database/sqlite
exporting
streaming
web/api/queries
|
@ -55,7 +55,7 @@ void aclk_env_t_destroy(aclk_env_t *env) {
|
||||||
|
|
||||||
int aclk_env_has_capa(const char *capa)
|
int aclk_env_has_capa(const char *capa)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < aclk_env->capability_count; i++) {
|
for (int i = 0; i < (int) aclk_env->capability_count; i++) {
|
||||||
if (!strcasecmp(capa, aclk_env->capabilities[i]))
|
if (!strcasecmp(capa, aclk_env->capabilities[i]))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,7 +157,7 @@ static inline void global_statistics_copy(struct global_statistics *gs, uint8_t
|
||||||
|
|
||||||
if(options & GLOBAL_STATS_RESET_WEB_USEC_MAX) {
|
if(options & GLOBAL_STATS_RESET_WEB_USEC_MAX) {
|
||||||
uint64_t n = 0;
|
uint64_t n = 0;
|
||||||
__atomic_compare_exchange(&global_statistics.web_usec_max, &gs->web_usec_max, &n, 1, __ATOMIC_SEQ_CST,
|
__atomic_compare_exchange(&global_statistics.web_usec_max, (uint64_t *) &gs->web_usec_max, &n, 1, __ATOMIC_SEQ_CST,
|
||||||
__ATOMIC_SEQ_CST);
|
__ATOMIC_SEQ_CST);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -374,7 +374,7 @@ void aclk_push_alarm_health_log(struct aclk_database_worker_config *wc, struct a
|
||||||
wc->alert_sequence_id = last_sequence;
|
wc->alert_sequence_id = last_sequence;
|
||||||
|
|
||||||
aclk_send_alarm_log_health(&alarm_log);
|
aclk_send_alarm_log_health(&alarm_log);
|
||||||
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);
|
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);
|
||||||
|
|
||||||
rc = sqlite3_finalize(res);
|
rc = sqlite3_finalize(res);
|
||||||
if (unlikely(rc != SQLITE_OK))
|
if (unlikely(rc != SQLITE_OK))
|
||||||
|
|
|
@ -406,7 +406,7 @@ void aclk_send_chart_event(struct aclk_database_worker_config *wc, struct aclk_d
|
||||||
db_unlock();
|
db_unlock();
|
||||||
|
|
||||||
aclk_chart_inst_and_dim_update(payload_list, payload_list_size, is_dim, position_list, wc->batch_id);
|
aclk_chart_inst_and_dim_update(payload_list, payload_list_size, is_dim, position_list, wc->batch_id);
|
||||||
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);
|
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);
|
||||||
wc->chart_sequence_id = last_sequence;
|
wc->chart_sequence_id = last_sequence;
|
||||||
wc->chart_timestamp = last_timestamp;
|
wc->chart_timestamp = last_timestamp;
|
||||||
}
|
}
|
||||||
|
@ -519,7 +519,7 @@ void aclk_receive_chart_ack(struct aclk_database_worker_config *wc, struct aclk_
|
||||||
int rc;
|
int rc;
|
||||||
sqlite3_stmt *res = NULL;
|
sqlite3_stmt *res = NULL;
|
||||||
|
|
||||||
log_access("IN [%s (%s)]: Received ack chart sequence id %ld.", wc->node_id, wc->host ? wc->host->hostname : "N/A", cmd.param1);
|
log_access("IN [%s (%s)]: Received ack chart sequence id %"PRIu64, wc->node_id, wc->host ? wc->host->hostname : "N/A", cmd.param1);
|
||||||
|
|
||||||
BUFFER *sql = buffer_create(1024);
|
BUFFER *sql = buffer_create(1024);
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,9 @@ int rrdhost_is_exportable(struct instance *instance, RRDHOST *host)
|
||||||
*/
|
*/
|
||||||
int rrdset_is_exportable(struct instance *instance, RRDSET *st)
|
int rrdset_is_exportable(struct instance *instance, RRDSET *st)
|
||||||
{
|
{
|
||||||
|
#ifdef NETDATA_INTERNAL_CHECKS
|
||||||
RRDHOST *host = st->rrdhost;
|
RRDHOST *host = st->rrdhost;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (st->exporting_flags == NULL)
|
if (st->exporting_flags == NULL)
|
||||||
st->exporting_flags = callocz(instance->engine->instance_num, sizeof(size_t));
|
st->exporting_flags = callocz(instance->engine->instance_num, sizeof(size_t));
|
||||||
|
|
|
@ -276,7 +276,9 @@ void mongodb_cleanup(struct instance *instance)
|
||||||
void mongodb_connector_worker(void *instance_p)
|
void mongodb_connector_worker(void *instance_p)
|
||||||
{
|
{
|
||||||
struct instance *instance = (struct instance *)instance_p;
|
struct instance *instance = (struct instance *)instance_p;
|
||||||
|
#ifdef NETDATA_INTERNAL_CHECKS
|
||||||
struct mongodb_specific_config *connector_specific_config = instance->config.connector_specific_config;
|
struct mongodb_specific_config *connector_specific_config = instance->config.connector_specific_config;
|
||||||
|
#endif
|
||||||
struct mongodb_specific_data *connector_specific_data =
|
struct mongodb_specific_data *connector_specific_data =
|
||||||
(struct mongodb_specific_data *)instance->connector_specific_data;
|
(struct mongodb_specific_data *)instance->connector_specific_data;
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,9 @@ calculated_number exporting_calculate_value_from_stored_data(
|
||||||
time_t *last_timestamp)
|
time_t *last_timestamp)
|
||||||
{
|
{
|
||||||
RRDSET *st = rd->rrdset;
|
RRDSET *st = rd->rrdset;
|
||||||
|
#ifdef NETDATA_INTERNAL_CHECKS
|
||||||
RRDHOST *host = st->rrdhost;
|
RRDHOST *host = st->rrdhost;
|
||||||
|
#endif
|
||||||
time_t after = instance->after;
|
time_t after = instance->after;
|
||||||
time_t before = instance->before;
|
time_t before = instance->before;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
*/
|
*/
|
||||||
inline int can_send_rrdset(struct instance *instance, RRDSET *st)
|
inline int can_send_rrdset(struct instance *instance, RRDSET *st)
|
||||||
{
|
{
|
||||||
|
#ifdef NETDATA_INTERNAL_CHECKS
|
||||||
RRDHOST *host = st->rrdhost;
|
RRDHOST *host = st->rrdhost;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (unlikely(rrdset_flag_check(st, RRDSET_FLAG_EXPORTING_IGNORE)))
|
if (unlikely(rrdset_flag_check(st, RRDSET_FLAG_EXPORTING_IGNORE)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -346,13 +346,12 @@ static int rrdpush_receive(struct receiver_state *rpt)
|
||||||
netdata_mutex_unlock(&rpt->host->receiver_lock);
|
netdata_mutex_unlock(&rpt->host->receiver_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef NETDATA_INTERNAL_CHECKS
|
||||||
int ssl = 0;
|
int ssl = 0;
|
||||||
#ifdef ENABLE_HTTPS
|
#ifdef ENABLE_HTTPS
|
||||||
if (rpt->ssl.conn != NULL)
|
if (rpt->ssl.conn != NULL)
|
||||||
ssl = 1;
|
ssl = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NETDATA_INTERNAL_CHECKS
|
|
||||||
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'"
|
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'"
|
||||||
, rpt->hostname
|
, rpt->hostname
|
||||||
, rpt->client_ip
|
, rpt->client_ip
|
||||||
|
|
|
@ -427,7 +427,9 @@ void attempt_to_send(struct sender_state *s) {
|
||||||
|
|
||||||
rrdpush_send_labels(s->host);
|
rrdpush_send_labels(s->host);
|
||||||
|
|
||||||
|
#ifdef NETDATA_INTERNAL_CHECKS
|
||||||
struct circular_buffer *cb = s->buffer;
|
struct circular_buffer *cb = s->buffer;
|
||||||
|
#endif
|
||||||
|
|
||||||
netdata_thread_disable_cancelability();
|
netdata_thread_disable_cancelability();
|
||||||
netdata_mutex_lock(&s->mutex);
|
netdata_mutex_lock(&s->mutex);
|
||||||
|
|
|
@ -537,7 +537,9 @@ static inline void do_dimension_fixedstep(
|
||||||
, time_t before_wanted
|
, time_t before_wanted
|
||||||
, uint32_t options
|
, uint32_t options
|
||||||
){
|
){
|
||||||
|
#ifdef NETDATA_INTERNAL_CHECKS
|
||||||
RRDSET *st = r->st;
|
RRDSET *st = r->st;
|
||||||
|
#endif
|
||||||
|
|
||||||
time_t
|
time_t
|
||||||
now = after_wanted,
|
now = after_wanted,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue