aboutsummaryrefslogtreecommitdiff
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
commit9f62ff5df612f954de41853c0fa8591054c08210 (patch)
tree342f21e1d585d7787673c8ec2c099f20a5475b0f
parent4e3f3e751e6f0886c76f23a12eb6d23c9b5f654a (diff)
compiler warning fix
-rw-r--r--ares/ares_dns.h12
-rw-r--r--ares/ares_send.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/ares/ares_dns.h b/ares/ares_dns.h
index 9e8f1d74a..3531cd469 100644
--- a/ares/ares_dns.h
+++ b/ares/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
diff --git a/ares/ares_send.c b/ares/ares_send.c
index 89efec089..6d17a1cd7 100644
--- a/ares/ares_send.c
+++ b/ares/ares_send.c
@@ -73,7 +73,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
}
/* Compute the query ID. Start with no timeout. */
- query->qid = DNS_HEADER_QID(qbuf);
+ query->qid = (unsigned short)DNS_HEADER_QID(qbuf);
query->timeout = 0;
/* Form the TCP query buffer by prepending qlen (as two