Merge branch 'hm/paint-hits-in-log-grep' into maint
[alt-git.git] / contrib / coccinelle / object_id.cocci
blobddf4f22bd722fdad0ce585a660d06dcc4214648b
1 @@
2 struct object_id OID;
3 @@
4 - is_null_sha1(OID.hash)
5 + is_null_oid(&OID)
7 @@
8 struct object_id *OIDPTR;
9 @@
10 - is_null_sha1(OIDPTR->hash)
11 + is_null_oid(OIDPTR)
14 struct object_id OID;
16 - hashclr(OID.hash)
17 + oidclr(&OID)
20 identifier f != oidclr;
21 struct object_id *OIDPTR;
23   f(...) {<...
24 - hashclr(OIDPTR->hash)
25 + oidclr(OIDPTR)
26   ...>}
29 struct object_id OID1, OID2;
31 - hashcmp(OID1.hash, OID2.hash)
32 + oidcmp(&OID1, &OID2)
35 identifier f != oidcmp;
36 struct object_id *OIDPTR1, OIDPTR2;
38   f(...) {<...
39 - hashcmp(OIDPTR1->hash, OIDPTR2->hash)
40 + oidcmp(OIDPTR1, OIDPTR2)
41   ...>}
44 struct object_id *OIDPTR;
45 struct object_id OID;
47 - hashcmp(OIDPTR->hash, OID.hash)
48 + oidcmp(OIDPTR, &OID)
51 struct object_id *OIDPTR;
52 struct object_id OID;
54 - hashcmp(OID.hash, OIDPTR->hash)
55 + oidcmp(&OID, OIDPTR)
58 struct object_id *OIDPTR1;
59 struct object_id *OIDPTR2;
61 - oidcmp(OIDPTR1, OIDPTR2) == 0
62 + oideq(OIDPTR1, OIDPTR2)
65 identifier f != hasheq;
66 expression E1, E2;
68   f(...) {<...
69 - hashcmp(E1, E2) == 0
70 + hasheq(E1, E2)
71   ...>}
74 struct object_id *OIDPTR1;
75 struct object_id *OIDPTR2;
77 - oidcmp(OIDPTR1, OIDPTR2) != 0
78 + !oideq(OIDPTR1, OIDPTR2)
81 identifier f != hasheq;
82 expression E1, E2;
84   f(...) {<...
85 - hashcmp(E1, E2) != 0
86 + !hasheq(E1, E2)
87   ...>}