Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill@shutemov.name>2011-08-24 21:10:50 +0400
committerKirill A. Shutemov <kirill@shutemov.name>2011-08-24 21:10:50 +0400
commitd7f0ababe1882c8351093231d986de26f9df670d (patch)
treef1086f79645e94933b8c3fa16b10ff6d6f1203ce /src/common.h
parenta7e34e3c854aaed77ede8558ff253716bc4c80a2 (diff)
Fix false positive -Wuninitialized warnings
GCC produces several -Wuninitialized warnings. Most of them can be fixed if we make visible for gcc that git__throw() and git__rethrow() always return first argument. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common.h b/src/common.h
index e1e7f0035..5986a6568 100644
--- a/src/common.h
+++ b/src/common.h
@@ -46,8 +46,13 @@ typedef SSIZE_T ssize_t;
#include "thread-utils.h"
#include "bswap.h"
-extern int git__throw(int error, const char *, ...) GIT_FORMAT_PRINTF(2, 3);
-extern int git__rethrow(int error, const char *, ...) GIT_FORMAT_PRINTF(2, 3);
+extern void git___throw(const char *, ...) GIT_FORMAT_PRINTF(1, 2);
+#define git__throw(error, ...) \
+ (git___throw(__VA_ARGS__), error)
+
+extern void git___rethrow(const char *, ...) GIT_FORMAT_PRINTF(1, 2);
+#define git__rethrow(error, ...) \
+ (git___rethrow(__VA_ARGS__), error)
#include "util.h"