From: Tim Kientzle Date: Sun, 24 Apr 2016 18:59:46 +0000 (-0700) Subject: Move variable declarations to beginning of block for non-C99 compilers X-Git-Tag: v3.2.0~2^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b276aa648cc3a1b682a704ddc70fba80f49a407;p=thirdparty%2Flibarchive.git Move variable declarations to beginning of block for non-C99 compilers --- 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;