From 5773f5eddb8be5ab79e744a46a1aa7916167bbb9 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 19 Jun 2008 09:43:08 +0200 Subject: [PATCH] util: remove useless compute_new_value_from_arg() Signed-off-by: Julien Danjou --- common/util.c | 23 ----------------------- common/util.h | 1 - 2 files changed, 24 deletions(-) diff --git a/common/util.c b/common/util.c index ecab308f1..2ac1e3f93 100644 --- a/common/util.c +++ b/common/util.c @@ -56,29 +56,6 @@ _warn(int line, const char *fct, const char *fmt, ...) fprintf(stderr, "\n"); } -/** Compute a value from a string containing - * an absolute or a relative number. If relative, - * add it to current_value. - * \param arg the string with the number - * \param current_value value to add the number if it's relative - * \return new value - */ -double -compute_new_value_from_arg(const char *arg, double current_value) -{ - double delta; - - if(arg && sscanf(arg, "%lf", &delta) == 1) - { - if(arg[0] == '+' || arg[0] == '-') - current_value += delta; - else - current_value = delta; - } - - return current_value; -} - /** Lookup for a function pointer from its name * in the given name_func_link_t list. * \param funcname Function name. diff --git a/common/util.h b/common/util.h index 2532d4aab..aa0f88ceb 100644 --- a/common/util.h +++ b/common/util.h @@ -300,7 +300,6 @@ void _warn(int, const char *, const char *, ...) position_t position_get_from_str(const char *); char * position_to_str(position_t); fuzzy_t fuzzy_get_from_str(const char *); -double compute_new_value_from_arg(const char *, double); void *name_func_lookup(const char *, const name_func_link_t *); const char * name_func_rlookup(void *, const name_func_link_t *); void a_exec(const char *);