e3ff0683e2
This is the partner patch to the previous one, but covering the "hash" variants instead of "oid". Note that our coccinelle rule is slightly more complex to avoid triggering the call in hasheq(). I didn't bother to add a new rule to convert: - hasheq(E1->hash, E2->hash) + oideq(E1, E2) Since these are new functions, there won't be any such existing callers. And since most of the code is already using oideq, we're not likely to introduce new ones. We might still see "!hashcmp(E1->hash, E2->hash)" from topics in flight. But because our new rule comes after the existing ones, that should first get converted to "!oidcmp(E1, E2)" and then to "oideq(E1, E2)". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
126 lines
1.5 KiB
Plaintext
126 lines
1.5 KiB
Plaintext
@@
|
|
expression E1;
|
|
@@
|
|
- is_null_sha1(E1.hash)
|
|
+ is_null_oid(&E1)
|
|
|
|
@@
|
|
expression E1;
|
|
@@
|
|
- is_null_sha1(E1->hash)
|
|
+ is_null_oid(E1)
|
|
|
|
@@
|
|
expression E1;
|
|
@@
|
|
- sha1_to_hex(E1.hash)
|
|
+ oid_to_hex(&E1)
|
|
|
|
@@
|
|
identifier f != oid_to_hex;
|
|
expression E1;
|
|
@@
|
|
f(...) {<...
|
|
- sha1_to_hex(E1->hash)
|
|
+ oid_to_hex(E1)
|
|
...>}
|
|
|
|
@@
|
|
expression E1, E2;
|
|
@@
|
|
- sha1_to_hex_r(E1, E2.hash)
|
|
+ oid_to_hex_r(E1, &E2)
|
|
|
|
@@
|
|
identifier f != oid_to_hex_r;
|
|
expression E1, E2;
|
|
@@
|
|
f(...) {<...
|
|
- sha1_to_hex_r(E1, E2->hash)
|
|
+ oid_to_hex_r(E1, E2)
|
|
...>}
|
|
|
|
@@
|
|
expression E1;
|
|
@@
|
|
- hashclr(E1.hash)
|
|
+ oidclr(&E1)
|
|
|
|
@@
|
|
identifier f != oidclr;
|
|
expression E1;
|
|
@@
|
|
f(...) {<...
|
|
- hashclr(E1->hash)
|
|
+ oidclr(E1)
|
|
...>}
|
|
|
|
@@
|
|
expression E1, E2;
|
|
@@
|
|
- hashcmp(E1.hash, E2.hash)
|
|
+ oidcmp(&E1, &E2)
|
|
|
|
@@
|
|
identifier f != oidcmp;
|
|
expression E1, E2;
|
|
@@
|
|
f(...) {<...
|
|
- hashcmp(E1->hash, E2->hash)
|
|
+ oidcmp(E1, E2)
|
|
...>}
|
|
|
|
@@
|
|
expression E1, E2;
|
|
@@
|
|
- hashcmp(E1->hash, E2.hash)
|
|
+ oidcmp(E1, &E2)
|
|
|
|
@@
|
|
expression E1, E2;
|
|
@@
|
|
- hashcmp(E1.hash, E2->hash)
|
|
+ oidcmp(&E1, E2)
|
|
|
|
@@
|
|
expression E1, E2;
|
|
@@
|
|
- hashcpy(E1.hash, E2.hash)
|
|
+ oidcpy(&E1, &E2)
|
|
|
|
@@
|
|
identifier f != oidcpy;
|
|
expression E1, E2;
|
|
@@
|
|
f(...) {<...
|
|
- hashcpy(E1->hash, E2->hash)
|
|
+ oidcpy(E1, E2)
|
|
...>}
|
|
|
|
@@
|
|
expression E1, E2;
|
|
@@
|
|
- hashcpy(E1->hash, E2.hash)
|
|
+ oidcpy(E1, &E2)
|
|
|
|
@@
|
|
expression E1, E2;
|
|
@@
|
|
- hashcpy(E1.hash, E2->hash)
|
|
+ oidcpy(&E1, E2)
|
|
|
|
@@
|
|
expression E1, E2;
|
|
@@
|
|
- oidcmp(E1, E2) == 0
|
|
+ oideq(E1, E2)
|
|
|
|
@@
|
|
identifier f != hasheq;
|
|
expression E1, E2;
|
|
@@
|
|
f(...) {<...
|
|
- hashcmp(E1, E2) == 0
|
|
+ hasheq(E1, E2)
|
|
...>}
|