]> git.ipfire.org Git - thirdparty/zstd.git/commit
Modernize macros to use `do { } while (0)`
authorNick Terrell <terrelln@meta.com>
Tue, 21 Nov 2023 21:26:25 +0000 (13:26 -0800)
committerNick Terrell <nickrterrell@gmail.com>
Wed, 22 Nov 2023 01:05:17 +0000 (20:05 -0500)
commit8193250615f56ace446a3bf963d195f9f33fa9a9
treee2862062fb239157fd07117599e8fcfed51d13e8
parent6b3d12fe5479940a274d8b54db5d99b91a6bce41
Modernize macros to use `do { } while (0)`

This PR introduces no functional changes. It attempts to change all
macros currently using `{ }` or some variant of that to to
`do { } while (0)`, and introduces trailing `;` where necessary.
There were no bugs found during this migration.

The bug in Visual Studios warning on this has been fixed since VS2015.
Additionally, we have several instances of `do { } while (0)` which have
been present for several releases, so we don't have to worry about
breaking peoples builds.

Fixes Issue #3830.
12 files changed:
lib/common/compiler.h
lib/common/debug.h
lib/common/error_private.h
lib/common/zstd_internal.h
lib/compress/zstd_compress.c
lib/compress/zstd_double_fast.c
lib/compress/zstd_fast.c
lib/compress/zstd_opt.c
lib/compress/zstdmt_compress.c
lib/decompress/huf_decompress.c
lib/decompress/zstd_decompress.c
lib/dictBuilder/zdict.c