Просмотр исходного кода

fsp_srv: Resolve -Wmaybe_uninitialized warning in OpenSaveDataFileSystem()

Initialize id to a deterministic value and also mark the unreachable
cases in the switch with UNREACHABLE().
Lioncash 5 лет назад
Родитель
Сommit
85db5f4091
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      src/core/hle/service/filesystem/fsp_srv.cpp

+ 5 - 2
src/core/hle/service/filesystem/fsp_srv.cpp

@@ -844,8 +844,7 @@ void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) {
         return;
     }
 
-    FileSys::StorageId id;
-
+    FileSys::StorageId id{};
     switch (parameters.space_id) {
     case FileSys::SaveDataSpaceId::NandUser:
         id = FileSys::StorageId::NandUser;
@@ -857,6 +856,10 @@ void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) {
     case FileSys::SaveDataSpaceId::NandSystem:
         id = FileSys::StorageId::NandSystem;
         break;
+    case FileSys::SaveDataSpaceId::TemporaryStorage:
+    case FileSys::SaveDataSpaceId::ProperSystem:
+    case FileSys::SaveDataSpaceId::SafeMode:
+        UNREACHABLE();
     }
 
     auto filesystem =