From df8c9ee4819c97089664ccc035eb2aa7569034fd Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Sun, 14 May 2000 02:02:24 +0000 Subject: [PATCH] Fixed these warnings: "rdata.c", line 164: remark(1174): variable "octdigits" was declared but never referenced This was true; octdigits was used in no lib/dns/**/* files. "rdata.c", line 1485: remark(1506): implicit conversion from "unsigned long" to "int": rounding, sign extension, or loss of accuracy may result "rdata.c", line 1493: remark(1506): implicit conversion from "unsigned long" to "int": rounding, sign extension, or loss of accuracy may result "rdata.c", line 1501: remark(1506): implicit conversion from "unsigned long" to "int": rounding, sign extension, or loss of accuracy may result These three were all in atob_tobuffer, where the value of stroul was being assigned to an isc_int32_t, which is typedef'd from int and possibly smaller than long (definitely on the IRIX machine). The variables in question were changed from isc_int32_t to long. --- lib/dns/rdata.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index c71613257c..8f8626ce1a 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: rdata.c,v 1.88 2000/05/09 22:22:12 tale Exp $ */ +/* $Id: rdata.c,v 1.89 2000/05/14 02:02:24 tale Exp $ */ #include @@ -161,7 +161,6 @@ mem_maybedup(isc_mem_t *mctx, void *source, size_t length) { static const char hexdigits[] = "0123456789abcdef"; static const char decdigits[] = "0123456789"; -static const char octdigits[] = "01234567"; #include "code.h" @@ -1454,7 +1453,7 @@ putbyte(int c, isc_buffer_t *target, struct state *state) { static isc_result_t atob_tobuffer(isc_lex_t *lexer, isc_buffer_t *target) { - isc_int32_t oeor, osum, orot; + long oeor, osum, orot; struct state statebuf, *state= &statebuf; isc_token_t token; char c; @@ -1482,7 +1481,7 @@ atob_tobuffer(isc_lex_t *lexer, isc_buffer_t *target) { * Checksum. */ RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - oeor = strtoul(token.value.as_pointer, &e, 16); + oeor = strtol(token.value.as_pointer, &e, 16); if (*e != 0) return (DNS_R_SYNTAX); @@ -1490,7 +1489,7 @@ atob_tobuffer(isc_lex_t *lexer, isc_buffer_t *target) { * Checksum. */ RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - osum = strtoul(token.value.as_pointer, &e, 16); + osum = strtol(token.value.as_pointer, &e, 16); if (*e != 0) return (DNS_R_SYNTAX); @@ -1498,7 +1497,7 @@ atob_tobuffer(isc_lex_t *lexer, isc_buffer_t *target) { * Checksum. */ RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); - orot = strtoul(token.value.as_pointer, &e, 16); + orot = strtol(token.value.as_pointer, &e, 16); if (*e != 0) return (DNS_R_SYNTAX);