]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Move variable declarations to beginning of block for non-C99 compilers
authorTim Kientzle <kientzle@acm.org>
Sun, 24 Apr 2016 18:59:46 +0000 (11:59 -0700)
committerTim Kientzle <kientzle@acm.org>
Sun, 24 Apr 2016 18:59:46 +0000 (11:59 -0700)
libarchive/test/main.c
libarchive/test/test_sparse_basic.c

index f9ca55d60c2652f2d91dcc97ac42909cae385a34..8561129a8c00b3df5677588db1da4cda6d7b7ecf 100644 (file)
@@ -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);
 
index f72594bb7f3a56a35ce1ebec26d1bfb8bfd159ee..e5dd2f73010c947c27a87f6c9ac2094176b31ed9 100644 (file)
@@ -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;