]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Remove unnecessary semicolons (#2450)
authorGraham Percival <gperciva@tarsnap.com>
Wed, 25 Dec 2024 17:35:54 +0000 (09:35 -0800)
committerGitHub <noreply@github.com>
Wed, 25 Dec 2024 17:35:54 +0000 (09:35 -0800)
libarchive/archive_ppmd7.c
libarchive/archive_ppmd8.c
libarchive/archive_ppmd_private.h
libarchive/archive_read_disk_entry_from_file.c
libarchive/archive_read_support_format_7zip.c
libarchive/archive_read_support_format_xar.c
libarchive/archive_string.c
libarchive/archive_write_set_format_zip.c
libarchive/test/test_read_format_rar5.c
libarchive/test/test_sparse_basic.c

index 30124f1743e5c6dbaaef6db99b34cddcf4e4f9bb..f0369835b83fe30b82757d504e5770bcb1b3c39b 100644 (file)
@@ -287,9 +287,14 @@ static void *AllocUnits(CPpmd7 *p, unsigned indx)
   return AllocUnitsRare(p, indx);
 }
 
-#define MyMem12Cpy(dest, src, num) \
-  { UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \
-    do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while(--n); }
+#define MyMem12Cpy(dest, src, num) do {                                        \
+       UInt32 *d = (UInt32 *)dest;                                     \
+       const UInt32 *s = (const UInt32 *)src;                          \
+       UInt32 n = num;                                                 \
+       do {                                                            \
+               d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3;  \
+       } while(--n);                                                   \
+} while (0)
 
 static void *ShrinkUnits(CPpmd7 *p, void *oldPtr, unsigned oldNU, unsigned newNU)
 {
index 2fb7f7141c36f3db248b1a233af1dc51cbfbab39..30196d64a9f55a89c74e069fa5356d9da6f93cf9 100644 (file)
@@ -242,9 +242,14 @@ static void *AllocUnits(CPpmd8 *p, unsigned indx)
   return AllocUnitsRare(p, indx);
 }
 
-#define MyMem12Cpy(dest, src, num) \
-  { UInt32 *d = (UInt32 *)dest; const UInt32 *z = (const UInt32 *)src; UInt32 n = num; \
-    do { d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3; } while (--n); }
+#define MyMem12Cpy(dest, src, num) do {                                        \
+       UInt32 *d = (UInt32 *)dest;                                     \
+       const UInt32 *z = (const UInt32 *)src;                          \
+       UInt32 n = num;                                                 \
+       do {                                                            \
+               d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;  \
+       } while (--n);                                                  \
+} while (0)
 
 static void *ShrinkUnits(CPpmd8 *p, void *oldPtr, unsigned oldNU, unsigned newNU)
 {
@@ -341,7 +346,9 @@ static void SetSuccessor(CPpmd_State *p, CPpmd_Void_Ref v)
   (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
 }
 
-#define RESET_TEXT(offs) { p->Text = p->Base + p->AlignOffset + (offs); }
+#define RESET_TEXT(offs) do {                                          \
+       p->Text = p->Base + p->AlignOffset + (offs);                    \
+} while (0)
 
 static void RestartModel(CPpmd8 *p)
 {
index 582803e5fd0f77064df9b0be577e12902d049fb5..bc525b47e52b8860ade06e94fc2322e324fe5285 100644 (file)
@@ -109,8 +109,12 @@ typedef struct
   Byte Count;  /* Count to next change of Shift */
 } CPpmd_See;
 
-#define Ppmd_See_Update(p)  if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \
-    { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); }
+#define Ppmd_See_Update(p) do {                                                \
+       if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) {       \
+               (p)->Summ <<= 1;                                        \
+               (p)->Count = (Byte)(3 << (p)->Shift++);                 \
+       }                                                               \
+} while (0)
 
 typedef struct
 {
@@ -144,8 +148,12 @@ typedef
   #endif
   CPpmd_Byte_Ref;
 
-#define PPMD_SetAllBitsIn256Bytes(p) \
-  { unsigned j; for (j = 0; j < 256 / sizeof(p[0]); j += 8) { \
-  p[j+7] = p[j+6] = p[j+5] = p[j+4] = p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0; }}
+#define PPMD_SetAllBitsIn256Bytes(p) do {                              \
+       unsigned j;                                                     \
+       for (j = 0; j < 256 / sizeof(p[0]); j += 8) {                   \
+               p[j+7] = p[j+6] = p[j+5] = p[j+4] =                     \
+                   p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;     \
+       }                                                               \
+} while (0)
 
 #endif
index 3a4915eff4064407dc3945f82b65bc6e4f0b41e5..19d049770b784bba60215526afe9e62f38964c94 100644 (file)
@@ -888,7 +888,7 @@ setup_sparse_fiemap(struct archive_read_disk *a,
        count = (sizeof(buff) - sizeof(*fm))/sizeof(*fe);
        fm = (struct fiemap *)buff;
        fm->fm_start = 0;
-       fm->fm_length = ~0ULL;;
+       fm->fm_length = ~0ULL;
        fm->fm_flags = FIEMAP_FLAG_SYNC;
        fm->fm_extent_count = count;
        do_fiemap = 1;
index 7bc1c6a31ceef3ccba9ed4498669d0d93ecdaa70..2a099bb4b09535910ed48c78a3e259e0b16f0ede 100644 (file)
@@ -4099,8 +4099,17 @@ sparc_Convert(struct _7zip *zip, uint8_t *buf, size_t size)
 
 #define RC_READ_BYTE (*buffer++)
 #define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
-#define RC_INIT2 zip->bcj2_code = 0; zip->bcj2_range = 0xFFFFFFFF; \
-  { int ii; for (ii = 0; ii < 5; ii++) { RC_TEST; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }}
+#define RC_INIT2 do {                                                  \
+       zip->bcj2_code = 0;                                             \
+       zip->bcj2_range = 0xFFFFFFFF;                                   \
+       {                                                               \
+               int ii;                                                 \
+               for (ii = 0; ii < 5; ii++) {                            \
+                       RC_TEST;                                        \
+                       zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; \
+               }                                                       \
+       }                                                               \
+} while (0)
 
 #define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
 
index 8a2197fdfe3aa71c4c9dd3dc406e6fa3d14bd360..8084c5a043f9d25217dcaacb9872619627f9533a 100644 (file)
@@ -2061,7 +2061,7 @@ xml_start(struct archive_read *a, const char *name, struct xmlattr_list *list)
                                        if (xar->file->link > 0)
                                                if (add_link(a, xar, xar->file) != ARCHIVE_OK) {
                                                        return (ARCHIVE_FATAL);
-                                               };
+                                               }
                                }
                        }
                }
index abf7ad669351783ce1ca1fb5f5fcd2baf63abe12..3ac67f37dc1909bea511d5eb5be5a262946d1959 100644 (file)
@@ -504,7 +504,7 @@ archive_wstring_append_from_mbs_in_codepage(struct archive_wstring *dest,
                        count = (int)mbsnbytes(s, length);
                }
                u16.s = (char *)dest->s;
-               u16.length = dest->length << 1;;
+               u16.length = dest->length << 1;
                u16.buffer_length = dest->buffer_length;
                if (sc->flag & SCONV_NORMALIZATION_C)
                        ret = archive_string_normalize_C(&u16, s, count, sc);
index 28cfefaff2156ce668916de94d6a17f0eecff309..b835695a5c46fa582a85cb0c521a817ce835557b 100644 (file)
@@ -807,7 +807,7 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
                __archive_write_entry_filetype_unsupported(
                    &a->archive, entry, "zip");
                return ARCHIVE_FAILED;
-       };
+       }
 
        /* If we're not using Zip64, reject large files. */
        if (zip->flags & ZIP_FLAG_AVOID_ZIP64) {
index 8ea1a3cb2839751bcb0e0f44fdcac9c890c35804..0345b1bed3465f6b732399dbe8778453b9b75d6b 100644 (file)
@@ -1149,7 +1149,7 @@ DEFINE_TEST(test_read_format_rar5_fileattr)
        assertEqualString("system", archive_entry_fflags_text(ae));
        archive_entry_fflags(ae, &set, &clear);
 #if defined(__FreeBSD__)
-       flag = UF_SYSTEM;;
+       flag = UF_SYSTEM;
 #elif defined(_WIN32) && !defined(CYGWIN)
        flag = FILE_ATTRIBUTE_SYSTEM;
 #endif
index 963d5e8beeafc86d72a12d525dbc37141b1e434f..23cde567059f60b4c8b2c4662c4c4eb152160978 100644 (file)
@@ -198,7 +198,7 @@ is_sparse_supported_fiemap(const char *path)
                return (0);
        fm = (struct fiemap *)buff;
        fm->fm_start = 0;
-       fm->fm_length = ~0ULL;;
+       fm->fm_length = ~0ULL;
        fm->fm_flags = FIEMAP_FLAG_SYNC;
        fm->fm_extent_count = (sizeof(buff) - sizeof(*fm))/
                sizeof(struct fiemap_extent);