From: Todd C. Miller Date: Thu, 24 Sep 2015 17:23:02 +0000 (-0600) Subject: Explicitly mark large hex constants unsigned. X-Git-Tag: SUDO_1_8_15^2~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c7ff33ea82dc1e7e36c7e25503b48358edba302;p=sudo Explicitly mark large hex constants unsigned. --- diff --git a/include/sudo_plugin.h b/include/sudo_plugin.h index dd1df8d69..ed08c255f 100644 --- a/include/sudo_plugin.h +++ b/include/sudo_plugin.h @@ -20,17 +20,17 @@ /* 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 */