diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-04-12 20:22:55 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-04-12 20:22:55 +0000 |
commit | fc7e2d34cff55fd959704b7cc6cc8eb3e94a168a (patch) | |
tree | 0fc118e504f4a1635720090e7b0258cb297dae99 | |
parent | 82fdcd449ca267085b3b6191d8de43dd78bf4aac (diff) | |
download | ffmpeg-fc7e2d34cff55fd959704b7cc6cc8eb3e94a168a.tar.gz |
Fix constness for func[12] parameters in ff_parse_expr() and
ff_parse_and_eval_expr().
Change func[12] attributes from "** func" to "* const * func".
This is consistent with the semantics of the provided arrays of
functions, which are not supposed to be changed by the ff_parse_*
functions.
Also fix the GCC compilation warnings:
libavcodec/ratecontrol.c: In function ‘ff_rate_control_init’:
libavcodec/ratecontrol.c:109: warning: passing argument 3 of ‘ff_parse_expr’ discards qualifiers from pointer target type
libavcodec/eval.h:69: note: expected ‘double (**)(void *, double)’ but argument is of type ‘double (* const*)(void *, double)’
Originally committed as revision 22860 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/eval.c | 12 | ||||
-rw-r--r-- | libavcodec/eval.h | 9 |
2 files changed, 11 insertions, 10 deletions
diff --git a/libavcodec/eval.c b/libavcodec/eval.c index 6cc597faaf..0b2aed9ddc 100644 --- a/libavcodec/eval.c +++ b/libavcodec/eval.c @@ -34,9 +34,9 @@ typedef struct Parser{ char *s; const double *const_value; const char * const *const_name; // NULL terminated - double (**func1)(void *, double a); // NULL terminated + double (* const *func1)(void *, double a); // NULL terminated const char * const *func1_name; // NULL terminated - double (**func2)(void *, double a, double b); // NULL terminated + double (* const *func2)(void *, double a, double b); // NULL terminated const char * const *func2_name; // NULL terminated void *opaque; const char **error; @@ -370,8 +370,8 @@ static int verify_expr(AVExpr * e) { } AVExpr *ff_parse_expr(const char *s, const char * const *const_name, - double (**func1)(void *, double), const char * const *func1_name, - double (**func2)(void *, double, double), const char * const *func2_name, + double (* const *func1)(void *, double), const char * const *func1_name, + double (* const *func2)(void *, double, double), const char * const *func2_name, const char **error){ Parser p; AVExpr *e = NULL; @@ -413,8 +413,8 @@ double ff_eval_expr(AVExpr * e, const double *const_value, void *opaque) { } double ff_parse_and_eval_expr(const char *s, const double *const_value, const char * const *const_name, - double (**func1)(void *, double), const char * const *func1_name, - double (**func2)(void *, double, double), const char * const *func2_name, + double (* const *func1)(void *, double), const char * const *func1_name, + double (* const *func2)(void *, double, double), const char * const *func2_name, void *opaque, const char **error){ AVExpr * e = ff_parse_expr(s, const_name, func1, func1_name, func2, func2_name, error); double d; diff --git a/libavcodec/eval.h b/libavcodec/eval.h index 86d808c37e..9ba5571cd7 100644 --- a/libavcodec/eval.h +++ b/libavcodec/eval.h @@ -44,8 +44,8 @@ typedef struct AVExpr AVExpr; * @return the value of the expression */ double ff_parse_and_eval_expr(const char *s, const double *const_value, const char * const *const_name, - double (**func1)(void *, double), const char * const *func1_name, - double (**func2)(void *, double, double), const char * const *func2_name, + double (* const *func1)(void *, double), const char * const *func1_name, + double (* const *func2)(void *, double, double), const char * const *func2_name, void *opaque, const char **error); /** @@ -61,9 +61,10 @@ double ff_parse_and_eval_expr(const char *s, const double *const_value, const ch * @return AVExpr which must be freed with ff_free_expr() by the user when it is not needed anymore * NULL if anything went wrong */ + AVExpr *ff_parse_expr(const char *s, const char * const *const_name, - double (**func1)(void *, double), const char * const *func1_name, - double (**func2)(void *, double, double), const char * const *func2_name, + double (* const *func1)(void *, double), const char * const *func1_name, + double (* const *func2)(void *, double, double), const char * const *func2_name, const char **error); /** |