util: remove useless compute_new_value_from_arg()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
28c16dd888
commit
5773f5eddb
|
@ -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.
|
||||
|
|
|
@ -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 *);
|
||||
|
|
Loading…
Reference in New Issue