aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/c-index-test/c-index-test.c')
-rw-r--r--tools/c-index-test/c-index-test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 3a3bfd734e..d0d5b2bce2 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -2510,13 +2510,14 @@ static void printFixIts(CXDiagnostic D, unsigned indent) {
}
static void printDiagnosticSet(CXDiagnosticSet Diags, unsigned indent) {
+ unsigned i, n;
+
if (!Diags)
return;
fprintf(stderr, "\n");
- unsigned i = 0;
- unsigned n = clang_getNumDiagnosticsInSet(Diags);
+ n = clang_getNumDiagnosticsInSet(Diags);
for (i = 0; i < n; ++i) {
CXSourceLocation DiagLoc;
CXDiagnostic D;