History

eval: fix swapping of lt() and lte()

Max Lazarov committed 14 years ago

Commit caac3ab1 parent f30260d2 files · +5 −5Browse files

Unified · Split

2 files
  1. libavutil/eval.c +2 −2
  2. tests/ref/fate/eval +3 −3
libavutil/eval.c+2−2
@@ -279,8 +279,8 @@ static int parse_primary(AVExpr **e, Parser *p) · 278 unmodified lines
279279 else if (strmatch(next, "eq" )) d->type = e_eq;
280280 else if (strmatch(next, "gte" )) d->type = e_gte;
281281 else if (strmatch(next, "gt" )) d->type = e_gt;
282− else if (strmatch(next, "lte" )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gt; }
283− else if (strmatch(next, "lt" )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gte; }
282+ else if (strmatch(next, "lte" )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gte; }
283+ else if (strmatch(next, "lt" )) { AVExpr *tmp = d->param[1]; d->param[1] = d->param[0]; d->param[0] = tmp; d->type = e_gt; }
284284 else if (strmatch(next, "ld" )) d->type = e_ld;
285285 else if (strmatch(next, "isnan" )) d->type = e_isnan;
286286 else if (strmatch(next, "isinf" )) d->type = e_isinf;
tests/ref/fate/eval+3−3
@@ -95,16 +95,16 @@ Evaluating 'st(1, 123); ld(1)' · 94 unmodified lines
9595 'st(1, 123); ld(1)' -> 123.000000
9696
9797 Evaluating 'st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)'
98−'st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)' -> 4950.000000
98+'st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)' -> 5050.000000
9999
100100 Evaluating 'st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)'
101−'st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)' -> 144.000000
101+'st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)' -> 233.000000
102102
103103 Evaluating 'while(0, 10)'
104104 'while(0, 10)' -> nan
105105
106106 Evaluating 'st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))'
107−'st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))' -> 100.000000
107+'st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))' -> 101.000000
108108
109109 Evaluating 'isnan(1)'
110110 'isnan(1)' -> 0.000000

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t