From 8ee9f9c1cf3d2b7e3c17e9fedb9d740361bf8a69 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sat, 2 Jul 2011 21:49:07 -0400 Subject: [PATCH] Fix a few warnings on OpenBSD - redeclaration of dst_size - arpa/inet.h requires netinet/in.h first - don't use a local with the same name as a global - it isn't needed so remove it --- bufferevent_pair.c | 2 +- evutil.c | 6 +++--- ht-internal.h | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bufferevent_pair.c b/bufferevent_pair.c index 1e20f78b..38a319be 100644 --- a/bufferevent_pair.c +++ b/bufferevent_pair.c @@ -158,7 +158,7 @@ be_pair_transfer(struct bufferevent *src, struct bufferevent *dst, evbuffer_unfreeze(dst->input, 0); if (dst->wm_read.high) { - size_t dst_size = evbuffer_get_length(dst->input); + dst_size = evbuffer_get_length(dst->input); if (dst_size < dst->wm_read.high) { n = dst->wm_read.high - dst_size; evbuffer_remove_buffer(src->output, dst->input, n); diff --git a/evutil.c b/evutil.c index 9d9863a2..adfcb6e5 100644 --- a/evutil.c +++ b/evutil.c @@ -55,15 +55,15 @@ #include #include #include -#ifdef _EVENT_HAVE_ARPA_INET_H -#include -#endif #ifdef _EVENT_HAVE_NETINET_IN_H #include #endif #ifdef _EVENT_HAVE_NETINET_IN6_H #include #endif +#ifdef _EVENT_HAVE_ARPA_INET_H +#include +#endif #ifndef _EVENT_HAVE_GETTIMEOFDAY #include diff --git a/ht-internal.h b/ht-internal.h index 57624af7..d20e14df 100644 --- a/ht-internal.h +++ b/ht-internal.h @@ -223,7 +223,6 @@ ht_string_hash(const char *s) void *data) \ { \ unsigned idx; \ - int remove; \ struct type **p, **nextp, *next; \ if (!head->hth_table) \ return; \ @@ -232,8 +231,7 @@ ht_string_hash(const char *s) while (*p) { \ nextp = &(*p)->field.hte_next; \ next = *nextp; \ - remove = fn(*p, data); \ - if (remove) { \ + if (fn(*p, data)) { \ --head->hth_n_entries; \ *p = next; \ } else { \ -- 2.40.0