summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authorlhchavez <lhchavez@lhchavez.com>2021-02-23 19:33:34 -0800
committerlhchavez <lhchavez@lhchavez.com>2021-08-08 19:08:59 -0700
commit231ca4fad36ce7b3dd5d79b599be46ab6001fc18 (patch)
tree6616d81c71b873f122134f046073defcc4f659c2 /src/odb.c
parent9eb17d460cd681bbc14d56ed8fdf440bc69b5456 (diff)
downloadlibgit2-231ca4fad36ce7b3dd5d79b599be46ab6001fc18.tar.gz
Proof-of-concept for a more aggressive GIT_UNUSED()
This adds a `-Wunused-result`-proof `GIT_UNUSED()`, just to demonstrate that it works. With this, sortedcache.h is now completely `GIT_WARN_UNUSED_RESULT`-annotated!
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/odb.c b/src/odb.c
index 22c8c8c87..e3a5381e6 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -573,7 +573,7 @@ int git_odb__add_default_backends(
git_odb *db, const char *objects_dir,
bool as_alternates, int alternate_depth)
{
- size_t i;
+ size_t i = 0;
struct stat st;
ino_t inode;
git_odb_backend *loose, *packed;
@@ -582,7 +582,7 @@ int git_odb__add_default_backends(
* a cross-platform workaround for this */
#ifdef GIT_WIN32
GIT_UNUSED(i);
- GIT_UNUSED(st);
+ GIT_UNUSED(&st);
inode = 0;
#else