@@ -35,11 +35,16 @@ int commit_patch_id(struct commit *commit, struct diff_options *options,
35
35
* the side of safety. The actual value being negative does not have
36
36
* any significance; only that it is non-zero matters.
37
37
*/
38
- static int patch_id_cmp (struct diff_options * opt ,
39
- struct patch_id * a ,
40
- struct patch_id * b ,
38
+ static int patch_id_cmp (const void * cmpfn_data ,
39
+ const void * entry ,
40
+ const void * entry_or_key ,
41
41
const void * unused_keydata )
42
42
{
43
+ /* NEEDSWORK: const correctness? */
44
+ struct diff_options * opt = (void * )cmpfn_data ;
45
+ struct patch_id * a = (void * )entry ;
46
+ struct patch_id * b = (void * )entry_or_key ;
47
+
43
48
if (is_null_oid (& a -> patch_id ) &&
44
49
commit_patch_id (a -> commit , opt , & a -> patch_id , 0 ))
45
50
return error ("Could not get patch ID for %s" ,
@@ -58,8 +63,7 @@ int init_patch_ids(struct patch_ids *ids)
58
63
ids -> diffopts .detect_rename = 0 ;
59
64
DIFF_OPT_SET (& ids -> diffopts , RECURSIVE );
60
65
diff_setup_done (& ids -> diffopts );
61
- hashmap_init (& ids -> patches , (hashmap_cmp_fn )patch_id_cmp ,
62
- & ids -> diffopts , 256 );
66
+ hashmap_init (& ids -> patches , patch_id_cmp , & ids -> diffopts , 256 );
63
67
return 0 ;
64
68
}
65
69
0 commit comments