]> git.ipfire.org Git - thirdparty/git.git/blob - contrib/coccinelle/object_id.cocci
convert "oidcmp() != 0" to "!oideq()"
[thirdparty/git.git] / contrib / coccinelle / object_id.cocci
1 @@
2 expression E1;
3 @@
4 - is_null_sha1(E1.hash)
5 + is_null_oid(&E1)
6
7 @@
8 expression E1;
9 @@
10 - is_null_sha1(E1->hash)
11 + is_null_oid(E1)
12
13 @@
14 expression E1;
15 @@
16 - sha1_to_hex(E1.hash)
17 + oid_to_hex(&E1)
18
19 @@
20 identifier f != oid_to_hex;
21 expression E1;
22 @@
23 f(...) {<...
24 - sha1_to_hex(E1->hash)
25 + oid_to_hex(E1)
26 ...>}
27
28 @@
29 expression E1, E2;
30 @@
31 - sha1_to_hex_r(E1, E2.hash)
32 + oid_to_hex_r(E1, &E2)
33
34 @@
35 identifier f != oid_to_hex_r;
36 expression E1, E2;
37 @@
38 f(...) {<...
39 - sha1_to_hex_r(E1, E2->hash)
40 + oid_to_hex_r(E1, E2)
41 ...>}
42
43 @@
44 expression E1;
45 @@
46 - hashclr(E1.hash)
47 + oidclr(&E1)
48
49 @@
50 identifier f != oidclr;
51 expression E1;
52 @@
53 f(...) {<...
54 - hashclr(E1->hash)
55 + oidclr(E1)
56 ...>}
57
58 @@
59 expression E1, E2;
60 @@
61 - hashcmp(E1.hash, E2.hash)
62 + oidcmp(&E1, &E2)
63
64 @@
65 identifier f != oidcmp;
66 expression E1, E2;
67 @@
68 f(...) {<...
69 - hashcmp(E1->hash, E2->hash)
70 + oidcmp(E1, E2)
71 ...>}
72
73 @@
74 expression E1, E2;
75 @@
76 - hashcmp(E1->hash, E2.hash)
77 + oidcmp(E1, &E2)
78
79 @@
80 expression E1, E2;
81 @@
82 - hashcmp(E1.hash, E2->hash)
83 + oidcmp(&E1, E2)
84
85 @@
86 expression E1, E2;
87 @@
88 - hashcpy(E1.hash, E2.hash)
89 + oidcpy(&E1, &E2)
90
91 @@
92 identifier f != oidcpy;
93 expression E1, E2;
94 @@
95 f(...) {<...
96 - hashcpy(E1->hash, E2->hash)
97 + oidcpy(E1, E2)
98 ...>}
99
100 @@
101 expression E1, E2;
102 @@
103 - hashcpy(E1->hash, E2.hash)
104 + oidcpy(E1, &E2)
105
106 @@
107 expression E1, E2;
108 @@
109 - hashcpy(E1.hash, E2->hash)
110 + oidcpy(&E1, E2)
111
112 @@
113 expression E1, E2;
114 @@
115 - oidcmp(E1, E2) == 0
116 + oideq(E1, E2)
117
118 @@
119 identifier f != hasheq;
120 expression E1, E2;
121 @@
122 f(...) {<...
123 - hashcmp(E1, E2) == 0
124 + hasheq(E1, E2)
125 ...>}
126
127 @@
128 expression E1, E2;
129 @@
130 - oidcmp(E1, E2) != 0
131 + !oideq(E1, E2)