2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Rename mctx in dnstest.c to dt_mctx to prevent any global/local name clashes

The common construct seen in the BIND 9 source is func(isc_mem_t *mctx, ...).
Unfortunately, the dnstest.{h,c} has been using mctx as a global symbol, which
in turn generated a lot of errors when update.c got included in update_test.c.

As a rule of thumb, we should avoid naming global symbols with generic names
(like mctx) and we should prefix them with "namespace" (like dt_mctx).
This commit is contained in:
Ondřej Surý
2019-06-18 15:01:43 +02:00
parent 6a1f24a863
commit 52f98c5734
26 changed files with 173 additions and 170 deletions

View File

@@ -68,7 +68,7 @@ make_dispatchset(unsigned int ndisps) {
unsigned int attrs;
dns_dispatch_t *disp = NULL;
result = dns_dispatchmgr_create(mctx, &dispatchmgr);
result = dns_dispatchmgr_create(dt_mctx, &dispatchmgr);
if (result != ISC_R_SUCCESS)
return (result);
@@ -80,7 +80,7 @@ make_dispatchset(unsigned int ndisps) {
if (result != ISC_R_SUCCESS)
return (result);
result = dns_dispatchset_create(mctx, socketmgr, taskmgr, disp,
result = dns_dispatchset_create(dt_mctx, socketmgr, taskmgr, disp,
&dset, ndisps);
dns_dispatch_detach(&disp);
@@ -271,7 +271,7 @@ dispatch_getnext(void **state) {
result = isc_task_create(taskmgr, 0, &task);
assert_int_equal(result, ISC_R_SUCCESS);
result = dns_dispatchmgr_create(mctx, &dispatchmgr);
result = dns_dispatchmgr_create(dt_mctx, &dispatchmgr);
assert_int_equal(result, ISC_R_SUCCESS);
ina.s_addr = htonl(INADDR_LOOPBACK);
@@ -313,7 +313,7 @@ dispatch_getnext(void **state) {
region.base = message;
region.length = sizeof(message);
result = isc_app_onrun(mctx, task, startit, &region);
result = isc_app_onrun(dt_mctx, task, startit, &region);
assert_int_equal(result, ISC_R_SUCCESS);
result = isc_app_run();