summaryrefslogtreecommitdiff
path: root/contrib/ffmpeg/libavcodec/eval.c
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-03-01 03:05:13 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-03-01 03:05:13 +0100
commit1d0b3b20c34517b9d1ddf3ea347776304b0c4b44 (patch)
tree89f4fc640c2becc6f00ae08996754952ecf149c1 /contrib/ffmpeg/libavcodec/eval.c
parent09496ad3469a0ade8dbd9a351e639b78f20b7942 (diff)
downloadxine-lib-1d0b3b20c34517b9d1ddf3ea347776304b0c4b44.tar.gz
xine-lib-1d0b3b20c34517b9d1ddf3ea347776304b0c4b44.tar.bz2
Update internal FFmpeg copy.
Diffstat (limited to 'contrib/ffmpeg/libavcodec/eval.c')
-rw-r--r--contrib/ffmpeg/libavcodec/eval.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/ffmpeg/libavcodec/eval.c b/contrib/ffmpeg/libavcodec/eval.c
index 877de3552..dc0012bf6 100644
--- a/contrib/ffmpeg/libavcodec/eval.c
+++ b/contrib/ffmpeg/libavcodec/eval.c
@@ -19,7 +19,6 @@
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
*/
/**
@@ -56,7 +55,7 @@ typedef struct Parser{
double (**func2)(void *, double a, double b); // NULL terminated
char **func2_name; // NULL terminated
void *opaque;
- char **error;
+ const char **error;
#define VARS 10
double var[VARS];
} Parser;
@@ -377,10 +376,10 @@ static int verify_expr(AVEvalExpr * e) {
}
}
-AVEvalExpr * ff_parse(char *s, const char **const_name,
+AVEvalExpr * ff_parse(const char *s, const char **const_name,
double (**func1)(void *, double), const char **func1_name,
double (**func2)(void *, double, double), char **func2_name,
- char **error){
+ const char **error){
Parser p;
AVEvalExpr * e;
char w[strlen(s) + 1], * wp = w;
@@ -414,10 +413,10 @@ double ff_parse_eval(AVEvalExpr * e, double *const_value, void *opaque) {
return eval_expr(&p, e);
}
-double ff_eval2(char *s, double *const_value, const char **const_name,
+double ff_eval2(const 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, char **error){
+ void *opaque, const char **error){
AVEvalExpr * e = ff_parse(s, const_name, func1, func1_name, func2, func2_name, error);
double d;
if (!e) return NAN;
@@ -431,7 +430,7 @@ attribute_deprecated double ff_eval(char *s, double *const_value, const char **c
double (**func1)(void *, double), const char **func1_name,
double (**func2)(void *, double, double), char **func2_name,
void *opaque){
- char *error=NULL;
+ const char *error=NULL;
double ret;
ret = ff_eval2(s, const_value, const_name, func1, func1_name, func2, func2_name, opaque, &error);
if (error)
@@ -452,7 +451,7 @@ static const char *const_names[]={
"E",
0
};
-main(){
+int main(void){
int i;
printf("%f == 12.7\n", ff_eval("1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", const_values, const_names, NULL, NULL, NULL, NULL, NULL));
printf("%f == 0.931322575\n", ff_eval("80G/80Gi", const_values, const_names, NULL, NULL, NULL, NULL, NULL));
@@ -462,5 +461,6 @@ main(){
ff_eval("1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)", const_values, const_names, NULL, NULL, NULL, NULL, NULL);
STOP_TIMER("ff_eval")
}
+ return 0;
}
#endif