summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-14 22:16:27 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-09-06 23:22:20 -0700
commit22c76bb5a8c82d610a63f08d67f7739a9ff30b4b (patch)
treef33c3356098b29feaf3a3c7e549472b71019e8ae
parent72cba07b65e1e096f4709e810ee1c5618e7d0125 (diff)
Convert ILong, IShort, etal to return C99 uint*_t types
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--server.c8
-rw-r--r--x11.h10
2 files changed, 10 insertions, 8 deletions
diff --git a/server.c b/server.c
index 3369460..5226a03 100644
--- a/server.c
+++ b/server.c
@@ -138,7 +138,7 @@ pad(long n)
return ((n + 3) & ~0x3);
}
-unsigned long
+uint32_t
ILong(const unsigned char buf[])
{
/* check for byte-swapping */
@@ -147,7 +147,7 @@ ILong(const unsigned char buf[])
return ((((((buf[0] << 8) | buf[1]) << 8) | buf[2]) << 8) | buf[3]);
}
-unsigned short
+uint16_t
IShort(const unsigned char buf[])
{
/* check for byte-swapping */
@@ -156,14 +156,14 @@ IShort(const unsigned char buf[])
return ((buf[0] << 8) | buf[1]);
}
-unsigned short
+uint16_t
IChar2B(const unsigned char buf[])
{
/* CHAR2B is like an IShort, but not byte-swapped */
return ((buf[0] << 8) | buf[1]);
}
-unsigned short
+uint8_t
IByte(const unsigned char buf[])
{
return (buf[0]);
diff --git a/x11.h b/x11.h
index 4fba039..2a8b6bb 100644
--- a/x11.h
+++ b/x11.h
@@ -51,6 +51,8 @@
#ifndef XSCOPE_X11_H
#define XSCOPE_X11_H
+#include <inttypes.h>
+
/* Some field contents are constants, not just types */
#define CONST1(n) CARD8
@@ -531,10 +533,10 @@ extern void PrintValueRec(unsigned long key, unsigned long cmask, short ctype);
/* declaration of the types of some common functions */
-extern unsigned long ILong(const unsigned char *buf);
-extern unsigned short IShort(const unsigned char *buf);
-extern unsigned short IChar2B(const unsigned char *buf);
-extern unsigned short IByte(const unsigned char *buf);
+extern uint32_t ILong(const unsigned char *buf);
+extern uint16_t IShort(const unsigned char *buf);
+extern uint16_t IChar2B(const unsigned char *buf);
+extern uint8_t IByte(const unsigned char *buf);
extern Boolean IBool(const unsigned char *buf);
extern int PrintString8(const unsigned char *buf, int number, const char *name);