From a23423f4c90120a7d36b950934eef31a80b93a85 Mon Sep 17 00:00:00 2001 From: Daniel Salzman <daniel.salzman@nic.cz> Date: Wed, 20 Feb 2013 10:27:47 +0100 Subject: [PATCH] Fix compile warnings --- src/knot/ctl/remote.c | 2 +- src/knot/server/zones.c | 2 +- src/knot/zone/zone-load.c | 16 +++++++++------- src/tests/libknot/libknot/rrset_tests.c | 7 ++++--- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/knot/ctl/remote.c b/src/knot/ctl/remote.c index 1cbd19b71..24745bee0 100644 --- a/src/knot/ctl/remote.c +++ b/src/knot/ctl/remote.c @@ -560,7 +560,7 @@ int remote_query_append(knot_packet_t *qry, knot_rrset_t *data) } uint8_t *sp = qry->wireformat + qry->size; - uint8_t *np = qry->wireformat + qry->max_size; +// uint8_t *np = qry->wireformat + qry->max_size; uint8_t *p = sp; for (uint16_t i = 0; i < knot_rrset_rdata_rr_count(data); i++) { assert(0); diff --git a/src/knot/server/zones.c b/src/knot/server/zones.c index 28995e2da..bcd677732 100644 --- a/src/knot/server/zones.c +++ b/src/knot/server/zones.c @@ -21,7 +21,7 @@ #include "common/prng.h" #include "libknot/dname.h" #include "libknot/util/wire.h" -#include "knot/zone/zone-dump-text.h" +#include "libknot/zone/zone-dump.h" #include "knot/zone/zone-load.h" #include "libknot/zone/zone.h" #include "libknot/zone/zonedb.h" diff --git a/src/knot/zone/zone-load.c b/src/knot/zone/zone-load.c index 338ed7752..dd8f5d7f5 100644 --- a/src/knot/zone/zone-load.c +++ b/src/knot/zone/zone-load.c @@ -25,6 +25,7 @@ #include <fcntl.h> #include <time.h> #include <unistd.h> +#include <inttypes.h> #include "common/crc.h" #include "libknot/common.h" @@ -43,12 +44,13 @@ * \retval 1 when x > y. * \retval -1 when x < y. */ -static int timet_cmp(time_t x, time_t y) +/*static int timet_cmp(time_t x, time_t y) { if (x > y) return 1; if (x < y) return -1; return 0; } +*/ /* ZONE LOADING FROM FILE USING RAGEL PARSER */ @@ -215,11 +217,11 @@ static void process_error(const scanner_t *s) { err_count++; if (s->stop == true) { - log_zone_error("FATAL ERROR=%s on line=%llu\n", knot_strerror(s->error_code), - s->line_counter); + log_zone_error("FATAL ERROR=%s on line=%"PRIu64"\n", + knot_strerror(s->error_code), s->line_counter); } else { - log_zone_error("ERROR=%s on line=%llu\n", knot_strerror(s->error_code), - s->line_counter); + log_zone_error("ERROR=%s on line=%"PRIu64"\n", + knot_strerror(s->error_code), s->line_counter); } fflush(stdout); } @@ -701,8 +703,8 @@ knot_zone_t *knot_zload_load(zloader_t *loader) } if (loader->file_loader->scanner->error_counter > 0) { - log_zone_error("Zone could not be loaded due to %llu errors " - "encountered.\n", + log_zone_error("Zone could not be loaded due to %"PRIu64" errors" + " encountered.\n", loader->file_loader->scanner->error_counter); rrset_list_delete(&c->node_rrsigs); knot_zone_t *zone_to_free = c->current_zone->zone; diff --git a/src/tests/libknot/libknot/rrset_tests.c b/src/tests/libknot/libknot/rrset_tests.c index ca3a2e216..ae248df21 100644 --- a/src/tests/libknot/libknot/rrset_tests.c +++ b/src/tests/libknot/libknot/rrset_tests.c @@ -20,6 +20,7 @@ #include "tests/libknot/libknot/rrset_tests.h" #include "common/descriptor_new.h" #include "common/errcode.h" +#include "common/print.h" #include "libknot/rrset.h" #include "libknot/util/wire.h" #include "common/mempattern.h" @@ -732,9 +733,9 @@ static int test_rrset_to_wire() diag("RDATA of RRSet %d are wrongly converted.\n", i); failed = 1; - hex_print(wire + test_rrset_array[i].header_wire_size, + hex_print((char *)(wire + test_rrset_array[i].header_wire_size), test_rrset_array[i].rdata_wire_size); - hex_print(test_rrset_array[i].rdata_wire, + hex_print((char *)(test_rrset_array[i].rdata_wire), test_rrset_array[i].rdata_wire_size); } } @@ -1046,7 +1047,7 @@ static int test_rrset_compare_rdata() // return 0; // } -// return 1; + return 1; } static int test_rrset_compare() -- GitLab