Commit 8c4c357f by Vicent Marti

clar: Fix warnings

parent 31eed56b
...@@ -537,7 +537,7 @@ static int oid_for_tree_path(git_oid *out, git_tree *tree, git_repository *repo, ...@@ -537,7 +537,7 @@ static int oid_for_tree_path(git_oid *out, git_tree *tree, git_repository *repo,
char *tok; char *tok;
void *alloc = str; void *alloc = str;
git_tree *tree2 = tree; git_tree *tree2 = tree;
const git_tree_entry *entry; const git_tree_entry *entry = NULL;
while ((tok = git__strtok(&str, "/\\")) != NULL) { while ((tok = git__strtok(&str, "/\\")) != NULL) {
entry = git_tree_entry_byname(tree2, tok); entry = git_tree_entry_byname(tree2, tok);
......
...@@ -89,7 +89,8 @@ void test_object_tree_write__subtree(void) ...@@ -89,7 +89,8 @@ void test_object_tree_write__subtree(void)
void test_object_tree_write__sorted_subtrees(void) void test_object_tree_write__sorted_subtrees(void)
{ {
git_treebuilder *builder; 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 { struct {
unsigned int attr; unsigned int attr;
...@@ -140,6 +141,10 @@ void test_object_tree_write__sorted_subtrees(void) ...@@ -140,6 +141,10 @@ void test_object_tree_write__sorted_subtrees(void)
position_config = i; 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_c < position_cake);
cl_assert(position_cake < position_config); cl_assert(position_cake < position_config);
......
#include "clar_libgit2.h" #include "clar_libgit2.h"
#include "vector.h" #include "vector.h"
#include <stdarg.h>
static git_repository *_repo; static git_repository *_repo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment