1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

param: remove is_default method in s3

Change-Id: Ia9c7422c5f7b56eb81ad644b369bfa36849e963e
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Garming Sam 2014-03-27 15:33:03 +13:00 committed by Michael Adam
parent 6edf710c7b
commit a7c4446bef
2 changed files with 2 additions and 42 deletions

View File

@ -1997,7 +1997,7 @@ static bool do_section(const char *pszSectionName, void *userdata)
* Determine if a particular base parameter is currently set to the default value.
*/
static bool is_default(void *base_structure, int i)
bool is_default(void *base_structure, int i)
{
void *def_ptr = ((char *)base_structure) + parm_table[i].offset;
switch (parm_table[i].type) {

View File

@ -2729,46 +2729,6 @@ bool lp_do_section(const char *pszSectionName, void *userdata)
return bRetval;
}
/***************************************************************************
Determine if a partcular base parameter is currentl set to the default value.
***************************************************************************/
static bool is_default(int i)
{
switch (parm_table[i].type) {
case P_LIST:
case P_CMDLIST:
return str_list_equal((const char * const *)parm_table[i].def.lvalue,
*(const char ***)lp_parm_ptr(NULL,
&parm_table[i]));
case P_STRING:
case P_USTRING:
return strequal(parm_table[i].def.svalue,
*(char **)lp_parm_ptr(NULL,
&parm_table[i]));
case P_BOOL:
case P_BOOLREV:
return parm_table[i].def.bvalue ==
*(bool *)lp_parm_ptr(NULL,
&parm_table[i]);
case P_CHAR:
return parm_table[i].def.cvalue ==
*(char *)lp_parm_ptr(NULL,
&parm_table[i]);
case P_INTEGER:
case P_OCTAL:
case P_ENUM:
case P_BYTES:
return parm_table[i].def.ivalue ==
*(int *)lp_parm_ptr(NULL,
&parm_table[i]);
case P_SEP:
break;
}
return false;
}
/***************************************************************************
Display the contents of the global structure.
***************************************************************************/
@ -2784,7 +2744,7 @@ static void dump_globals(FILE *f, bool show_defaults)
if (parm_table[i].p_class == P_GLOBAL &&
!(parm_table[i].flags & FLAG_META) &&
(i == 0 || (parm_table[i].offset != parm_table[i - 1].offset))) {
if (show_defaults && is_default(i))
if (show_defaults && is_default(&Globals, i))
continue;
fprintf(f, "\t%s = ", parm_table[i].label);
lpcfg_print_parameter(&parm_table[i], lp_parm_ptr(NULL,