]> git.ipfire.org Git - telemetry.git/commitdiff
graphs: Cast pointers to suppress some warnings
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Apr 2026 14:27:04 +0000 (14:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Apr 2026 14:27:04 +0000 (14:27 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/graphs/graph.h

index 9f3b49f7ea3cf36ad52a0f98db7d34cec8defebe..0f0902e1745b4ecb70da07d4514fb6c41f2db729 100644 (file)
@@ -26,6 +26,8 @@
        in all the graphs.
 */
 
+#include <stdint.h>
+
 // Include colors
 #include "../colors.h"
 
@@ -94,8 +96,8 @@ typedef enum flags {
 #define EOL                            "\\j"
 
 // Returns the string or an empty string
-#define CONSTANT_OR_EMPTY(s, constant)         (s) ? constant : ""
-#define MAYBE_EMPTY(s)                                         (s) ? s : ""
+#define CONSTANT_OR_EMPTY(s, constant)         ((uintptr_t)(s)) ? constant : ""
+#define MAYBE_EMPTY(s)                                         ((uintptr_t)(s)) ? s : ""
 
 // Format literal for the field name with an optional object
 #define FIELD                  "%s%s%s"