tvl-depot/third_party/git/contrib/coccinelle/qsort.cocci
Vincent Ambo 7ef0d62730 merge(third_party/git): Merge squashed git subtree at v2.23.0
Merge commit '1b593e1ea4d2af0f6444d9a7788d5d99abd6fde5' as 'third_party/git'
2020-01-11 23:40:29 +00:00

37 lines
610 B
Text

@@
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);