diff options
| author | 2018-10-09 13:39:23 -0400 | |
|---|---|---|
| committer | 2018-10-09 14:10:13 -0400 | |
| commit | f7d2889fb46bf5589b53952c656fdc090334b9de (patch) | |
| tree | b0b1cb2608b66f2553a271614b1fc4eaa38f020d /src/core | |
| parent | ips_layer: std::move data within PatchIPS() and Apply() (diff) | |
| download | yuzu-f7d2889fb46bf5589b53952c656fdc090334b9de.tar.gz yuzu-f7d2889fb46bf5589b53952c656fdc090334b9de.tar.xz yuzu-f7d2889fb46bf5589b53952c656fdc090334b9de.zip | |
ips_layer: Add missing includes
Adds missing includes to prevent potential compilation issues in the
future. Also moves the definition of a struct into the cpp file, so that
some includes don't need to be introduced within the header.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/file_sys/ips_layer.cpp | 13 | ||||
| -rw-r--r-- | src/core/file_sys/ips_layer.h | 11 |
2 files changed, 17 insertions, 7 deletions
diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index b7a3df1b0..f832bf8e6 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp | |||
| @@ -2,9 +2,14 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <cstring> | ||
| 6 | #include <map> | ||
| 5 | #include <sstream> | 7 | #include <sstream> |
| 6 | #include "common/assert.h" | 8 | #include <string> |
| 9 | #include <utility> | ||
| 10 | |||
| 7 | #include "common/hex_util.h" | 11 | #include "common/hex_util.h" |
| 12 | #include "common/logging/log.h" | ||
| 8 | #include "common/swap.h" | 13 | #include "common/swap.h" |
| 9 | #include "core/file_sys/ips_layer.h" | 14 | #include "core/file_sys/ips_layer.h" |
| 10 | #include "core/file_sys/vfs_vector.h" | 15 | #include "core/file_sys/vfs_vector.h" |
| @@ -95,6 +100,12 @@ VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips) { | |||
| 95 | in->GetContainingDirectory()); | 100 | in->GetContainingDirectory()); |
| 96 | } | 101 | } |
| 97 | 102 | ||
| 103 | struct IPSwitchCompiler::IPSwitchPatch { | ||
| 104 | std::string name; | ||
| 105 | bool enabled; | ||
| 106 | std::map<u32, std::vector<u8>> records; | ||
| 107 | }; | ||
| 108 | |||
| 98 | IPSwitchCompiler::IPSwitchCompiler(VirtualFile patch_text_) : patch_text(std::move(patch_text_)) { | 109 | IPSwitchCompiler::IPSwitchCompiler(VirtualFile patch_text_) : patch_text(std::move(patch_text_)) { |
| 99 | Parse(); | 110 | Parse(); |
| 100 | } | 111 | } |
diff --git a/src/core/file_sys/ips_layer.h b/src/core/file_sys/ips_layer.h index 57da00da8..450b2f71e 100644 --- a/src/core/file_sys/ips_layer.h +++ b/src/core/file_sys/ips_layer.h | |||
| @@ -4,8 +4,11 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | ||
| 7 | #include <memory> | 8 | #include <memory> |
| 9 | #include <vector> | ||
| 8 | 10 | ||
| 11 | #include "common/common_types.h" | ||
| 9 | #include "core/file_sys/vfs.h" | 12 | #include "core/file_sys/vfs.h" |
| 10 | 13 | ||
| 11 | namespace FileSys { | 14 | namespace FileSys { |
| @@ -22,17 +25,13 @@ public: | |||
| 22 | VirtualFile Apply(const VirtualFile& in) const; | 25 | VirtualFile Apply(const VirtualFile& in) const; |
| 23 | 26 | ||
| 24 | private: | 27 | private: |
| 28 | struct IPSwitchPatch; | ||
| 29 | |||
| 25 | void ParseFlag(const std::string& flag); | 30 | void ParseFlag(const std::string& flag); |
| 26 | void Parse(); | 31 | void Parse(); |
| 27 | 32 | ||
| 28 | bool valid = false; | 33 | bool valid = false; |
| 29 | 34 | ||
| 30 | struct IPSwitchPatch { | ||
| 31 | std::string name; | ||
| 32 | bool enabled; | ||
| 33 | std::map<u32, std::vector<u8>> records; | ||
| 34 | }; | ||
| 35 | |||
| 36 | VirtualFile patch_text; | 35 | VirtualFile patch_text; |
| 37 | std::vector<IPSwitchPatch> patches; | 36 | std::vector<IPSwitchPatch> patches; |
| 38 | std::array<u8, 0x20> nso_build_id{}; | 37 | std::array<u8, 0x20> nso_build_id{}; |