]> git.ipfire.org Git - thirdparty/git.git/blame - contrib/coccinelle/object_id.cocci
hex: drop sha1_to_hex_r()
[thirdparty/git.git] / contrib / coccinelle / object_id.cocci
CommitLineData
db1d80b8 1@@
6afedba8 2struct object_id OID;
db1d80b8 3@@
6afedba8
SG
4- is_null_sha1(OID.hash)
5+ is_null_oid(&OID)
db1d80b8 6
7@@
6afedba8 8struct object_id *OIDPTR;
db1d80b8 9@@
6afedba8
SG
10- is_null_sha1(OIDPTR->hash)
11+ is_null_oid(OIDPTR)
db1d80b8 12
13@@
6afedba8 14struct object_id OID;
db1d80b8 15@@
6afedba8
SG
16- sha1_to_hex(OID.hash)
17+ oid_to_hex(&OID)
db1d80b8 18
19@@
c2bb0c1d 20identifier f != oid_to_hex;
6afedba8 21struct object_id *OIDPTR;
db1d80b8 22@@
4d168e74 23 f(...) {<...
6afedba8
SG
24- sha1_to_hex(OIDPTR->hash)
25+ oid_to_hex(OIDPTR)
4d168e74 26 ...>}
db1d80b8 27
db1d80b8 28@@
6afedba8 29struct object_id OID;
db1d80b8 30@@
6afedba8
SG
31- hashclr(OID.hash)
32+ oidclr(&OID)
db1d80b8 33
34@@
c2bb0c1d 35identifier f != oidclr;
6afedba8 36struct object_id *OIDPTR;
db1d80b8 37@@
4d168e74 38 f(...) {<...
6afedba8
SG
39- hashclr(OIDPTR->hash)
40+ oidclr(OIDPTR)
4d168e74 41 ...>}
db1d80b8 42
43@@
6afedba8 44struct object_id OID1, OID2;
db1d80b8 45@@
6afedba8
SG
46- hashcmp(OID1.hash, OID2.hash)
47+ oidcmp(&OID1, &OID2)
db1d80b8 48
49@@
c2bb0c1d 50identifier f != oidcmp;
6afedba8 51struct object_id *OIDPTR1, OIDPTR2;
db1d80b8 52@@
4d168e74 53 f(...) {<...
6afedba8
SG
54- hashcmp(OIDPTR1->hash, OIDPTR2->hash)
55+ oidcmp(OIDPTR1, OIDPTR2)
4d168e74 56 ...>}
db1d80b8 57
58@@
6afedba8
SG
59struct object_id *OIDPTR;
60struct object_id OID;
db1d80b8 61@@
6afedba8
SG
62- hashcmp(OIDPTR->hash, OID.hash)
63+ oidcmp(OIDPTR, &OID)
db1d80b8 64
65@@
6afedba8
SG
66struct object_id *OIDPTR;
67struct object_id OID;
db1d80b8 68@@
6afedba8
SG
69- hashcmp(OID.hash, OIDPTR->hash)
70+ oidcmp(&OID, OIDPTR)
db1d80b8 71
4a7e27e9 72@@
6afedba8
SG
73struct object_id *OIDPTR1;
74struct object_id *OIDPTR2;
4a7e27e9 75@@
6afedba8
SG
76- oidcmp(OIDPTR1, OIDPTR2) == 0
77+ oideq(OIDPTR1, OIDPTR2)
e3ff0683
JK
78
79@@
80identifier f != hasheq;
81expression E1, E2;
82@@
83 f(...) {<...
84- hashcmp(E1, E2) == 0
85+ hasheq(E1, E2)
86 ...>}
9001dc2a
JK
87
88@@
6afedba8
SG
89struct object_id *OIDPTR1;
90struct object_id *OIDPTR2;
9001dc2a 91@@
6afedba8
SG
92- oidcmp(OIDPTR1, OIDPTR2) != 0
93+ !oideq(OIDPTR1, OIDPTR2)
67947c34
JK
94
95@@
96identifier f != hasheq;
97expression E1, E2;
98@@
99 f(...) {<...
100- hashcmp(E1, E2) != 0
101+ !hasheq(E1, E2)
102 ...>}