diff options
author | Russell Belfer <rb@github.com> | 2012-11-22 03:39:03 +0400 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-11-28 01:18:29 +0400 |
commit | a8122b5d4a179456b1a1d9af8d09313e22bfab8d (patch) | |
tree | 0c761b335489f93a6db1aecdde506a037c64dd92 /src/tree.c | |
parent | 4604a65460b42ee4b3fead03dbb92197d583cc65 (diff) |
Fix warnings on Win64 build
Diffstat (limited to 'src/tree.c')
-rw-r--r-- | src/tree.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/tree.c b/src/tree.c index 177ccb98d..b3f5c302d 100644 --- a/src/tree.c +++ b/src/tree.c @@ -353,10 +353,9 @@ int git_tree__parse(git_tree *tree, git_odb_object *obj) return tree_parse_buffer(tree, (char *)obj->raw.data, (char *)obj->raw.data + obj->raw.len); } -static unsigned int find_next_dir(const char *dirname, git_index *index, unsigned int start) +static size_t find_next_dir(const char *dirname, git_index *index, size_t start) { - unsigned int i, entries = git_index_entrycount(index); - size_t dirlen; + size_t dirlen, i, entries = git_index_entrycount(index); dirlen = strlen(dirname); for (i = start; i < entries; ++i) { @@ -399,11 +398,10 @@ static int write_tree( git_repository *repo, git_index *index, const char *dirname, - unsigned int start) + size_t start) { git_treebuilder *bld = NULL; - - unsigned int i, entries = git_index_entrycount(index); + size_t i, entries = git_index_entrycount(index); int error; size_t dirname_len = strlen(dirname); const git_tree_cache *cache; @@ -411,13 +409,11 @@ static int write_tree( cache = git_tree_cache_get(index->tree, dirname); if (cache != NULL && cache->entries >= 0){ git_oid_cpy(oid, &cache->oid); - return find_next_dir(dirname, index, start); + return (int)find_next_dir(dirname, index, start); } - error = git_treebuilder_create(&bld, NULL); - if (bld == NULL) { + if ((error = git_treebuilder_create(&bld, NULL)) < 0 || bld == NULL) return -1; - } /* * This loop is unfortunate, but necessary. The index doesn't have @@ -494,7 +490,7 @@ static int write_tree( goto on_error; git_treebuilder_free(bld); - return i; + return (int)i; on_error: git_treebuilder_free(bld); |