summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util/byteorder.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/util/byteorder.h b/lib/util/byteorder.h
index 8db14d3ab8a..053c4d22f5f 100644
--- a/lib/util/byteorder.h
+++ b/lib/util/byteorder.h
@@ -95,8 +95,8 @@ it also defines lots of intermediate macros, just ignore those :-)
#define PVAL(buf,pos) (CVAL(buf,pos))
#define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val))
-#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
-#define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
+#define SVAL(buf,pos) (uint32_t)PULL_LE_U16(buf, pos)
+#define IVAL(buf,pos) PULL_LE_U32(buf, pos)
#define SSVALX(buf,pos,val) (CVAL_NC(buf,pos)=(uint8_t)((val)&0xFF),CVAL_NC(buf,pos+1)=(uint8_t)((val)>>8))
#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
#define SVALS(buf,pos) ((int16_t)SVAL(buf,pos))