From cac55c91969158bd07ffcef27753f4edc79fc8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Gr=C3=B6nberg?= Date: Sun, 14 Dec 2008 12:24:50 +0000 Subject: [PATCH] =?UTF-8?q?Add=20a=20few=20const=20qualifiers=20in=20appro?= =?UTF-8?q?priate=20places.=20patch=20by=20Anders=20Gr=C3=B6nberg,=20galil?= =?UTF-8?q?eo.m2=20gmail=20com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 16120 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/eval.c | 16 ++++++++-------- libavcodec/eval.h | 10 +++++----- libavcodec/h264.c | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libavcodec/eval.c b/libavcodec/eval.c index be393a6dd0..fce6da5aa8 100644 --- a/libavcodec/eval.c +++ b/libavcodec/eval.c @@ -47,12 +47,12 @@ typedef struct Parser{ int stack_index; char *s; - double *const_value; - const char **const_name; // NULL terminated + const double *const_value; + const char * const *const_name; // NULL terminated double (**func1)(void *, double a); // NULL terminated const char **func1_name; // NULL terminated double (**func2)(void *, double a, double b); // NULL terminated - char **func2_name; // NULL terminated + const char **func2_name; // NULL terminated void *opaque; const char **error; #define VARS 10 @@ -375,9 +375,9 @@ static int verify_expr(AVEvalExpr * e) { } } -AVEvalExpr * ff_parse(const char *s, const char **const_name, +AVEvalExpr * ff_parse(const char *s, const char * const *const_name, double (**func1)(void *, double), const char **func1_name, - double (**func2)(void *, double, double), char **func2_name, + double (**func2)(void *, double, double), const char **func2_name, const char **error){ Parser p; AVEvalExpr * e; @@ -404,7 +404,7 @@ AVEvalExpr * ff_parse(const char *s, const char **const_name, return e; } -double ff_parse_eval(AVEvalExpr * e, double *const_value, void *opaque) { +double ff_parse_eval(AVEvalExpr * e, const double *const_value, void *opaque) { Parser p; p.const_value= const_value; @@ -412,9 +412,9 @@ double ff_parse_eval(AVEvalExpr * e, double *const_value, void *opaque) { return eval_expr(&p, e); } -double ff_eval2(const char *s, double *const_value, const char **const_name, +double ff_eval2(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), char **func2_name, + double (**func2)(void *, double, double), const char **func2_name, void *opaque, const char **error){ AVEvalExpr * e = ff_parse(s, const_name, func1, func1_name, func2, func2_name, error); double d; diff --git a/libavcodec/eval.h b/libavcodec/eval.h index 0918fc9b7d..c450332d3e 100644 --- a/libavcodec/eval.h +++ b/libavcodec/eval.h @@ -42,9 +42,9 @@ * @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, double *const_value, const char **const_name, +double ff_eval2(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), char **func2_name, + double (**func2)(void *, double, double), const char **func2_name, void *opaque, const char **error); typedef struct ff_expr_s AVEvalExpr; @@ -61,9 +61,9 @@ typedef struct ff_expr_s AVEvalExpr; * @return AVEvalExpr which must be freed with ff_eval_free by the user when it is not needed anymore * NULL if anything went wrong */ -AVEvalExpr * ff_parse(const char *s, const char **const_name, +AVEvalExpr * ff_parse(const char *s, const char * const *const_name, double (**func1)(void *, double), const char **func1_name, - double (**func2)(void *, double, double), char **func2_name, + double (**func2)(void *, double, double), const char **func2_name, const char **error); /** * Evaluates a previously parsed expression. @@ -71,7 +71,7 @@ AVEvalExpr * ff_parse(const char *s, const char **const_name, * @param opaque a pointer which will be passed to all functions from func1 and func2 * @return the value of the expression */ -double ff_parse_eval(AVEvalExpr * e, double *const_value, void *opaque); +double ff_parse_eval(AVEvalExpr * e, const double *const_value, void *opaque); void ff_eval_free(AVEvalExpr * e); #endif /* AVCODEC_EVAL_H */ diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a85d592807..7d57cd8d26 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -106,7 +106,7 @@ static void fill_caches(H264Context *h, int mb_type, int for_deblock){ const int mb_xy= h->mb_xy; int topleft_xy, top_xy, topright_xy, left_xy[2]; int topleft_type, top_type, topright_type, left_type[2]; - int * left_block; + const int * left_block; int topleft_partition= -1; int i;