speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] remove duplicate function


From: Trevor Saunders
Subject: [PATCH] remove duplicate function
Date: Thu, 18 Nov 2010 09:17:41 -0500

module_add_config_option() and add_config_option() where the exact same
function, so get rid of one of them, and change the only call of
add_config_option() to module_add_config_option()
---
 src/modules/module_main.c  |    2 +-
 src/modules/module_utils.c |   18 ------------------
 2 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/src/modules/module_main.c b/src/modules/module_main.c
index 99f4b04..1f6e406 100644
--- a/src/modules/module_main.c
+++ b/src/modules/module_main.c
@@ -92,7 +92,7 @@ main(int argc, char *argv[])
 
     if (configfilename != NULL){
         /* Add the LAST option */
-        module_dc_options = add_config_option(module_dc_options,
+        module_dc_options = module_add_config_option(module_dc_options,
                                               &module_num_dc_options, "", 0, 
NULL, NULL, 0);
 
         configfile = dotconf_create(configfilename, module_dc_options, 0, 
CASE_INSENSITIVE);
diff --git a/src/modules/module_utils.c b/src/modules/module_utils.c
index 9fe907e..dd8bf00 100644
--- a/src/modules/module_utils.c
+++ b/src/modules/module_utils.c
@@ -1027,24 +1027,6 @@ module_get_ht_option(GHashTable *hash_table, const char 
*key)
     return option;
 }
 
-
-configoption_t *
-add_config_option(configoption_t *options, int *num_config_options, char 
*name, int type,
-                  dotconf_callback_t callback, info_t *info,
-                  unsigned long context)
-{
-    configoption_t *opts;
-
-    (*num_config_options)++;
-    opts = (configoption_t*) g_realloc(options, (*num_config_options) * 
sizeof(configoption_t));
-    opts[*num_config_options-1].name = g_strdup(name);
-    opts[*num_config_options-1].type = type;
-    opts[*num_config_options-1].callback = callback;
-    opts[*num_config_options-1].info = info;
-    opts[*num_config_options-1].context = context;
-    return opts;
-}
-
 int
 module_utils_init(void)
 {
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]