# HG changeset patch # User stefano # Date 1271025124 0 # Node ID 414a7cdaa54d806639ad0231f32c5ae2eba1067e # Parent 6bab1bfac3bb5eaea6428909b5b44b14c1f76cf4 Rename ff_eval2() to ff_parse_and_eval_expr(). The new name better expresses what the function does. diff -r 6bab1bfac3bb -r 414a7cdaa54d eval.c --- a/eval.c Sun Apr 11 22:32:01 2010 +0000 +++ b/eval.c Sun Apr 11 22:32:04 2010 +0000 @@ -418,7 +418,7 @@ return eval_expr(&p, e); } -double ff_eval2(const char *s, const double *const_value, const char * const *const_name, +double ff_parse_and_eval_expr(const char *s, const double *const_value, const char * const *const_name, double (**func1)(void *, double), const char **func1_name, double (**func2)(void *, double, double), const char **func2_name, void *opaque, const char **error){ @@ -444,13 +444,13 @@ }; int main(void){ int i; - printf("%f == 12.7\n", ff_eval2("1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", const_values, const_names, NULL, NULL, NULL, NULL, NULL, NULL)); - printf("%f == 0.931322575\n", ff_eval2("80G/80Gi", const_values, const_names, NULL, NULL, NULL, NULL, NULL, NULL)); + printf("%f == 12.7\n", ff_parse_and_eval_expr("1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", const_values, const_names, NULL, NULL, NULL, NULL, NULL, NULL)); + printf("%f == 0.931322575\n", ff_parse_and_eval_expr("80G/80Gi", const_values, const_names, NULL, NULL, NULL, NULL, NULL, NULL)); for(i=0; i<1050; i++){ START_TIMER - ff_eval2("1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", const_values, const_names, NULL, NULL, NULL, NULL, NULL, NULL); - STOP_TIMER("ff_eval2") + ff_parse_and_eval_expr("1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", const_values, const_names, NULL, NULL, NULL, NULL, NULL, NULL); + STOP_TIMER("ff_parse_and_eval_expr") } return 0; } diff -r 6bab1bfac3bb -r 414a7cdaa54d eval.h --- a/eval.h Sun Apr 11 22:32:01 2010 +0000 +++ b/eval.h Sun Apr 11 22:32:04 2010 +0000 @@ -43,7 +43,7 @@ * @param opaque a pointer which will be passed to all functions from func1 and func2 * @return the value of the expression */ -double ff_eval2(const char *s, const double *const_value, const char * const *const_name, +double ff_parse_and_eval_expr(const char *s, const double *const_value, const char * const *const_name, double (**func1)(void *, double), const char **func1_name, double (**func2)(void *, double, double), const char **func2_name, void *opaque, const char **error); diff -r 6bab1bfac3bb -r 414a7cdaa54d opt.c --- a/opt.c Sun Apr 11 22:32:01 2010 +0000 +++ b/opt.c Sun Apr 11 22:32:04 2010 +0000 @@ -156,7 +156,7 @@ buf[i]= val[i]; buf[i]=0; - d = ff_eval2(buf, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &error); + d = ff_parse_and_eval_expr(buf, const_values, const_names, NULL, NULL, NULL, NULL, NULL, &error); if(isnan(d)) { const AVOption *o_named= av_find_opt(obj, buf, o->unit, 0, 0); if(o_named && o_named->type == FF_OPT_TYPE_CONST)