interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / tools / coccinelle / object_id.cocci

75 lines · 1122 bytes Raw Blame History
1@@
2struct object_id OID;
3@@
4- hashclr(OID.hash)
5+ oidclr(&OID)
6
7@@
8identifier f != oidclr;
9struct object_id *OIDPTR;
10@@
11 f(...) {<...
12- hashclr(OIDPTR->hash)
13+ oidclr(OIDPTR)
14 ...>}
15
16@@
17struct object_id OID1, OID2;
18@@
19- hashcmp(OID1.hash, OID2.hash)
20+ oidcmp(&OID1, &OID2)
21
22@@
23identifier f != oidcmp;
24struct object_id *OIDPTR1, OIDPTR2;
25@@
26 f(...) {<...
27- hashcmp(OIDPTR1->hash, OIDPTR2->hash)
28+ oidcmp(OIDPTR1, OIDPTR2)
29 ...>}
30
31@@
32struct object_id *OIDPTR;
33struct object_id OID;
34@@
35- hashcmp(OIDPTR->hash, OID.hash)
36+ oidcmp(OIDPTR, &OID)
37
38@@
39struct object_id *OIDPTR;
40struct object_id OID;
41@@
42- hashcmp(OID.hash, OIDPTR->hash)
43+ oidcmp(&OID, OIDPTR)
44
45@@
46struct object_id *OIDPTR1;
47struct object_id *OIDPTR2;
48@@
49- oidcmp(OIDPTR1, OIDPTR2) == 0
50+ oideq(OIDPTR1, OIDPTR2)
51
52@@
53identifier f != hasheq;
54expression E1, E2;
55@@
56 f(...) {<...
57- hashcmp(E1, E2) == 0
58+ hasheq(E1, E2)
59 ...>}
60
61@@
62struct object_id *OIDPTR1;
63struct object_id *OIDPTR2;
64@@
65- oidcmp(OIDPTR1, OIDPTR2) != 0
66+ !oideq(OIDPTR1, OIDPTR2)
67
68@@
69identifier f != hasheq;
70expression E1, E2;
71@@
72 f(...) {<...
73- hashcmp(E1, E2) != 0
74+ !hasheq(E1, E2)
75 ...>}