aboutsummaryrefslogtreecommitdiff
path: root/src/or/eventdns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-11-14 01:07:52 +0000
committerNick Mathewson <nickm@torproject.org>2006-11-14 01:07:52 +0000
commit9243e5417704656dbfee91d2b6e06ae19f70aa24 (patch)
tree4a1957e97e4c4d36e0af0e74da1a5162fd60b1dc /src/or/eventdns.c
parent0f6402f17b9d4017aec608b10cb031512c543bc5 (diff)
downloadtor-9243e5417704656dbfee91d2b6e06ae19f70aa24.tar
tor-9243e5417704656dbfee91d2b6e06ae19f70aa24.tar.gz
r9313@totoro: nickm | 2006-11-13 20:07:41 -0500
Try to compile with fewer warnings on irix64's MIPSpro compiler / environment, which apparently believes that: - off_t can be bigger than size_t. - only mean kids assign things they do not subsequently inspect. I don't try to fix the "error" that makes it say: cc-3970 cc: WARNING File = main.c, Line = 1277 conversion from pointer to same-sized integral type (potential portability problem) uintptr_t sig = (uintptr_t)arg; Because really, what can you do about a compiler that claims to be c99 but doesn't understand that void* x = NULL; uintptr_t y = (uintptr_t) x; is safe? svn:r8948
Diffstat (limited to 'src/or/eventdns.c')
-rw-r--r--src/or/eventdns.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/or/eventdns.c b/src/or/eventdns.c
index 39640cf88..740801ad3 100644
--- a/src/or/eventdns.c
+++ b/src/or/eventdns.c
@@ -887,6 +887,8 @@ reply_parse(u8 *packet, int length) {
GET16(answers);
GET16(authority);
GET16(additional);
+ (void) authority;
+ (void) additional;
req = request_find_from_trans_id(trans_id);
if (!req) return -1;
@@ -1224,7 +1226,7 @@ evdns_request_data_build(const char *const name, const int name_len, const u16 t
APPEND16(class);
#undef APPEND16
- return j;
+ return (int)j;
}
// this is a libevent callback function which is called when a request
@@ -1792,6 +1794,7 @@ search_make_new(const struct search_state *const state, int n, const char *const
// we ran off the end of the list and still didn't find the requested string
abort();
+ return NULL; /* unreachable. */
}
static int
@@ -2005,10 +2008,12 @@ evdns_resolv_conf_parse(int flags, const char *const filename) {
}
if (st.st_size > 65535) { err = 3; goto out1; } // no resolv.conf should be any bigger
- resolv = (u8 *) malloc(st.st_size + 1);
+ resolv = (u8 *) malloc((size_t)st.st_size + 1);
if (!resolv) { err = 4; goto out1; }
- if (read(fd, resolv, st.st_size) != st.st_size) { err = 5; goto out2; }
+ if (read(fd, resolv, (size_t)st.st_size) != st.st_size) {
+ err = 5; goto out2;
+ }
resolv[st.st_size] = 0; // we malloced an extra byte
start = (char *) resolv;