]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: flags: fix build warning in some macros used by show_flags
authorWilly Tarreau <w@1wt.eu>
Fri, 9 Sep 2022 15:35:05 +0000 (17:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Sep 2022 15:36:27 +0000 (17:36 +0200)
Some gcc versions seem to be upset by the use of enums as booleans,
so OK, let's cast all of them as uint, that's no big deal.

include/haproxy/show_flags-t.h

index 72176618b1b2ea9f00b551d737ee9d9feba8a91d..5b14b63297a7e2f9beb96e48b1183e300fb33fdb 100644 (file)
@@ -56,8 +56,8 @@
                size_t _ret = 0;                                                \
                unsigned int _flg0 = (_flg);                                    \
                do { __VA_ARGS__; } while (0);                                  \
-               (_flg) &= ~(_val);                                              \
-               if (!(_val) && !(_flg))                                         \
+               (_flg) &= ~(unsigned int)(_val);                                \
+               if (!((unsigned int)_val) && !(_flg))                           \
                        _ret = snprintf(_buf, _len, "0%s",                      \
                                        (_flg) ? (_del) : "");                  \
                else if ((_flg0) & (_val)) {                                    \