1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-02 07:17:58 +01:00
git/contrib/coccinelle/qsort.cocci

38 lines
610 B
Text
Raw Normal View History

@@
expression base, nmemb, compar;
@@
- qsort(base, nmemb, sizeof(*base), compar);
+ QSORT(base, nmemb, compar);
@@
expression base, nmemb, compar;
@@
- qsort(base, nmemb, sizeof(base[0]), compar);
+ QSORT(base, nmemb, compar);
@@
type T;
T *base;
expression nmemb, compar;
@@
- qsort(base, nmemb, sizeof(T), compar);
+ QSORT(base, nmemb, compar);
@@
expression base, nmemb, compar;
@@
- if (nmemb)
QSORT(base, nmemb, compar);
@@
expression base, nmemb, compar;
@@
- if (nmemb > 0)
QSORT(base, nmemb, compar);
@@
expression base, nmemb, compar;
@@
- if (nmemb > 1)
QSORT(base, nmemb, compar);