Skip to content

Commit 06cfa75

Browse files
mhaggergitster
authored andcommitted
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>
1 parent cfdc88f commit 06cfa75

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

notes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
406406
struct int_node *node, unsigned int n)
407407
{
408408
struct object_id object_oid;
409-
unsigned int prefix_len;
409+
size_t prefix_len;
410410
void *buf;
411411
struct tree_desc desc;
412412
struct name_entry entry;
@@ -422,7 +422,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
422422
while (tree_entry(&desc, &entry)) {
423423
unsigned char type;
424424
struct leaf_node *l;
425-
int path_len = strlen(entry.path);
425+
size_t path_len = strlen(entry.path);
426426

427427
if (path_len == 2 * (GIT_SHA1_RAWSZ - prefix_len)) {
428428
/* This is potentially the remainder of the SHA-1 */
@@ -486,7 +486,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
486486
{
487487
struct strbuf non_note_path = STRBUF_INIT;
488488
const char *q = oid_to_hex(&subtree->key_oid);
489-
int i;
489+
size_t i;
490490
for (i = 0; i < prefix_len; i++) {
491491
strbuf_addch(&non_note_path, *q++);
492492
strbuf_addch(&non_note_path, *q++);

0 commit comments

Comments
 (0)