aboutsummaryrefslogtreecommitdiff
path: root/iconv/skeleton.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconv/skeleton.c')
-rw-r--r--iconv/skeleton.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/iconv/skeleton.c b/iconv/skeleton.c
index ad381ec77c..dfd067e05a 100644
--- a/iconv/skeleton.c
+++ b/iconv/skeleton.c
@@ -140,20 +140,20 @@ static int to_object;
| ((__const unsigned char *) (addr))[1]) << 8 \
| ((__const unsigned char *) (addr))[0])
-# define put16(addr, val) \
+# define put16(addr, val) \
({ uint16_t __val = (val); \
- ((__const unsigned char *) (addr))[0] = __val; \
- ((__const unsigned char *) (addr))[1] = __val >> 8; \
+ ((unsigned char *) (addr))[0] = __val; \
+ ((unsigned char *) (addr))[1] = __val >> 8; \
(void) 0; })
-# define put32(addr, val) \
- ({ uint16_t __val = (val); \
- ((__const unsigned char *) (addr))[0] = __val; \
+# define put32(addr, val) \
+ ({ uint32_t __val = (val); \
+ ((unsigned char *) (addr))[0] = __val; \
__val >>= 8; \
- ((__const unsigned char *) (addr))[1] = __val; \
+ ((unsigned char *) (addr))[1] = __val; \
__val >>= 8; \
- ((__const unsigned char *) (addr))[2] = __val; \
+ ((unsigned char *) (addr))[2] = __val; \
__val >>= 8; \
- ((__const unsigned char *) (addr))[3] = __val; \
+ ((unsigned char *) (addr))[3] = __val; \
(void) 0; })
# else
# define get16(addr) \
@@ -165,20 +165,20 @@ static int to_object;
| ((__const unsigned char *) (addr))[2]) << 8 \
| ((__const unsigned char *) (addr))[3])
-# define put16(addr, val) \
+# define put16(addr, val) \
({ uint16_t __val = (val); \
- ((__const unsigned char *) (addr))[1] = __val; \
- ((__const unsigned char *) (addr))[2] = __val >> 8; \
+ ((unsigned char *) (addr))[1] = __val; \
+ ((unsigned char *) (addr))[2] = __val >> 8; \
(void) 0; })
-# define put32(addr, val) \
- ({ uint16_t __val = (val); \
- ((__const unsigned char *) (addr))[3] = __val; \
+# define put32(addr, val) \
+ ({ uint32_t __val = (val); \
+ ((unsigned char *) (addr))[3] = __val; \
__val >>= 8; \
- ((__const unsigned char *) (addr))[2] = __val; \
+ ((unsigned char *) (addr))[2] = __val; \
__val >>= 8; \
- ((__const unsigned char *) (addr))[1] = __val; \
+ ((unsigned char *) (addr))[1] = __val; \
__val >>= 8; \
- ((__const unsigned char *) (addr))[0] = __val; \
+ ((unsigned char *) (addr))[0] = __val; \
(void) 0; })
# endif
#endif