]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
refactor: Use [[fallthrough]] attribute
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 19 Jun 2022 12:24:50 +0000 (14:24 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 19 Jun 2022 19:29:02 +0000 (21:29 +0200)
src/Args.cpp
src/Util.cpp
src/Win32Util.cpp

index f8796e0e9f04cfbd537c1342b40dd26926b91086..9b1dfbd1ef5a4b50a6b3bc9ac10d16b1471578fc 100644 (file)
@@ -87,7 +87,7 @@ Args::from_atfile(const std::string& filename, AtFileFormat format)
       if (format == AtFileFormat::msvc) {
         break;
       }
-      // Fall through.
+      [[fallthrough]];
 
     case '"':
       if (quoting != '\0') {
@@ -111,7 +111,7 @@ Args::from_atfile(const std::string& filename, AtFileFormat format)
       if (quoting) {
         break;
       }
-      // Fall through.
+      [[fallthrough]];
 
     case '\0':
       // End of token
index ebb69bf1830c00a76c719f516dc6998406c16828..089198ca84f33fcfd6b1330c18cc92c23e875be7 100644 (file)
@@ -1059,13 +1059,13 @@ parse_size(const std::string& value)
     switch (*p) {
     case 'T':
       result *= multiplier;
-    // Fallthrough.
+      [[fallthrough]];
     case 'G':
       result *= multiplier;
-    // Fallthrough.
+      [[fallthrough]];
     case 'M':
       result *= multiplier;
-    // Fallthrough.
+      [[fallthrough]];
     case 'K':
     case 'k':
       result *= multiplier;
@@ -1270,7 +1270,7 @@ send_to_fd(const Context& ctx, const std::string& text, int fd)
       modified_text = strip_ansi_csi_seqs(text);
       text_to_send = &modified_text;
     } catch (const core::Error&) {
-      // Fall through
+      // Ignore.
     }
   }
 
index e677107b7e128e876fdab1d73c5bd95a80ce4078..92d1ffb58a505360a7524efbc28002d898457042 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2021 Joel Rosdahl and other contributors
+// Copyright (C) 2020-2022 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -97,10 +97,12 @@ argv_to_string(const char* const* argv,
           ++bs;
           break;
         }
-        // Fallthrough.
+        [[fallthrough]];
+
       case '"':
         bs = (bs << 1) + 1;
-      // Fallthrough.
+        [[fallthrough]];
+
       default:
         while (bs > 0) {
           result += '\\';