From fac5e35d24d635ec3ea9bc58500eafd54482b5b6 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Fri, 17 Jan 2025 00:20:33 -0500 Subject: [PATCH] Prefer empty braces to semicolons for empty loop bodies --- src/asm/charmap.cpp | 3 +-- src/asm/parser.y | 3 +-- src/link/patch.cpp | 9 +++------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/asm/charmap.cpp b/src/asm/charmap.cpp index 1aa1beb9..84678b87 100644 --- a/src/asm/charmap.cpp +++ b/src/asm/charmap.cpp @@ -168,8 +168,7 @@ bool charmap_HasChar(std::string const &input) { std::vector charmap_Convert(std::string const &input) { std::vector output; - for (std::string_view inputView = input; charmap_ConvertNext(inputView, &output);) - ; + for (std::string_view inputView = input; charmap_ConvertNext(inputView, &output);) {} return output; } diff --git a/src/asm/parser.y b/src/asm/parser.y index 437c6afa..2c8683c6 100644 --- a/src/asm/parser.y +++ b/src/asm/parser.y @@ -2577,8 +2577,7 @@ static size_t charlenUTF8(std::string const &str) { std::string_view view = str; size_t len; - for (len = 0; charmap_ConvertNext(view, nullptr); len++) - ; + for (len = 0; charmap_ConvertNext(view, nullptr); len++) {} return len; } diff --git a/src/link/patch.cpp b/src/link/patch.cpp index 9270782b..e12e767b 100644 --- a/src/link/patch.cpp +++ b/src/link/patch.cpp @@ -250,8 +250,7 @@ static int32_t computeRPNExpr(Patch const &patch, std::vector const &fil // `expression` is not guaranteed to be '\0'-terminated. If it is not, // `getRPNByte` will have a fatal internal error. char const *name = reinterpret_cast(expression); - while (getRPNByte(expression, size, patch)) - ; + while (getRPNByte(expression, size, patch)) {} if (Section const *sect = sect_GetSection(name); !sect) { error( @@ -281,8 +280,7 @@ static int32_t computeRPNExpr(Patch const &patch, std::vector const &fil case RPN_SIZEOF_SECT: { // This has assumptions commented in the `RPN_BANK_SECT` case above. char const *name = reinterpret_cast(expression); - while (getRPNByte(expression, size, patch)) - ; + while (getRPNByte(expression, size, patch)) {} if (Section const *sect = sect_GetSection(name); !sect) { error( @@ -302,8 +300,7 @@ static int32_t computeRPNExpr(Patch const &patch, std::vector const &fil case RPN_STARTOF_SECT: { // This has assumptions commented in the `RPN_BANK_SECT` case above. char const *name = reinterpret_cast(expression); - while (getRPNByte(expression, size, patch)) - ; + while (getRPNByte(expression, size, patch)) {} if (Section const *sect = sect_GetSection(name); !sect) { error(