Răsfoiți Sursa

Warnings: Add UNREACHABLE macros to switches that contemplate all possible values.

Subv 9 ani în urmă
părinte
comite
65f19b51c4
3 a modificat fișierele cu 7 adăugiri și 2 ștergeri
  1. 2 0
      src/core/file_sys/archive_backend.cpp
  2. 3 0
      src/core/hle/kernel/kernel.h
  3. 2 2
      src/core/hw/gpu.h

+ 2 - 0
src/core/file_sys/archive_backend.cpp

@@ -90,6 +90,8 @@ std::u16string Path::AsU16Str() const {
         LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!");
         LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!");
         return {};
         return {};
     }
     }
+
+    UNREACHABLE();
 }
 }
 
 
 std::vector<u8> Path::AsBinary() const {
 std::vector<u8> Path::AsBinary() const {

+ 3 - 0
src/core/hle/kernel/kernel.h

@@ -8,6 +8,7 @@
 #include <string>
 #include <string>
 #include <utility>
 #include <utility>
 #include <boost/smart_ptr/intrusive_ptr.hpp>
 #include <boost/smart_ptr/intrusive_ptr.hpp>
+#include "common/assert.h"
 #include "common/common_types.h"
 #include "common/common_types.h"
 
 
 namespace Kernel {
 namespace Kernel {
@@ -84,6 +85,8 @@ public:
         case HandleType::ClientSession:
         case HandleType::ClientSession:
             return false;
             return false;
         }
         }
+
+        UNREACHABLE();
     }
     }
 
 
 public:
 public:

+ 2 - 2
src/core/hw/gpu.h

@@ -74,9 +74,9 @@ struct Regs {
         case PixelFormat::RGB5A1:
         case PixelFormat::RGB5A1:
         case PixelFormat::RGBA4:
         case PixelFormat::RGBA4:
             return 2;
             return 2;
-        default:
-            UNIMPLEMENTED();
         }
         }
+
+        UNREACHABLE();
     }
     }
 
 
     INSERT_PADDING_WORDS(0x4);
     INSERT_PADDING_WORDS(0x4);