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 11#define USE_THE_REPOSITORY_VARIABLE
2- #define DISABLE_SIGN_COMPARE_WARNINGS
32
43#include "git-compat-util.h"
54#include "hash.h"
@@ -246,28 +245,25 @@ const char *empty_tree_oid_hex(const struct git_hash_algo *algop)
246245
247246int hash_algo_by_name (const char * name )
248247{
249- int i ;
250248 if (!name )
251249 return GIT_HASH_UNKNOWN ;
252- for (i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
250+ for (size_t i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
253251 if (!strcmp (name , hash_algos [i ].name ))
254252 return i ;
255253 return GIT_HASH_UNKNOWN ;
256254}
257255
258256int hash_algo_by_id (uint32_t format_id )
259257{
260- int i ;
261- for (i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
258+ for (size_t i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
262259 if (format_id == hash_algos [i ].format_id )
263260 return i ;
264261 return GIT_HASH_UNKNOWN ;
265262}
266263
267- int hash_algo_by_length (int len )
264+ int hash_algo_by_length (size_t len )
268265{
269- int i ;
270- for (i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
266+ for (size_t i = 1 ; i < GIT_HASH_NALGOS ; i ++ )
271267 if (len == hash_algos [i ].rawsz )
272268 return i ;
273269 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);
325325/* Identical, except based on the format ID. */
326326int hash_algo_by_id (uint32_t format_id );
327327/* Identical, except based on the length. */
328- int hash_algo_by_length (int len );
328+ int hash_algo_by_length (size_t len );
329329/* Identical, except for a pointer to struct git_hash_algo. */
330330static inline int hash_algo_by_ptr (const struct git_hash_algo * p )
331331{
You can’t perform that action at this time.
0 commit comments