summaryrefslogtreecommitdiff
path: root/src/common/socket.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-01-08 11:21:23 +0100
committerHaru <haru@dotalux.com>2016-02-24 21:00:32 +0100
commita204a38963ee6e5233876b00dd658c804e994940 (patch)
tree2d684e4d8aaec2152b47114aae107201f23e4335 /src/common/socket.h
parent9ffd9cd568c5d908fbbec46256fe235021fd87a4 (diff)
downloadhercules-a204a38963ee6e5233876b00dd658c804e994940.tar.gz
hercules-a204a38963ee6e5233876b00dd658c804e994940.tar.bz2
hercules-a204a38963ee6e5233876b00dd658c804e994940.tar.xz
hercules-a204a38963ee6e5233876b00dd658c804e994940.zip
Modified RBUFP to return a const void *
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/socket.h')
-rw-r--r--src/common/socket.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/socket.h b/src/common/socket.h
index b9e6f6f42..947ea8d3e 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -85,7 +85,12 @@ struct config_setting_t;
#define WP2PTR(fd) WFIFO2PTR(fd)
// buffer I/O macros
-#define RBUFP(p,pos) (((const uint8 *)(p)) + (pos))
+static inline const void *RBUFP_(const void *p, int pos) __attribute__((const, unused));
+static inline const void *RBUFP_(const void *p, int pos)
+{
+ return ((const uint8 *)p) + pos;
+}
+#define RBUFP(p,pos) RBUFP_(p, (int)(pos))
#define RBUFB(p,pos) (*(const uint8 *)RBUFP((p),(pos)))
#define RBUFW(p,pos) (*(const uint16 *)RBUFP((p),(pos)))
#define RBUFL(p,pos) (*(const uint32 *)RBUFP((p),(pos)))