param: remove is_default method in s3
authorGarming Sam <garming@catalyst.net.nz>
Thu, 27 Mar 2014 02:33:03 +0000 (15:33 +1300)
committerMichael Adam <obnox@samba.org>
Thu, 31 Jul 2014 06:17:11 +0000 (08:17 +0200)
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>
lib/param/loadparm.c
source3/param/loadparm.c

index 8d0c4a85cd6c4b8b7280e983f672410a4685ebe2..6adeb7ed4658b8dab2b92b7d906e9dc7770c511b 100644 (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) {
index 13ab5d05227b7147afea1e4e83b17bb68010c5da..547acf8e3204ac3096982f317a3ffc356fa7fd4e 100644 (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,