Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/tools/coccinelle/object_id.cocci # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / tools / coccinelle / object_id.cocci` 75 lines ยท 1122 bytes Raw Blame History 1 @@ 2 struct object_id OID; 3 @@ 4 - hashclr(OID.hash) 5 + oidclr(&OID) 6 7 @@ 8 identifier f != oidclr; 9 struct object_id *OIDPTR; 10 @@ 11 f(...) {<... 12 - hashclr(OIDPTR->hash) 13 + oidclr(OIDPTR) 14 ...>} 15 16 @@ 17 struct object_id OID1, OID2; 18 @@ 19 - hashcmp(OID1.hash, OID2.hash) 20 + oidcmp(&OID1, &OID2) 21 22 @@ 23 identifier f != oidcmp; 24 struct object_id *OIDPTR1, OIDPTR2; 25 @@ 26 f(...) {<... 27 - hashcmp(OIDPTR1->hash, OIDPTR2->hash) 28 + oidcmp(OIDPTR1, OIDPTR2) 29 ...>} 30 31 @@ 32 struct object_id *OIDPTR; 33 struct object_id OID; 34 @@ 35 - hashcmp(OIDPTR->hash, OID.hash) 36 + oidcmp(OIDPTR, &OID) 37 38 @@ 39 struct object_id *OIDPTR; 40 struct object_id OID; 41 @@ 42 - hashcmp(OID.hash, OIDPTR->hash) 43 + oidcmp(&OID, OIDPTR) 44 45 @@ 46 struct object_id *OIDPTR1; 47 struct object_id *OIDPTR2; 48 @@ 49 - oidcmp(OIDPTR1, OIDPTR2) == 0 50 + oideq(OIDPTR1, OIDPTR2) 51 52 @@ 53 identifier f != hasheq; 54 expression E1, E2; 55 @@ 56 f(...) {<... 57 - hashcmp(E1, E2) == 0 58 + hasheq(E1, E2) 59 ...>} 60 61 @@ 62 struct object_id *OIDPTR1; 63 struct object_id *OIDPTR2; 64 @@ 65 - oidcmp(OIDPTR1, OIDPTR2) != 0 66 + !oideq(OIDPTR1, OIDPTR2) 67 68 @@ 69 identifier f != hasheq; 70 expression E1, E2; 71 @@ 72 f(...) {<... 73 - hashcmp(E1, E2) != 0 74 + !hasheq(E1, E2) 75 ...>}