@@ -131,10 +131,12 @@ struct working_tree_entry {
131
131
};
132
132
133
133
static int working_tree_entry_cmp (const void * unused_cmp_data ,
134
- struct working_tree_entry * a ,
135
- struct working_tree_entry * b ,
136
- void * unused_keydata )
134
+ const void * entry ,
135
+ const void * entry_or_key ,
136
+ const void * unused_keydata )
137
137
{
138
+ const struct working_tree_entry * a = entry ;
139
+ const struct working_tree_entry * b = entry_or_key ;
138
140
return strcmp (a -> path , b -> path );
139
141
}
140
142
@@ -149,9 +151,13 @@ struct pair_entry {
149
151
};
150
152
151
153
static int pair_cmp (const void * unused_cmp_data ,
152
- struct pair_entry * a , struct pair_entry * b ,
153
- void * unused_keydata )
154
+ const void * entry ,
155
+ const void * entry_or_key ,
156
+ const void * unused_keydata )
154
157
{
158
+ const struct pair_entry * a = entry ;
159
+ const struct pair_entry * b = entry_or_key ;
160
+
155
161
return strcmp (a -> path , b -> path );
156
162
}
157
163
@@ -179,9 +185,13 @@ struct path_entry {
179
185
};
180
186
181
187
static int path_entry_cmp (const void * unused_cmp_data ,
182
- struct path_entry * a , struct path_entry * b ,
183
- void * key )
188
+ const void * entry ,
189
+ const void * entry_or_key ,
190
+ const void * key )
184
191
{
192
+ const struct path_entry * a = entry ;
193
+ const struct path_entry * b = entry_or_key ;
194
+
185
195
return strcmp (a -> path , key ? key : b -> path );
186
196
}
187
197
@@ -372,10 +382,9 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
372
382
rdir_len = rdir .len ;
373
383
wtdir_len = wtdir .len ;
374
384
375
- hashmap_init (& working_tree_dups ,
376
- (hashmap_cmp_fn )working_tree_entry_cmp , NULL , 0 );
377
- hashmap_init (& submodules , (hashmap_cmp_fn )pair_cmp , NULL , 0 );
378
- hashmap_init (& symlinks2 , (hashmap_cmp_fn )pair_cmp , NULL , 0 );
385
+ hashmap_init (& working_tree_dups , working_tree_entry_cmp , NULL , 0 );
386
+ hashmap_init (& submodules , pair_cmp , NULL , 0 );
387
+ hashmap_init (& symlinks2 , pair_cmp , NULL , 0 );
379
388
380
389
child .no_stdin = 1 ;
381
390
child .git_cmd = 1 ;
@@ -585,10 +594,8 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
585
594
* in the common case of --symlinks and the difftool updating
586
595
* files through the symlink.
587
596
*/
588
- hashmap_init (& wt_modified , (hashmap_cmp_fn )path_entry_cmp ,
589
- NULL , wtindex .cache_nr );
590
- hashmap_init (& tmp_modified , (hashmap_cmp_fn )path_entry_cmp ,
591
- NULL , wtindex .cache_nr );
597
+ hashmap_init (& wt_modified , path_entry_cmp , NULL , wtindex .cache_nr );
598
+ hashmap_init (& tmp_modified , path_entry_cmp , NULL , wtindex .cache_nr );
592
599
593
600
for (i = 0 ; i < wtindex .cache_nr ; i ++ ) {
594
601
struct hashmap_entry dummy ;
0 commit comments