clar: Fix warnings

This commit is contained in:
Vicent Marti 2012-06-19 02:43:36 +02:00
parent 31eed56b9e
commit 8c4c357f18
3 changed files with 8 additions and 2 deletions

View File

@ -537,7 +537,7 @@ static int oid_for_tree_path(git_oid *out, git_tree *tree, git_repository *repo,
char *tok;
void *alloc = str;
git_tree *tree2 = tree;
const git_tree_entry *entry;
const git_tree_entry *entry = NULL;
while ((tok = git__strtok(&str, "/\\")) != NULL) {
entry = git_tree_entry_byname(tree2, tok);

View File

@ -89,7 +89,8 @@ void test_object_tree_write__subtree(void)
void test_object_tree_write__sorted_subtrees(void)
{
git_treebuilder *builder;
unsigned int i, position_c, position_cake, position_config;
unsigned int i;
int position_c = -1, position_cake = -1, position_config = -1;
struct {
unsigned int attr;
@ -140,6 +141,10 @@ void test_object_tree_write__sorted_subtrees(void)
position_config = i;
}
cl_assert(position_c != -1);
cl_assert(position_cake != -1);
cl_assert(position_config != -1);
cl_assert(position_c < position_cake);
cl_assert(position_cake < position_config);

View File

@ -1,5 +1,6 @@
#include "clar_libgit2.h"
#include "vector.h"
#include <stdarg.h>
static git_repository *_repo;