@@ -17,10 +17,14 @@ struct dir_entry {
17
17
};
18
18
19
19
static int dir_entry_cmp (const void * unused_cmp_data ,
20
- const struct dir_entry * e1 ,
21
- const struct dir_entry * e2 ,
22
- const char * name )
20
+ const void * entry ,
21
+ const void * entry_or_key ,
22
+ const void * keydata )
23
23
{
24
+ const struct dir_entry * e1 = entry ;
25
+ const struct dir_entry * e2 = entry_or_key ;
26
+ const char * name = keydata ;
27
+
24
28
return e1 -> namelen != e2 -> namelen || strncasecmp (e1 -> name ,
25
29
name ? name : e2 -> name , e1 -> namelen );
26
30
}
@@ -110,10 +114,12 @@ static void hash_index_entry(struct index_state *istate, struct cache_entry *ce)
110
114
}
111
115
112
116
static int cache_entry_cmp (const void * unused_cmp_data ,
113
- const struct cache_entry * ce1 ,
114
- const struct cache_entry * ce2 ,
117
+ const void * entry ,
118
+ const void * entry_or_key ,
115
119
const void * remove )
116
120
{
121
+ const struct cache_entry * ce1 = entry ;
122
+ const struct cache_entry * ce2 = entry_or_key ;
117
123
/*
118
124
* For remove_name_hash, find the exact entry (pointer equality); for
119
125
* index_file_exists, find all entries with matching hash code and
@@ -574,10 +580,8 @@ static void lazy_init_name_hash(struct index_state *istate)
574
580
{
575
581
if (istate -> name_hash_initialized )
576
582
return ;
577
- hashmap_init (& istate -> name_hash , (hashmap_cmp_fn ) cache_entry_cmp ,
578
- NULL , istate -> cache_nr );
579
- hashmap_init (& istate -> dir_hash , (hashmap_cmp_fn ) dir_entry_cmp ,
580
- NULL , istate -> cache_nr );
583
+ hashmap_init (& istate -> name_hash , cache_entry_cmp , NULL , istate -> cache_nr );
584
+ hashmap_init (& istate -> dir_hash , dir_entry_cmp , NULL , istate -> cache_nr );
581
585
582
586
if (lookup_lazy_params (istate )) {
583
587
hashmap_disallow_rehash (& istate -> dir_hash , 1 );
0 commit comments