load_subtree(): declare some variables to be `size_t`
* `prefix_len` * `path_len` * `i` It's good hygiene. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Aug 26, 2017 at 10:28 UTC
06cfa75675ac605577c9a42154a9042bfd451937
1 file changed
+3
-3
notes.c
+3
-3
@@ -406,7 +406,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
406
struct int_node *node, unsigned int n)
407
{
408
struct object_id object_oid;
409
- unsigned int prefix_len;
409
+ size_t prefix_len;
410
void *buf;
411
struct tree_desc desc;
412
struct name_entry entry;
@@ -422,7 +422,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
422
while (tree_entry(&desc, &entry)) {
423
unsigned char type;
424
struct leaf_node *l;
425
- int path_len = strlen(entry.path);
425
+ size_t path_len = strlen(entry.path);
426
427
if (path_len == 2 * (GIT_SHA1_RAWSZ - prefix_len)) {
428
/* This is potentially the remainder of the SHA-1 */
@@ -486,7 +486,7 @@ handle_non_note:
486
{
487
struct strbuf non_note_path = STRBUF_INIT;
488
const char *q = oid_to_hex(&subtree->key_oid);
489
- int i;
489
+ size_t i;
490
for (i = 0; i < prefix_len; i++) {
491
strbuf_addch(&non_note_path, *q++);
492
strbuf_addch(&non_note_path, *q++);