diff --git a/CHANGES b/CHANGES index 099958ff9f..a362a82e2f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ + 202. [func] isc_lex_getsourceline() changed from returning int + to returning unsigned long, the type of its underlying + counter. + 201. [cleanup] Removed the test/sdig program, it has been replaced by bin/dig/dig. diff --git a/bin/tests/lex_test.c b/bin/tests/lex_test.c index f74c811b84..c11d1c322a 100644 --- a/bin/tests/lex_test.c +++ b/bin/tests/lex_test.c @@ -135,7 +135,7 @@ main(int argc, char *argv[]) { if (!quiet) { char *name = isc_lex_getsourcename(lex); print_token(&token, stdout); - printf(" line = %d file = %s\n", + printf(" line = %lu file = %s\n", isc_lex_getsourceline(lex), (name == NULL) ? "" : name); } diff --git a/lib/dns/config/confndc.c b/lib/dns/config/confndc.c index a966ff6880..7e4c9cd274 100644 --- a/lib/dns/config/confndc.c +++ b/lib/dns/config/confndc.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: confndc.c,v 1.14 2000/05/13 19:45:13 tale Exp $ */ +/* $Id: confndc.c,v 1.15 2000/05/24 15:07:58 tale Exp $ */ /* ** options { @@ -1451,7 +1451,7 @@ parser_complain(isc_boolean_t is_warning, isc_boolean_t print_last_token, static char message[2048]; int level = ISC_LOG_CRITICAL; const char *filename = isc_lex_getsourcename(pctx->thelexer); - int lineno = isc_lex_getsourceline(pctx->thelexer); + unsigned long lineno = isc_lex_getsourceline(pctx->thelexer); /* * We can't get a trace of the include files we may be nested in @@ -1464,7 +1464,7 @@ parser_complain(isc_boolean_t is_warning, isc_boolean_t print_last_token, if (is_warning) level = ISC_LOG_WARNING; - sprintf(where, "%s:%d: ", filename, lineno); + sprintf(where, "%s:%lu: ", filename, lineno); vsnprintf(message, sizeof(message), format, args); if (print_last_token) { diff --git a/lib/dns/config/confparser.y b/lib/dns/config/confparser.y index 6f7481d68e..9f137d92a5 100644 --- a/lib/dns/config/confparser.y +++ b/lib/dns/config/confparser.y @@ -16,7 +16,7 @@ * SOFTWARE. */ -/* $Id: confparser.y,v 1.82 2000/05/18 23:20:18 brister Exp $ */ +/* $Id: confparser.y,v 1.83 2000/05/24 15:07:59 tale Exp $ */ #include @@ -5223,33 +5223,33 @@ yylex(void) case ISC_R_UNBALANCED: parser_error(ISC_TRUE, - "%s: %d: unbalanced parentheses", + "%s: %lu: unbalanced parentheses", isc_lex_getsourcename(mylexer), - (int)isc_lex_getsourceline(mylexer)); + isc_lex_getsourceline(mylexer)); res = -1; break; case ISC_R_NOSPACE: parser_error(ISC_TRUE, - "%s: %d: token too big.", + "%s: %lu: token too big.", isc_lex_getsourcename(mylexer), - (int)isc_lex_getsourceline(mylexer)); + isc_lex_getsourceline(mylexer)); res = -1; break; case ISC_R_UNEXPECTEDEND: parser_error(ISC_TRUE, - "%s: %d: unexpected EOF", + "%s: %lu: unexpected EOF", isc_lex_getsourcename(mylexer), - (int)isc_lex_getsourceline(mylexer)); + isc_lex_getsourceline(mylexer)); res = -1; break; default: parser_error(ISC_TRUE, - "%s: %d unknown lexer error (%d)", + "%s: %lu unknown lexer error (%d)", isc_lex_getsourcename(mylexer), - (int)isc_lex_getsourceline(mylexer), + isc_lex_getsourceline(mylexer), (int)res); res = -1; break; @@ -5350,7 +5350,7 @@ parser_complain(isc_boolean_t is_warning, isc_boolean_t print_last_token, static char message[2048]; int level = ISC_LOG_ERROR; const char *filename = isc_lex_getsourcename(mylexer); - int lineno = isc_lex_getsourceline(mylexer); + unsigned long lineno = isc_lex_getsourceline(mylexer); /* * We can't get a trace of the include files we may be nested in @@ -5365,7 +5365,7 @@ parser_complain(isc_boolean_t is_warning, isc_boolean_t print_last_token, level = ISC_LOG_WARNING; } - sprintf(where, "%s:%d: ", filename, lineno); + sprintf(where, "%s:%lu: ", filename, lineno); if ((unsigned int)vsprintf(message, format, args) >= sizeof message) FATAL_ERROR(__FILE__, __LINE__, "error message would overflow"); diff --git a/lib/dns/master.c b/lib/dns/master.c index d1a8626105..22783b9e2c 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: master.c,v 1.52 2000/05/08 14:34:42 tale Exp $ */ +/* $Id: master.c,v 1.53 2000/05/24 15:07:55 tale Exp $ */ #include @@ -147,7 +147,7 @@ gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *token, if (token->type == isc_tokentype_eol || token->type == isc_tokentype_eof) { (*callbacks->error)(callbacks, - "dns_master_load: %s:%d: unexpected end of %s", + "dns_master_load: %s:%lu: unexpected end of %s", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex), (token->type == @@ -274,7 +274,7 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, if (token.type == isc_tokentype_initialws) { if (!current_known) { (*callbacks->error)(callbacks, - "%s: %s:%d: No current owner name", + "%s: %s:%lu: No current owner name", "dns_master_load", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex)); @@ -309,10 +309,13 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, goto cleanup; if (ctx->ttl > 0x7fffffffUL) { (callbacks->warn)(callbacks, - "dns_master_load: %s:%d: $TTL %lu > MAXTTL, setting $TTL to 0", - isc_lex_getsourcename(lex), - isc_lex_getsourceline(lex), - ctx->ttl); + "%s: %s:%lu: " + "$TTL %lu > MAXTTL, " + "setting $TTL to 0", + "dns_master_load", + isc_lex_getsourcename(lex), + isc_lex_getsourceline(lex), + ctx->ttl); ctx->ttl = 0; } ctx->default_ttl = ctx->ttl; @@ -323,8 +326,9 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, "$INCLUDE") == 0) { if (ttl_offset != 0) { (callbacks->error)(callbacks, - "dns_master_load: %s:%d: $INCLUDE " + "%s: %s:%lu: $INCLUDE " "may not be used with $DATE", + "dns_master_load", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex)); goto cleanup; @@ -379,16 +383,18 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, dump_time = (isc_stdtime_t)dump_time64; if (dump_time != dump_time64) { UNEXPECTED_ERROR(__FILE__, __LINE__, - "dns_master_load: %s:%d: " + "%s: %s:%lu: " "$DATE outside epoch", + "dns_master_load", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex)); goto cleanup; } if (dump_time > current_time) { UNEXPECTED_ERROR(__FILE__, __LINE__, - "dns_master_load: %s:%d: " + "%s: %s:%lu: " "$DATE in future, using current date", + "dns_master_load", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex)); dump_time = current_time; @@ -399,8 +405,9 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, } else if (strncasecmp(token.value.as_pointer, "$", 1) == 0) { (callbacks->error)(callbacks, - "dns_master_load: %s:%d: " + "%s: %s:%lu: " "unknown $ directive '%s'", + "dns_master_load", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex), token.value.as_pointer); @@ -524,7 +531,8 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, } } else { UNEXPECTED_ERROR(__FILE__, __LINE__, - "%s:%d: isc_lex_gettoken() returned unexpeced token type (%d)", + "%s:%lu: isc_lex_gettoken() returned " + "unexpeced token type (%d)", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex), token.type); @@ -555,10 +563,13 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, == ISC_R_SUCCESS) { if (ctx->ttl > 0x7fffffffUL) { (callbacks->warn)(callbacks, - "dns_master_load: %s:%d: TTL %lu > MAXTTL, setting TTL to 0", - isc_lex_getsourcename(lex), - isc_lex_getsourceline(lex), - ctx->ttl); + "%s: %s:%lu: " + "TTL %lu > MAXTTL, " + "setting TTL to 0", + "dns_master_load", + isc_lex_getsourcename(lex), + isc_lex_getsourceline(lex), + ctx->ttl); ctx->ttl = 0; } ctx->ttl_known = ISC_TRUE; @@ -568,7 +579,7 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, * BIND 4 / 8 'USE_SOA_MINIMUM' could be set here. */ (*callbacks->error)(callbacks, - "%s: %s:%d: no TTL specified", + "%s: %s:%lu: no TTL specified", "dns_master_load", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex)); @@ -578,7 +589,8 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, ctx->ttl = ctx->default_ttl; } else if (ctx->warn_1035) { (*callbacks->warn)(callbacks, - "%s: %s:%d: using RFC 1035 TTL semantics", + "%s: %s:%lu: " + "using RFC 1035 TTL semantics", "dns_master_load", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex)); @@ -644,7 +656,8 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, isc_buffer_usedregion(&buffer, ®ion); len2 = region.length; (*callbacks->error)(callbacks, - "%s: %s:%d: class (%.*s) != zone class (%.*s)", + "%s: %s:%lu: class (%.*s) != " + "zone class (%.*s)", "dns_master_load", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex), @@ -744,7 +757,8 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin, ISC_LIST_PREPEND(current_list, this, link); } else if (this->ttl != ctx->ttl) { (*callbacks->warn)(callbacks, - "%s: %s:%d: TTL set to prior TTL (%lu)", + "%s: %s:%lu: " + "TTL set to prior TTL (%lu)", "dns_master_load", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex), @@ -1063,7 +1077,9 @@ commit(dns_rdatacallbacks_t *callbacks, isc_lex_t *lex, * Ignore out-of-zone data. */ (callbacks->warn)(callbacks, - "dns_master_load: %s:%d: ignoring out-of-zone data", + "%s: %s:%lu: " + "ignoring out-of-zone data", + "dns_master_load", isc_lex_getsourcename(lex), isc_lex_getsourceline(lex)); ignore = ISC_TRUE; diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index 743a972754..382fd58ad1 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: rdata.c,v 1.95 2000/05/24 05:09:12 tale Exp $ */ +/* $Id: rdata.c,v 1.96 2000/05/24 15:07:56 tale Exp $ */ #include #include @@ -131,7 +131,7 @@ default_fromtext_callback(dns_rdatacallbacks_t *callbacks, char *, ...); static void fromtext_error(void (*callback)(dns_rdatacallbacks_t *, char *, ...), - dns_rdatacallbacks_t *callbacks, char *name, int line, + dns_rdatacallbacks_t *callbacks, char *name, unsigned long line, isc_token_t *token, isc_result_t result); static isc_result_t @@ -431,7 +431,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass, unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF | ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE; char *name; - int line; + unsigned long line; void (*callback)(dns_rdatacallbacks_t *, char *, ...); isc_result_t iresult; @@ -1620,7 +1620,7 @@ default_fromtext_callback(dns_rdatacallbacks_t *callbacks, char *fmt, ...) { static void fromtext_error(void (*callback)(dns_rdatacallbacks_t *, char *, ...), - dns_rdatacallbacks_t *callbacks, char *name, int line, + dns_rdatacallbacks_t *callbacks, char *name, unsigned long line, isc_token_t *token, isc_result_t result) { if (name == NULL) @@ -1629,36 +1629,36 @@ fromtext_error(void (*callback)(dns_rdatacallbacks_t *, char *, ...), if (token != NULL) { switch (token->type) { case isc_tokentype_eol: - (*callback)(callbacks, "%s: %s:%d: near eol: %s", + (*callback)(callbacks, "%s: %s:%lu: near eol: %s", "dns_rdata_fromtext", name, line, dns_result_totext(result)); break; case isc_tokentype_eof: - (*callback)(callbacks, "%s: %s:%d: near eof: %s", + (*callback)(callbacks, "%s: %s:%lu: near eof: %s", "dns_rdata_fromtext", name, line, dns_result_totext(result)); break; case isc_tokentype_number: - (*callback)(callbacks, "%s: %s:%d: near %lu: %s", + (*callback)(callbacks, "%s: %s:%lu: near %lu: %s", "dns_rdata_fromtext", name, line, token->value.as_ulong, dns_result_totext(result)); break; case isc_tokentype_string: case isc_tokentype_qstring: - (*callback)(callbacks, "%s: %s:%d: near '%s': %s", + (*callback)(callbacks, "%s: %s:%lu: near '%s': %s", "dns_rdata_fromtext", name, line, (char *)token->value.as_pointer, dns_result_totext(result)); break; default: - (*callback)(callbacks, "%s: %s:%d: %s", + (*callback)(callbacks, "%s: %s:%lu: %s", "dns_rdata_fromtext", name, line, dns_result_totext(result)); break; } } else { - (*callback)(callbacks, "dns_rdata_fromtext: %s:%d: %s", + (*callback)(callbacks, "dns_rdata_fromtext: %s:%lu: %s", name, line, dns_result_totext(result)); } }