summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include/endian.h
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-11-10 10:22:23 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-11-10 10:22:23 +0000
commitc816e73149233b96140177872ef8f5c2bcba458a (patch)
tree81438267b79b9841a3e67e3dc9997b0e0af62ba7 /sys/arch/i386/include/endian.h
parent9d60d88b4b6b0566ca573908f54dfc7da34ed237 (diff)
Be careful with names of local vars in macros
Diffstat (limited to 'sys/arch/i386/include/endian.h')
-rw-r--r--sys/arch/i386/include/endian.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/arch/i386/include/endian.h b/sys/arch/i386/include/endian.h
index 52e65f5aac3..6e44bcdd12d 100644
--- a/sys/arch/i386/include/endian.h
+++ b/sys/arch/i386/include/endian.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: endian.h,v 1.8 1997/11/09 23:51:29 niklas Exp $ */
+/* $OpenBSD: endian.h,v 1.9 1997/11/10 10:22:22 niklas Exp $ */
/*-
* Copyright (c) 1997 Niklas Hallqvist. All rights reserved.
@@ -36,25 +36,26 @@
#if defined(_KERNEL) && !defined(I386_CPU)
#define __swap32md(x) ({ \
- u_int32_t __x = (x); \
+ u_int32_t __swap32md_x = (x); \
\
- __asm ("bswap %1" : "=r" (__x) : "0" (__x)); \
- __x; \
+ __asm ("bswap %1" : "=r" (__swap32md_x) : "0" (__swap32md_x)); \
+ __swap32md_x; \
})
#else
#define __swap32md(x) ({ \
- u_int32_t __x = (x); \
+ u_int32_t __swap32md_x = (x); \
\
__asm ("rorw $8, %w1; rorl $16, %1; rorw $8, %w1" : \
- "=r" (__x) : "0" (__x)); \
- __x; \
+ "=r" (__swap32md_x) : "0" (__swap32md_x)); \
+ __swap32md_x; \
})
#endif /* _KERNEL && !I386_CPU */
#define __swap16md(x) ({ \
- u_int16_t __x = (x); \
+ u_int16_t __swap16md_x = (x); \
\
- __asm ("rorw $8, %w1" : "=r" (__x) : "0" (__x)); \
+ __asm ("rorw $8, %w1" : "=r" (__swap16md_x) : \
+ "0" (__swap16md_x)); \
__x; \
})