From: Evan Hunt Date: Fri, 7 Mar 2014 01:21:19 +0000 (-0800) Subject: [master] fix misuses of isc__buffer functions, update comment X-Git-Tag: v9.10.0b2~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e29c2b3903569a5101eac21e7210174e56957eca;p=thirdparty%2Fbind9.git [master] fix misuses of isc__buffer functions, update comment --- diff --git a/bin/named/query.c b/bin/named/query.c index 5ea95157edc..2fc7d334ecc 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -2301,7 +2301,7 @@ query_dns64(ns_client_t *client, dns_name_t **namep, dns_rdataset_t *rdataset, dns64 != NULL; dns64 = dns_dns64_next(dns64)) { dns_rdataset_current(rdataset, &rdata); - isc__buffer_availableregion(buffer, &r); + isc_buffer_availableregion(buffer, &r); INSIST(r.length >= 16); result = dns_dns64_aaaafroma(dns64, &netaddr, client->signer, diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index d534cff9667..c7cd28627fc 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -2135,12 +2135,12 @@ check_tsig_error(dns_rdataset_t *rdataset, isc_buffer_t *b) { if (tsig.error != 0) { if (isc_buffer_remaininglength(b) < 1) check_result(ISC_R_NOSPACE, "isc_buffer_remaininglength"); - isc__buffer_putstr(b, "(" /*)*/); + isc_buffer_putstr(b, "(" /*)*/); result = dns_tsigrcode_totext(tsig.error, b); check_result(result, "dns_tsigrcode_totext"); if (isc_buffer_remaininglength(b) < 1) check_result(ISC_R_NOSPACE, "isc_buffer_remaininglength"); - isc__buffer_putstr(b, /*(*/ ")"); + isc_buffer_putstr(b, /*(*/ ")"); } } diff --git a/bin/tools/isc-hmac-fixup.c b/bin/tools/isc-hmac-fixup.c index daf391a81cd..ff77be7b424 100644 --- a/bin/tools/isc-hmac-fixup.c +++ b/bin/tools/isc-hmac-fixup.c @@ -52,7 +52,7 @@ main(int argc, char **argv) { fprintf(stderr, "error: %s\n", isc_result_totext(result)); return (1); } - isc__buffer_usedregion(&buf, &r); + isc_buffer_usedregion(&buf, &r); if (!strcasecmp(argv[1], "md5") || !strcasecmp(argv[1], "hmac-md5")) { diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index ac2d086974b..5f4078e277d 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -582,8 +582,8 @@ ip2name(const dns_rpz_cidr_key_t *tgt_ip, dns_rpz_prefix_t tgt_prefix, } } - isc__buffer_init(&buffer, str, sizeof(str)); - isc__buffer_add(&buffer, len); + isc_buffer_init(&buffer, str, sizeof(str)); + isc_buffer_add(&buffer, len); result = dns_name_fromtext(ip_name, &buffer, base_name, 0, NULL); return (result); } diff --git a/lib/isc/include/isc/buffer.h b/lib/isc/include/isc/buffer.h index 5aff01c2479..f9c0775790e 100644 --- a/lib/isc/include/isc/buffer.h +++ b/lib/isc/include/isc/buffer.h @@ -664,12 +664,12 @@ ISC_LANG_ENDDECLS /*! \note * XXXDCL Something more could be done with initializing buffers that - * point to const data. For example, a new function, isc_buffer_initconst, - * could be used, and a new boolean flag in the buffer structure could - * indicate whether the buffer was initialized with that function. - * (isc_bufer_init itself would be reprototyped to *not* have its "base" - * parameter be const.) Then if the boolean were true, the isc_buffer_put* - * functions could assert a contractual requirement for a non-const buffer. + * point to const data. For example, isc_buffer_constinit() could + * set a new boolean flag in the buffer structure indicating whether + * the buffer was initialized with that function. * Then if the + * boolean were true, the isc_buffer_put* functions could assert a + * contractual requirement for a non-const buffer. + * * One drawback is that the isc_buffer_* functions (macros) that return * pointers would still need to return non-const pointers to avoid compiler * warnings, so it would be up to code that uses them to have to deal