sideband: reverse its dependency on pkt-line
[git.git] / contrib / coccinelle / object_id.cocci
blob6a7cf3e02da832b3a2829178b968b57f3b80d081
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 - sha1_to_hex(OID.hash)
17 + oid_to_hex(&OID)
20 identifier f != oid_to_hex;
21 struct object_id *OIDPTR;
23   f(...) {<...
24 - sha1_to_hex(OIDPTR->hash)
25 + oid_to_hex(OIDPTR)
26   ...>}
29 expression E;
30 struct object_id OID;
32 - sha1_to_hex_r(E, OID.hash)
33 + oid_to_hex_r(E, &OID)
36 identifier f != oid_to_hex_r;
37 expression E;
38 struct object_id *OIDPTR;
40    f(...) {<...
41 - sha1_to_hex_r(E, OIDPTR->hash)
42 + oid_to_hex_r(E, OIDPTR)
43   ...>}
46 struct object_id OID;
48 - hashclr(OID.hash)
49 + oidclr(&OID)
52 identifier f != oidclr;
53 struct object_id *OIDPTR;
55   f(...) {<...
56 - hashclr(OIDPTR->hash)
57 + oidclr(OIDPTR)
58   ...>}
61 struct object_id OID1, OID2;
63 - hashcmp(OID1.hash, OID2.hash)
64 + oidcmp(&OID1, &OID2)
67 identifier f != oidcmp;
68 struct object_id *OIDPTR1, OIDPTR2;
70   f(...) {<...
71 - hashcmp(OIDPTR1->hash, OIDPTR2->hash)
72 + oidcmp(OIDPTR1, OIDPTR2)
73   ...>}
76 struct object_id *OIDPTR;
77 struct object_id OID;
79 - hashcmp(OIDPTR->hash, OID.hash)
80 + oidcmp(OIDPTR, &OID)
83 struct object_id *OIDPTR;
84 struct object_id OID;
86 - hashcmp(OID.hash, OIDPTR->hash)
87 + oidcmp(&OID, OIDPTR)
90 struct object_id OID1, OID2;
92 - hashcpy(OID1.hash, OID2.hash)
93 + oidcpy(&OID1, &OID2)
96 identifier f != oidcpy;
97 struct object_id *OIDPTR1;
98 struct object_id *OIDPTR2;
100   f(...) {<...
101 - hashcpy(OIDPTR1->hash, OIDPTR2->hash)
102 + oidcpy(OIDPTR1, OIDPTR2)
103   ...>}
106 struct object_id *OIDPTR;
107 struct object_id OID;
109 - hashcpy(OIDPTR->hash, OID.hash)
110 + oidcpy(OIDPTR, &OID)
113 struct object_id *OIDPTR;
114 struct object_id OID;
116 - hashcpy(OID.hash, OIDPTR->hash)
117 + oidcpy(&OID, OIDPTR)
120 struct object_id *OIDPTR1;
121 struct object_id *OIDPTR2;
123 - oidcmp(OIDPTR1, OIDPTR2) == 0
124 + oideq(OIDPTR1, OIDPTR2)
127 identifier f != hasheq;
128 expression E1, E2;
130   f(...) {<...
131 - hashcmp(E1, E2) == 0
132 + hasheq(E1, E2)
133   ...>}
136 struct object_id *OIDPTR1;
137 struct object_id *OIDPTR2;
139 - oidcmp(OIDPTR1, OIDPTR2) != 0
140 + !oideq(OIDPTR1, OIDPTR2)
143 identifier f != hasheq;
144 expression E1, E2;
146   f(...) {<...
147 - hashcmp(E1, E2) != 0
148 + !hasheq(E1, E2)
149   ...>}