summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2016-02-20 01:34:13 +0000
committerjhibbits <jhibbits@FreeBSD.org>2016-02-20 01:34:13 +0000
commit17728bcf02f94c1fd05f9ba7fdc8498053209891 (patch)
tree3388fa9448434a311ed3dc7178e0deb3b084acea
parentf8385663eeba2c10cd82a51c0a461a4f932458a3 (diff)
downloadFreeBSD-src-17728bcf02f94c1fd05f9ba7fdc8498053209891.zip
FreeBSD-src-17728bcf02f94c1fd05f9ba7fdc8498053209891.tar.gz
Fix the definition of RM_MAX_END.
Even though casting from signed to unsigned is well-defined in C, it's better to first cast to the larger unsigned type, then negate.
-rw-r--r--sys/sys/rman.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/rman.h b/sys/sys/rman.h
index 76db630..2d58f4a 100644
--- a/sys/sys/rman.h
+++ b/sys/sys/rman.h
@@ -61,7 +61,7 @@ enum rman_type { RMAN_UNINIT = 0, RMAN_GAUGE, RMAN_ARRAY };
*/
#define RM_TEXTLEN 32
-#define RM_MAX_END ((rman_res_t)~0)
+#define RM_MAX_END (~(rman_res_t)0)
#define RMAN_IS_DEFAULT_RANGE(s,e) ((s) == 0 && (e) == RM_MAX_END)
OpenPOWER on IntegriCloud