clear -Wextra-semi-stmt warnings

This is available with clang. Clears warnings of the form:
  warning: empty expression statement has no effect; remove unnecessary
    ';' to silence this warning [-Wextra-semi-stmt]

As a side-effect it also clear a few -Wpedantic warnings with gcc:
  warning: ISO C does not allow extra ';' outside of a function
    [-Wpedantic]

Change-Id: I9295c767aad475c68b1fbbdff855b0d6650a25f5
This commit is contained in:
James Zern
2024-02-15 18:10:26 -08:00
parent 713982b883
commit f4b9bc9ea1
14 changed files with 120 additions and 95 deletions

View File

@ -66,14 +66,16 @@ void WebPMuxDelete(WebPMux* mux) {
// Handy MACRO, makes MuxSet() very symmetric to MuxGet().
#define SWITCH_ID_LIST(INDEX, LIST) \
if (idx == (INDEX)) { \
err = ChunkAssignData(&chunk, data, copy_data, tag); \
if (err == WEBP_MUX_OK) { \
err = ChunkSetHead(&chunk, (LIST)); \
if (err != WEBP_MUX_OK) ChunkRelease(&chunk); \
do { \
if (idx == (INDEX)) { \
err = ChunkAssignData(&chunk, data, copy_data, tag); \
if (err == WEBP_MUX_OK) { \
err = ChunkSetHead(&chunk, (LIST)); \
if (err != WEBP_MUX_OK) ChunkRelease(&chunk); \
} \
return err; \
} \
return err; \
}
} while (0)
static WebPMuxError MuxSet(WebPMux* const mux, uint32_t tag,
const WebPData* const data, int copy_data) {

View File

@ -21,16 +21,18 @@
// Handy MACRO.
#define SWITCH_ID_LIST(INDEX, LIST) \
if (idx == (INDEX)) { \
const WebPChunk* const chunk = ChunkSearchList((LIST), nth, \
kChunks[(INDEX)].tag); \
if (chunk) { \
*data = chunk->data_; \
return WEBP_MUX_OK; \
} else { \
return WEBP_MUX_NOT_FOUND; \
do { \
if (idx == (INDEX)) { \
const WebPChunk* const chunk = ChunkSearchList((LIST), nth, \
kChunks[(INDEX)].tag); \
if (chunk) { \
*data = chunk->data_; \
return WEBP_MUX_OK; \
} else { \
return WEBP_MUX_NOT_FOUND; \
} \
} \
}
} while (0)
static WebPMuxError MuxGet(const WebPMux* const mux, CHUNK_INDEX idx,
uint32_t nth, WebPData* const data) {