From 0b276aa648cc3a1b682a704ddc70fba80f49a407 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 24 Apr 2016 11:59:46 -0700 Subject: [PATCH] Move variable declarations to beginning of block for non-C99 compilers --- libarchive/test/main.c | 2 +- libarchive/test/test_sparse_basic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libarchive/test/main.c b/libarchive/test/main.c index f9ca55d60..8561129a8 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -788,8 +788,8 @@ assertion_memory_filled_with(const char *file, int line, { const char *v1 = (const char *)_v1; size_t c = 0; - (void)ld; /* UNUSED */ size_t i; + (void)ld; /* UNUSED */ assertion_count(file, line); diff --git a/libarchive/test/test_sparse_basic.c b/libarchive/test/test_sparse_basic.c index f72594bb7..e5dd2f730 100644 --- a/libarchive/test/test_sparse_basic.c +++ b/libarchive/test/test_sparse_basic.c @@ -281,6 +281,7 @@ verify_sparse_file(struct archive *a, const char *path, last_offset = 0; while (ARCHIVE_OK == archive_read_data_block(a, &buff, &bytes_read, &offset)) { + const char *start = buff; #if DEBUG fprintf(stderr, "%s: bytes_read=%d offset=%d\n", path, (int)bytes_read, (int)offset); #endif @@ -298,7 +299,6 @@ verify_sparse_file(struct archive *a, const char *path, ++sparse; } /* Block that overlaps beginning of data */ - const char *start = buff; if (expected_offset < offset && expected_offset + (int64_t)sparse->size <= offset + (int64_t)bytes_read) { const char *end = buff + (expected_offset - offset) + (size_t)sparse->size; -- 2.47.2