Merge branch 'js/mingw-isatty'
[gitweb.git] / contrib / coccinelle / qsort.cocci
index a094e7c5e7f060f68f452279479111fcaf08b1df..22b93a99664d2745aa74c6566be0225f6842e882 100644 (file)
@@ -17,3 +17,21 @@ 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);