123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- virtual report
- virtual org
- virtual context
- virtual patch
- @rmax depends on !patch@
- identifier func;
- expression x, y;
- binary operator cmp = {>, >=};
- position p;
- @@
- func(...)
- {
- <...
- * ((x) cmp@p (y) ? (x) : (y))
- ...>
- }
- @rmaxif depends on !patch@
- identifier func;
- expression x, y;
- expression max_val;
- binary operator cmp = {>, >=};
- position p;
- @@
- func(...)
- {
- <...
- * if ((x) cmp@p (y)) {
- * max_val = (x);
- * } else {
- * max_val = (y);
- * }
- ...>
- }
- @rmin depends on !patch@
- identifier func;
- expression x, y;
- binary operator cmp = {<, <=};
- position p;
- @@
- func(...)
- {
- <...
- * ((x) cmp@p (y) ? (x) : (y))
- ...>
- }
- @rminif depends on !patch@
- identifier func;
- expression x, y;
- expression min_val;
- binary operator cmp = {<, <=};
- position p;
- @@
- func(...)
- {
- <...
- * if ((x) cmp@p (y)) {
- * min_val = (x);
- * } else {
- * min_val = (y);
- * }
- ...>
- }
- @pmax depends on patch@
- identifier func;
- expression x, y;
- binary operator cmp = {>=, >};
- @@
- func(...)
- {
- <...
- - ((x) cmp (y) ? (x) : (y))
- + max(x, y)
- ...>
- }
- @pmaxif depends on patch@
- identifier func;
- expression x, y;
- expression max_val;
- binary operator cmp = {>=, >};
- @@
- func(...)
- {
- <...
- - if ((x) cmp (y)) {
- - max_val = x;
- - } else {
- - max_val = y;
- - }
- + max_val = max(x, y);
- ...>
- }
- @errcode depends on patch@
- position p;
- identifier func;
- expression x;
- binary operator cmp = {<, <=};
- @@
- func(...)
- {
- <...
- return ((x) cmp@p 0 ? (x) : 0);
- ...>
- }
- @pmin depends on patch@
- identifier func;
- expression x, y;
- binary operator cmp = {<=, <};
- position p != errcode.p;
- @@
- func(...)
- {
- <...
- - ((x) cmp@p (y) ? (x) : (y))
- + min(x, y)
- ...>
- }
- @pminif depends on patch@
- identifier func;
- expression x, y;
- expression min_val;
- binary operator cmp = {<=, <};
- @@
- func(...)
- {
- <...
- - if ((x) cmp (y)) {
- - min_val = x;
- - } else {
- - min_val = y;
- - }
- + min_val = min(x, y);
- ...>
- }
- @script:python depends on report@
- p << rmax.p;
- @@
- for p0 in p:
- coccilib.report.print_report(p0, "WARNING opportunity for max()")
- @script:python depends on org@
- p << rmax.p;
- @@
- for p0 in p:
- coccilib.org.print_todo(p0, "WARNING opportunity for max()")
- @script:python depends on report@
- p << rmaxif.p;
- @@
- for p0 in p:
- coccilib.report.print_report(p0, "WARNING opportunity for max()")
- @script:python depends on org@
- p << rmaxif.p;
- @@
- for p0 in p:
- coccilib.org.print_todo(p0, "WARNING opportunity for max()")
- @script:python depends on report@
- p << rmin.p;
- @@
- for p0 in p:
- coccilib.report.print_report(p0, "WARNING opportunity for min()")
- @script:python depends on org@
- p << rmin.p;
- @@
- for p0 in p:
- coccilib.org.print_todo(p0, "WARNING opportunity for min()")
- @script:python depends on report@
- p << rminif.p;
- @@
- for p0 in p:
- coccilib.report.print_report(p0, "WARNING opportunity for min()")
- @script:python depends on org@
- p << rminif.p;
- @@
- for p0 in p:
- coccilib.org.print_todo(p0, "WARNING opportunity for min()")
|