mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Megacommit of many files.
Mostly, several functions that take pointers as arguments, almost always char * pointers, had those pointers qualified with "const". Those that returned pointers to previously const-qualified arguments had their return values qualified as const. Some structure members were qualified as const to retain that attribute from the variables from which they were assigned. The macro DE_CONST was added to isc/util.h to deal with a handful of very special places where something is qualified as const but really needs to have its const qualifier removed. Also cleaned up a few places where variable names clashed with reserved identifiers. (Which mostly works fine, but strictly speaking is undefined by the standard.) Minor other ISC style cleanups.
This commit is contained in:
@@ -188,7 +188,7 @@ isc_symtab_lookup(isc_symtab_t *symtab, const char *key, unsigned int type,
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
isc_symtab_define(isc_symtab_t *symtab, char *key, unsigned int type,
|
||||
isc_symtab_define(isc_symtab_t *symtab, const char *key, unsigned int type,
|
||||
isc_symvalue_t value, isc_symexists_t exists_policy)
|
||||
{
|
||||
unsigned int bucket;
|
||||
@@ -214,7 +214,15 @@ isc_symtab_define(isc_symtab_t *symtab, char *key, unsigned int type,
|
||||
if (elt == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
elt->key = key;
|
||||
|
||||
/*
|
||||
* Though the "key" can be const coming in, it is not stored as const
|
||||
* so that the calling program can easily have writable access to
|
||||
* it in its undefine_action function. In the event that it *was*
|
||||
* truly const coming in and then the caller modified it anyway ...
|
||||
* well, don't do that!
|
||||
*/
|
||||
DE_CONST(key, elt->key);
|
||||
elt->type = type;
|
||||
elt->value = value;
|
||||
|
||||
@@ -227,7 +235,7 @@ isc_symtab_define(isc_symtab_t *symtab, char *key, unsigned int type,
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
isc_symtab_undefine(isc_symtab_t *symtab, char *key, unsigned int type) {
|
||||
isc_symtab_undefine(isc_symtab_t *symtab, const char *key, unsigned int type) {
|
||||
unsigned int bucket;
|
||||
elt_t *elt;
|
||||
|
||||
|
Reference in New Issue
Block a user