summaryrefslogtreecommitdiff
path: root/notes.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2017-08-26 10:28:12 +0200
committerJunio C Hamano <gitster@pobox.com>2017-08-26 09:21:01 -0700
commit06cfa75675ac605577c9a42154a9042bfd451937 (patch)
tree0c559afbeaf3031bcdbd6f72be9296a6fee2ab2e /notes.c
parentcfdc88f1a34ccb8e59899501b0ede875afac0d83 (diff)
downloadgit-06cfa75675ac605577c9a42154a9042bfd451937.tar.gz
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>
Diffstat (limited to 'notes.c')
-rw-r--r--notes.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/notes.c b/notes.c
index 355669dcfb..40d9ba6252 100644
--- a/notes.c
+++ b/notes.c
@@ -406,7 +406,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
struct int_node *node, unsigned int n)
{
struct object_id object_oid;
- unsigned int prefix_len;
+ size_t prefix_len;
void *buf;
struct tree_desc desc;
struct name_entry entry;
@@ -422,7 +422,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
while (tree_entry(&desc, &entry)) {
unsigned char type;
struct leaf_node *l;
- int path_len = strlen(entry.path);
+ size_t path_len = strlen(entry.path);
if (path_len == 2 * (GIT_SHA1_RAWSZ - prefix_len)) {
/* This is potentially the remainder of the SHA-1 */
@@ -486,7 +486,7 @@ handle_non_note:
{
struct strbuf non_note_path = STRBUF_INIT;
const char *q = oid_to_hex(&subtree->key_oid);
- int i;
+ size_t i;
for (i = 0; i < prefix_len; i++) {
strbuf_addch(&non_note_path, *q++);
strbuf_addch(&non_note_path, *q++);