]> granicus.if.org Git - sudo/commitdiff
Explicitly mark large hex constants unsigned.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 24 Sep 2015 17:23:02 +0000 (11:23 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 24 Sep 2015 17:23:02 +0000 (11:23 -0600)
include/sudo_plugin.h

index dd1df8d69ea527253e8f591a3ceb7f8256856928..ed08c255f97828c6f103cb573fba206dbdf63eb2 100644 (file)
 /* API version major/minor */
 #define SUDO_API_VERSION_MAJOR 1
 #define SUDO_API_VERSION_MINOR 8
-#define SUDO_API_MKVERSION(x, y) ((x << 16) | y)
+#define SUDO_API_MKVERSION(x, y) (((x) << 16) | (y))
 #define SUDO_API_VERSION SUDO_API_MKVERSION(SUDO_API_VERSION_MAJOR, SUDO_API_VERSION_MINOR)
 
 /* Getters and setters for plugin API versions */
 #define SUDO_API_VERSION_GET_MAJOR(v) ((v) >> 16)
-#define SUDO_API_VERSION_GET_MINOR(v) ((v) & 0xffff)
+#define SUDO_API_VERSION_GET_MINOR(v) ((v) & 0xffffU)
 #define SUDO_API_VERSION_SET_MAJOR(vp, n) do { \
-    *(vp) = (*(vp) & 0x0000ffff) | ((n) << 16); \
+    *(vp) = (*(vp) & 0x0000ffffU) | ((n) << 16); \
 } while(0)
 #define SUDO_API_VERSION_SET_MINOR(vp, n) do { \
-    *(vp) = (*(vp) & 0xffff0000) | (n); \
+    *(vp) = (*(vp) & 0xffff0000U) | (n); \
 } while(0)
 
 /* Conversation function types and defines */