Skip to contentSkip to conversation

contrib/coccinelle: fix semantic patch for oid_to_hex_r()

PATCH New René Scharfe 1 participant 1 message Sep 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 contrib/coccinelle: fix semantic patch for oid_to_hex_r()

Both sha1_to_hex_r() and oid_to_hex_r() take two parameters, so use two expressions in the semantic patch for transforming calls of the former to the latter one.

---
 contrib/coccinelle/object_id.cocci | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
contrib/coccinelle/object_id.cocci +6 -6
index 8ccdbb5..0307624 100644
@@ -23,16 +23,16 @@ expression E1;
 + oid_to_hex(E1)
 
 @@
-expression E1;
+expression E1, E2;
 @@
-- sha1_to_hex_r(E1.hash)
-+ oid_to_hex_r(&E1)
+- sha1_to_hex_r(E1, E2.hash)
++ oid_to_hex_r(E1, &E2)
 
 @@
-expression E1;
+expression E1, E2;
 @@
-- sha1_to_hex_r(E1->hash)
-+ oid_to_hex_r(E1)
+- sha1_to_hex_r(E1, E2->hash)
++ oid_to_hex_r(E1, E2)
 
 @@
 expression E1;
Signature · 1 line
2.10.0