Commit d4ad0771 by Vicent Martí

Merge pull request #145 from schu/fix-unused-warnings.

Fix -Wunused-but-set-variable warnings
parents 273c8bc0 402a47a7
...@@ -684,7 +684,7 @@ static int packed_loadloose(git_repository *repository) ...@@ -684,7 +684,7 @@ static int packed_loadloose(git_repository *repository)
/* Remove any loose references from the cache */ /* Remove any loose references from the cache */
{ {
const void *_unused; const void *GIT_UNUSED(_unused);
git_reference *reference; git_reference *reference;
GIT_HASHTABLE_FOREACH(repository->references.loose_cache, _unused, reference, GIT_HASHTABLE_FOREACH(repository->references.loose_cache, _unused, reference,
...@@ -868,7 +868,7 @@ static int packed_write(git_repository *repo) ...@@ -868,7 +868,7 @@ static int packed_write(git_repository *repo)
/* Load all the packfile into a vector */ /* Load all the packfile into a vector */
{ {
git_reference *reference; git_reference *reference;
const void *_unused; const void *GIT_UNUSED(_unused);
GIT_HASHTABLE_FOREACH(repo->references.packfile, _unused, reference, GIT_HASHTABLE_FOREACH(repo->references.packfile, _unused, reference,
git_vector_insert(&packing_list, reference); /* cannot fail: vector already has the right size */ git_vector_insert(&packing_list, reference); /* cannot fail: vector already has the right size */
...@@ -1518,7 +1518,7 @@ int git_reference_listcb(git_repository *repo, unsigned int list_flags, int (*ca ...@@ -1518,7 +1518,7 @@ int git_reference_listcb(git_repository *repo, unsigned int list_flags, int (*ca
/* list all the packed references first */ /* list all the packed references first */
if (list_flags & GIT_REF_PACKED) { if (list_flags & GIT_REF_PACKED) {
const char *ref_name; const char *ref_name;
void *_unused; void *GIT_UNUSED(_unused);
if ((error = packed_load(repo)) < GIT_SUCCESS) if ((error = packed_load(repo)) < GIT_SUCCESS)
return error; return error;
...@@ -1597,7 +1597,7 @@ int git_repository__refcache_init(git_refcache *refs) ...@@ -1597,7 +1597,7 @@ int git_repository__refcache_init(git_refcache *refs)
void git_repository__refcache_free(git_refcache *refs) void git_repository__refcache_free(git_refcache *refs)
{ {
git_reference *reference; git_reference *reference;
const void *_unused; const void *GIT_UNUSED(_unused);
assert(refs); assert(refs);
......
...@@ -58,7 +58,6 @@ static int assign_repository_dirs( ...@@ -58,7 +58,6 @@ static int assign_repository_dirs(
const char *git_work_tree) const char *git_work_tree)
{ {
char path_aux[GIT_PATH_MAX]; char path_aux[GIT_PATH_MAX];
size_t git_dir_path_len;
int error = GIT_SUCCESS; int error = GIT_SUCCESS;
assert(repo); assert(repo);
...@@ -70,8 +69,6 @@ static int assign_repository_dirs( ...@@ -70,8 +69,6 @@ static int assign_repository_dirs(
if (error < GIT_SUCCESS) if (error < GIT_SUCCESS)
return error; return error;
git_dir_path_len = strlen(path_aux);
/* store GIT_DIR */ /* store GIT_DIR */
repo->path_repository = git__strdup(path_aux); repo->path_repository = git__strdup(path_aux);
if (repo->path_repository == NULL) if (repo->path_repository == NULL)
......
...@@ -483,7 +483,7 @@ int git_revwalk_new(git_revwalk **revwalk_out, git_repository *repo) ...@@ -483,7 +483,7 @@ int git_revwalk_new(git_revwalk **revwalk_out, git_repository *repo)
void git_revwalk_free(git_revwalk *walk) void git_revwalk_free(git_revwalk *walk)
{ {
unsigned int i; unsigned int i;
const void *_unused; const void *GIT_UNUSED(_unused);
commit_object *commit; commit_object *commit;
if (walk == NULL) if (walk == NULL)
...@@ -558,7 +558,7 @@ int git_revwalk_next(git_oid *oid, git_revwalk *walk) ...@@ -558,7 +558,7 @@ int git_revwalk_next(git_oid *oid, git_revwalk *walk)
void git_revwalk_reset(git_revwalk *walk) void git_revwalk_reset(git_revwalk *walk)
{ {
const void *_unused; const void *GIT_UNUSED(_unused);
commit_object *commit; commit_object *commit;
assert(walk); assert(walk);
......
...@@ -155,7 +155,7 @@ BEGIN_TEST(tableit0, "iterate through all the contents of the table") ...@@ -155,7 +155,7 @@ BEGIN_TEST(tableit0, "iterate through all the contents of the table")
const int objects_n = 32; const int objects_n = 32;
int i; int i;
table_item *objects, *ob; table_item *objects, *ob;
const void *_unused; const void *GIT_UNUSED(_unused);
git_hashtable *table = NULL; git_hashtable *table = NULL;
......
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