Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
d4ad0771
Commit
d4ad0771
authored
May 01, 2011
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #145 from schu/fix-unused-warnings.
Fix -Wunused-but-set-variable warnings
parents
273c8bc0
402a47a7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
10 deletions
+7
-10
src/refs.c
+4
-4
src/repository.c
+0
-3
src/revwalk.c
+2
-2
tests/t07-hashtable.c
+1
-1
No files found.
src/refs.c
View file @
d4ad0771
...
@@ -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
);
...
...
src/repository.c
View file @
d4ad0771
...
@@ -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
)
...
...
src/revwalk.c
View file @
d4ad0771
...
@@ -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
);
...
...
tests/t07-hashtable.c
View file @
d4ad0771
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment