Fixes for pedantic warnings

This commit is contained in:
Willem Toorop 2016-12-08 16:27:43 +01:00
parent ce41258b14
commit 39f854d2b3
4 changed files with 32 additions and 20 deletions

View File

@ -83,7 +83,7 @@ default_eventloop_schedule(getdns_eventloop *loop,
#endif
default_loop->fd_events[fd] = event;
default_loop->fd_timeout_times[fd] = get_now_plus(timeout);
event->ev = (void *) (intptr_t) fd + 1;
event->ev = (void *) (intptr_t) (fd + 1);
DEBUG_SCHED( "scheduled read/write at %d\n", fd);
return GETDNS_RETURN_GOOD;
@ -104,7 +104,7 @@ default_eventloop_schedule(getdns_eventloop *loop,
if (default_loop->timeout_events[i] == NULL) {
default_loop->timeout_events[i] = event;
default_loop->timeout_times[i] = get_now_plus(timeout);
event->ev = (void *) (intptr_t) i + 1;
event->ev = (void *) (intptr_t) (i + 1);
DEBUG_SCHED( "scheduled timeout at %d\n", (int)i);
return GETDNS_RETURN_GOOD;
@ -159,6 +159,9 @@ default_eventloop_cleanup(getdns_eventloop *loop)
static void
default_read_cb(int fd, getdns_eventloop_event *event)
{
#if !defined(SCHED_DEBUG) || !SCHED_DEBUG
(void)fd;
#endif
DEBUG_SCHED( "%s(fd: %d, event: %p)\n", __FUNCTION__, fd, event);
event->read_cb(event->userarg);
}
@ -166,6 +169,9 @@ default_read_cb(int fd, getdns_eventloop_event *event)
static void
default_write_cb(int fd, getdns_eventloop_event *event)
{
#if !defined(SCHED_DEBUG) || !SCHED_DEBUG
(void)fd;
#endif
DEBUG_SCHED( "%s(fd: %d, event: %p)\n", __FUNCTION__, fd, event);
event->write_cb(event->userarg);
}
@ -173,6 +179,9 @@ default_write_cb(int fd, getdns_eventloop_event *event)
static void
default_timeout_cb(int fd, getdns_eventloop_event *event)
{
#if !defined(SCHED_DEBUG) || !SCHED_DEBUG
(void)fd;
#endif
DEBUG_SCHED( "%s(fd: %d, event: %p)\n", __FUNCTION__, fd, event);
event->timeout_cb(event->userarg);
}

View File

@ -1284,6 +1284,9 @@ static void request_cb(
getdns_return_t r = GETDNS_RETURN_GOOD;
uint32_t n, rcode, dnssec_status;
#if !defined(SERVER_DEBUG) || !SERVER_DEBUG
(void)transaction_id;
#endif
DEBUG_SERVER("reply for: %p %"PRIu64" %d (edns0: %d, do: %d, ad: %d,"
" cd: %d)\n", msg, transaction_id, (int)callback_type,
msg->has_edns0, msg->do_bit, msg->ad_bit, msg->cd_bit);

View File

@ -278,29 +278,29 @@ typedef struct getdns_dns_req {
getdns_append_name_t append_name;
const uint8_t *suffix;
size_t suffix_len;
int suffix_appended : 1;
unsigned suffix_appended : 1;
/* canceled flag */
int canceled : 1;
unsigned canceled : 1;
/* request extensions */
int dnssec_return_status : 1;
int dnssec_return_only_secure : 1;
int dnssec_return_all_statuses : 1;
int dnssec_return_validation_chain : 1;
int dnssec_return_full_validation_chain : 1;
unsigned dnssec_return_status : 1;
unsigned dnssec_return_only_secure : 1;
unsigned dnssec_return_all_statuses : 1;
unsigned dnssec_return_validation_chain : 1;
unsigned dnssec_return_full_validation_chain : 1;
#ifdef DNSSEC_ROADBLOCK_AVOIDANCE
int dnssec_roadblock_avoidance : 1;
int avoid_dnssec_roadblocks : 1;
unsigned dnssec_roadblock_avoidance : 1;
unsigned avoid_dnssec_roadblocks : 1;
#endif
int edns_cookies : 1;
int edns_client_subnet_private : 1;
int return_call_reporting : 1;
int add_warning_for_bad_dns : 1;
unsigned edns_cookies : 1;
unsigned edns_client_subnet_private : 1;
unsigned return_call_reporting : 1;
unsigned add_warning_for_bad_dns : 1;
/* Internally used by return_validation_chain */
int dnssec_ok_checking_disabled : 1;
int is_sync_request : 1;
unsigned dnssec_ok_checking_disabled : 1;
unsigned is_sync_request : 1;
/* The validating and freed variables are used to make sure a single
* code path is followed while processing a DNS request, even when
@ -310,7 +310,7 @@ typedef struct getdns_dns_req {
* validating is touched by _getdns_get_validation_chain only and
* freed is touched by _getdns_submit_netreq only
*/
int validating : 1;
unsigned validating : 1;
int *freed;
uint16_t tls_query_padding_blocksize;

View File

@ -115,9 +115,9 @@ typedef struct my_event {
} my_event;
#define AS_UB_LOOP(x) \
(((union {struct ub_event_base* a; _getdns_ub_loop* b;})x).b)
((_getdns_ub_loop *)(x))
#define AS_MY_EVENT(x) \
(((union {struct ub_event* a; my_event* b;})x).b)
((my_event *)(x))
static void my_event_base_free(struct ub_event_base* base)
{