Skip to content

Commit e3c4323

Browse files
committed
Merge branch 'rs/cocci' into maint
Improve the rule to convert "unsigned char [20]" into "struct object_id *" in contrib/coccinelle/ * rs/cocci: cocci: avoid self-references in object_id transformations
2 parents 91207f3 + c2bb0c1 commit e3c4323

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

contrib/coccinelle/object_id.cocci

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ expression E1;
1717
+ oid_to_hex(&E1)
1818

1919
@@
20+
identifier f != oid_to_hex;
2021
expression E1;
2122
@@
23+
f(...) {...
2224
- sha1_to_hex(E1->hash)
2325
+ oid_to_hex(E1)
26+
...}
2427

2528
@@
2629
expression E1, E2;
@@ -29,10 +32,13 @@ expression E1, E2;
2932
+ oid_to_hex_r(E1, &E2)
3033

3134
@@
35+
identifier f != oid_to_hex_r;
3236
expression E1, E2;
3337
@@
38+
f(...) {...
3439
- sha1_to_hex_r(E1, E2->hash)
3540
+ oid_to_hex_r(E1, E2)
41+
...}
3642

3743
@@
3844
expression E1;
@@ -41,10 +47,13 @@ expression E1;
4147
+ oidclr(&E1)
4248

4349
@@
50+
identifier f != oidclr;
4451
expression E1;
4552
@@
53+
f(...) {...
4654
- hashclr(E1->hash)
4755
+ oidclr(E1)
56+
...}
4857

4958
@@
5059
expression E1, E2;
@@ -53,10 +62,13 @@ expression E1, E2;
5362
+ oidcmp(&E1, &E2)
5463

5564
@@
65+
identifier f != oidcmp;
5666
expression E1, E2;
5767
@@
68+
f(...) {...
5869
- hashcmp(E1->hash, E2->hash)
5970
+ oidcmp(E1, E2)
71+
...}
6072

6173
@@
6274
expression E1, E2;
@@ -77,10 +89,13 @@ expression E1, E2;
7789
+ oidcpy(&E1, &E2)
7890

7991
@@
92+
identifier f != oidcpy;
8093
expression E1, E2;
8194
@@
95+
f(...) {...
8296
- hashcpy(E1->hash, E2->hash)
8397
+ oidcpy(E1, E2)
98+
...}
8499

85100
@@
86101
expression E1, E2;

0 commit comments

Comments
 (0)