File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
1
#define USE_THE_REPOSITORY_VARIABLE
2
- #define DISABLE_SIGN_COMPARE_WARNINGS
3
2
4
3
#include "git-compat-util.h"
5
4
#include "hash.h"
@@ -246,28 +245,25 @@ const char *empty_tree_oid_hex(const struct git_hash_algo *algop)
246
245
247
246
int hash_algo_by_name (const char * name )
248
247
{
249
- int i ;
250
248
if (!name )
251
249
return GIT_HASH_UNKNOWN ;
252
- for (i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
250
+ for (size_t i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
253
251
if (!strcmp (name , hash_algos [i ].name ))
254
252
return i ;
255
253
return GIT_HASH_UNKNOWN ;
256
254
}
257
255
258
256
int hash_algo_by_id (uint32_t format_id )
259
257
{
260
- int i ;
261
- for (i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
258
+ for (size_t i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
262
259
if (format_id == hash_algos [i ].format_id )
263
260
return i ;
264
261
return GIT_HASH_UNKNOWN ;
265
262
}
266
263
267
- int hash_algo_by_length (int len )
264
+ int hash_algo_by_length (size_t len )
268
265
{
269
- int i ;
270
- for (i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
266
+ for (size_t i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
271
267
if (len == hash_algos [i ].rawsz )
272
268
return i ;
273
269
return GIT_HASH_UNKNOWN ;
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ int hash_algo_by_name(const char *name);
325
325
/* Identical, except based on the format ID. */
326
326
int hash_algo_by_id (uint32_t format_id );
327
327
/* Identical, except based on the length. */
328
- int hash_algo_by_length (int len );
328
+ int hash_algo_by_length (size_t len );
329
329
/* Identical, except for a pointer to struct git_hash_algo. */
330
330
static inline int hash_algo_by_ptr (const struct git_hash_algo * p )
331
331
{
You can’t perform that action at this time.
0 commit comments