Fix type in dbrrd_closest()

For ABS() to work, the argument must be signed, but rrdd_time is
uint64_t.  Clang noticed it.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Mariusz Zaborski <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Fixes #16853
Closes #17733
This commit is contained in:
Alexander Motin authored and Brian Behlendorf committed 2025-09-12 15:05:22 -07:00
1 parent b5d41deca9
commit 41c6eaac8b
1 file changed
+2 -1
+2 -1
View File
@@ -208,7 +208,8 @@ dbrrd_closest(hrtime_t tv, const rrd_data_t *r1, const rrd_data_t *r2)
if (r2 == NULL)
return (r1);
return (ABS(tv - r1->rrdd_time) < ABS(tv - r2->rrdd_time) ? r1 : r2);
return (ABS(tv - (hrtime_t)r1->rrdd_time) <
ABS(tv - (hrtime_t)r2->rrdd_time) ? r1 : r2);
}
uint64_t