Change cast to remove coverity warnings (#13735)
thiagoftsm committed
Sep 28, 2022 at 11:42 UTC
0190a1b556a78e50c5507bbfdbe34c63ebb56931
2 files changed
+4
-4
database/sqlite/sqlite_aclk_alert.c
+2
-2
@@ -872,12 +872,12 @@ void health_alarm_entry2proto_nolock(struct alarm_log_entry *alarm_log, ALARM_EN
872
#endif
873
874
#ifdef ENABLE_ACLK
875
-static int have_recent_alarm(RRDHOST *host, uint32_t alarm_id, time_t mark)
875
+static int have_recent_alarm(RRDHOST *host, uint32_t alarm_id, uint32_t mark)
876
{
877
ALARM_ENTRY *ae = host->health_log.alarms;
878
879
while (ae) {
880
- if (ae->alarm_id == alarm_id && ae->unique_id > (uint32_t)mark &&
880
+ if (ae->alarm_id == alarm_id && ae->unique_id >mark &&
881
(ae->new_status != RRDCALC_STATUS_WARNING && ae->new_status != RRDCALC_STATUS_CRITICAL))
882
return 1;
883
ae = ae->next;
health/health_json.c
+2
-2
@@ -397,12 +397,12 @@ void health_alarms_values2json(RRDHOST *host, BUFFER *wb, int all) {
397
buffer_strcat(wb, "\n\t}\n}\n");
398
}
399
400
-static int have_recent_alarm(RRDHOST *host, uint32_t alarm_id, time_t mark)
400
+static int have_recent_alarm(RRDHOST *host, uint32_t alarm_id, uint32_t mark)
401
{
402
ALARM_ENTRY *ae = host->health_log.alarms;
403
404
while(ae) {
405
- if (ae->alarm_id == alarm_id && ae->unique_id > (unsigned int) mark &&
405
+ if (ae->alarm_id == alarm_id && ae->unique_id > mark &&
406
(ae->new_status != RRDCALC_STATUS_WARNING && ae->new_status != RRDCALC_STATUS_CRITICAL))
407
return 1;
408
ae = ae->next;