[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Add a rule to the calloc semantic patch for argument ordering.



commit 3ab2c865bfb78e50f7c67c71144fbed37a7b4478
Author: Mansour Moufid <mansourmoufid@xxxxxxxxx>
Date:   Sun Oct 19 12:36:46 2014 -0400

    Add a rule to the calloc semantic patch for argument ordering.
---
 scripts/coccinelle/calloc.cocci |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/coccinelle/calloc.cocci b/scripts/coccinelle/calloc.cocci
index df0b61d..fbda88e 100644
--- a/scripts/coccinelle/calloc.cocci
+++ b/scripts/coccinelle/calloc.cocci
@@ -8,6 +8,13 @@ constant b;
 - f(a * b)
 + tor_calloc(a, b)
 
+@calloc_arg_order@
+expression a;
+type t;
+@@
+- tor_calloc(sizeof(t), a)
++ tor_calloc(a, sizeof(t))
+
 @realloc_to_reallocarray@
 expression a, b;
 expression p;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits