summaryrefslogtreecommitdiff
path: root/ares_dns.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-08 17:01:40 +0000
committerYang Tse <yangsita@gmail.com>2007-02-08 17:01:40 +0000
commitd145c09ef105cb5a1aa16518bea2afbed8774549 (patch)
tree33caafeb7851b33447467b306a17f11501a56bf7 /ares_dns.h
parent5d5bf03803d22f464fecb827cadcaa41fc4c4bcb (diff)
downloadc-ares-d145c09ef105cb5a1aa16518bea2afbed8774549.tar.gz
c-ares-d145c09ef105cb5a1aa16518bea2afbed8774549.tar.bz2
c-ares-d145c09ef105cb5a1aa16518bea2afbed8774549.zip
compiler warning fix
Diffstat (limited to 'ares_dns.h')
-rw-r--r--ares_dns.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/ares_dns.h b/ares_dns.h
index 9e8f1d7..3531cd4 100644
--- a/ares_dns.h
+++ b/ares_dns.h
@@ -21,12 +21,12 @@
#define DNS__16BIT(p) (((p)[0] << 8) | (p)[1])
#define DNS__32BIT(p) (((p)[0] << 24) | ((p)[1] << 16) | \
((p)[2] << 8) | (p)[3])
-#define DNS__SET16BIT(p, v) (((p)[0] = ((v) >> 8) & 0xff), \
- ((p)[1] = (v) & 0xff))
-#define DNS__SET32BIT(p, v) (((p)[0] = ((v) >> 24) & 0xff), \
- ((p)[1] = ((v) >> 16) & 0xff), \
- ((p)[2] = ((v) >> 8) & 0xff), \
- ((p)[3] = (v) & 0xff))
+#define DNS__SET16BIT(p, v) (((p)[0] = (unsigned char)((v) >> 8) & 0xff), \
+ ((p)[1] = (unsigned char)(v) & 0xff))
+#define DNS__SET32BIT(p, v) (((p)[0] = (unsigned char)((v) >> 24) & 0xff), \
+ ((p)[1] = (unsigned char)((v) >> 16) & 0xff), \
+ ((p)[2] = (unsigned char)((v) >> 8) & 0xff), \
+ ((p)[3] = (unsigned char)(v) & 0xff))
#if 0
/* we cannot use this approach on systems where we can't access 16/32 bit