summaryrefslogtreecommitdiff
path: root/libavcodec/eval.c
diff options
context:
space:
mode:
authorZdenek Kabelac <kabi@informatics.muni.cz>2003-02-10 09:35:32 +0000
committerZdenek Kabelac <kabi@informatics.muni.cz>2003-02-10 09:35:32 +0000
commit5c91a6755b6412c918e20ff4735ca30f38a12569 (patch)
tree054521cdfc6d752e89883ef3fcfc05d6c31fd94c /libavcodec/eval.c
parentcd66005ddaebba2d6cb3b4eae75f70ae2446b204 (diff)
* static,const,compiler warning cleanup
Originally committed as revision 1567 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/eval.c')
-rw-r--r--libavcodec/eval.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libavcodec/eval.c b/libavcodec/eval.c
index bcaf4f59b2..1a9cce6add 100644
--- a/libavcodec/eval.c
+++ b/libavcodec/eval.c
@@ -23,6 +23,9 @@
* see http://joe.hotchkiss.com/programming/eval/eval.html
*/
+#include "avcodec.h"
+#include "mpegvideo.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -43,9 +46,9 @@ typedef struct Parser{
int stack_index;
char *s;
double *const_value;
- char **const_name; // NULL terminated
+ const char **const_name; // NULL terminated
double (**func1)(void *, double a); // NULL terminated
- char **func1_name; // NULL terminated
+ const char **func1_name; // NULL terminated
double (**func2)(void *, double a, double b); // NULL terminated
char **func2_name; // NULL terminated
void *opaque;
@@ -71,7 +74,7 @@ static double pop(Parser *p){
return p->stack[ --p->stack_index ];
}
-static int strmatch(char *s, char *prefix){
+static int strmatch(const char *s, const char *prefix){
int i;
for(i=0; prefix[i]; i++){
if(prefix[i] != s[i]) return 0;
@@ -126,7 +129,7 @@ static void evalPrimary(Parser *p){
else if( strmatch(next, "log" ) ) d= log(d);
else if( strmatch(next, "squish") ) d= 1/(1+exp(4*d));
else if( strmatch(next, "gauss" ) ) d= exp(-d*d/2)/sqrt(2*M_PI);
- else if( strmatch(next, "abs" ) ) d= abs(d);
+ else if( strmatch(next, "abs" ) ) d= fabs(d);
else if( strmatch(next, "max" ) ) d= d > d2 ? d : d2;
else if( strmatch(next, "min" ) ) d= d < d2 ? d : d2;
else if( strmatch(next, "gt" ) ) d= d > d2 ? 1.0 : 0.0;
@@ -228,8 +231,8 @@ static void evalExpression(Parser *p){
}
}
-double ff_eval(char *s, double *const_value, char **const_name,
- double (**func1)(void *, double), char **func1_name,
+double ff_eval(char *s, double *const_value, const char **const_name,
+ double (**func1)(void *, double), const char **func1_name,
double (**func2)(void *, double, double), char **func2_name,
void *opaque){
Parser p;