diff options
| author | 2021-04-27 12:05:34 -0400 | |
|---|---|---|
| committer | 2021-04-27 12:48:15 -0400 | |
| commit | 724c19a307f31ce1122fb8047c86d5a126d0860f (patch) | |
| tree | 605b89f42d7897aac46f06add54c34201d9354bd /src/core/loader/loader.h | |
| parent | Merge pull request #6246 from lioncash/shadow (diff) | |
| download | yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.tar.gz yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.tar.xz yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.zip | |
loader: Resolve instances of variable shadowing
Eliminates variable shadowing cases across all the loaders to bring us
closer to enabling variable shadowing as an error in core.
Diffstat (limited to 'src/core/loader/loader.h')
| -rw-r--r-- | src/core/loader/loader.h | 57 |
1 files changed, 41 insertions, 16 deletions
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index b2e5b13de..bf6db1ab1 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h | |||
| @@ -152,21 +152,26 @@ public: | |||
| 152 | 152 | ||
| 153 | /** | 153 | /** |
| 154 | * Returns the type of this file | 154 | * Returns the type of this file |
| 155 | * | ||
| 155 | * @return FileType corresponding to the loaded file | 156 | * @return FileType corresponding to the loaded file |
| 156 | */ | 157 | */ |
| 157 | virtual FileType GetFileType() const = 0; | 158 | virtual FileType GetFileType() const = 0; |
| 158 | 159 | ||
| 159 | /** | 160 | /** |
| 160 | * Load the application and return the created Process instance | 161 | * Load the application and return the created Process instance |
| 162 | * | ||
| 161 | * @param process The newly created process. | 163 | * @param process The newly created process. |
| 162 | * @param system The system that this process is being loaded under. | 164 | * @param system The system that this process is being loaded under. |
| 165 | * | ||
| 163 | * @return The status result of the operation. | 166 | * @return The status result of the operation. |
| 164 | */ | 167 | */ |
| 165 | virtual LoadResult Load(Kernel::Process& process, Core::System& system) = 0; | 168 | virtual LoadResult Load(Kernel::Process& process, Core::System& system) = 0; |
| 166 | 169 | ||
| 167 | /** | 170 | /** |
| 168 | * Get the code (typically .code section) of the application | 171 | * Get the code (typically .code section) of the application |
| 169 | * @param buffer Reference to buffer to store data | 172 | * |
| 173 | * @param[out] buffer Reference to buffer to store data | ||
| 174 | * | ||
| 170 | * @return ResultStatus result of function | 175 | * @return ResultStatus result of function |
| 171 | */ | 176 | */ |
| 172 | virtual ResultStatus ReadCode(std::vector<u8>& buffer) { | 177 | virtual ResultStatus ReadCode(std::vector<u8>& buffer) { |
| @@ -175,7 +180,9 @@ public: | |||
| 175 | 180 | ||
| 176 | /** | 181 | /** |
| 177 | * Get the icon (typically icon section) of the application | 182 | * Get the icon (typically icon section) of the application |
| 178 | * @param buffer Reference to buffer to store data | 183 | * |
| 184 | * @param[out] buffer Reference to buffer to store data | ||
| 185 | * | ||
| 179 | * @return ResultStatus result of function | 186 | * @return ResultStatus result of function |
| 180 | */ | 187 | */ |
| 181 | virtual ResultStatus ReadIcon(std::vector<u8>& buffer) { | 188 | virtual ResultStatus ReadIcon(std::vector<u8>& buffer) { |
| @@ -186,7 +193,9 @@ public: | |||
| 186 | * Get the banner (typically banner section) of the application | 193 | * Get the banner (typically banner section) of the application |
| 187 | * In the context of NX, this is the animation that displays in the bottom right of the screen | 194 | * In the context of NX, this is the animation that displays in the bottom right of the screen |
| 188 | * when a game boots. Stored in GIF format. | 195 | * when a game boots. Stored in GIF format. |
| 189 | * @param buffer Reference to buffer to store data | 196 | * |
| 197 | * @param[out] buffer Reference to buffer to store data | ||
| 198 | * | ||
| 190 | * @return ResultStatus result of function | 199 | * @return ResultStatus result of function |
| 191 | */ | 200 | */ |
| 192 | virtual ResultStatus ReadBanner(std::vector<u8>& buffer) { | 201 | virtual ResultStatus ReadBanner(std::vector<u8>& buffer) { |
| @@ -197,7 +206,9 @@ public: | |||
| 197 | * Get the logo (typically logo section) of the application | 206 | * Get the logo (typically logo section) of the application |
| 198 | * In the context of NX, this is the static image that displays in the top left of the screen | 207 | * In the context of NX, this is the static image that displays in the top left of the screen |
| 199 | * when a game boots. Stored in JPEG format. | 208 | * when a game boots. Stored in JPEG format. |
| 200 | * @param buffer Reference to buffer to store data | 209 | * |
| 210 | * @param[out] buffer Reference to buffer to store data | ||
| 211 | * | ||
| 201 | * @return ResultStatus result of function | 212 | * @return ResultStatus result of function |
| 202 | */ | 213 | */ |
| 203 | virtual ResultStatus ReadLogo(std::vector<u8>& buffer) { | 214 | virtual ResultStatus ReadLogo(std::vector<u8>& buffer) { |
| @@ -206,7 +217,9 @@ public: | |||
| 206 | 217 | ||
| 207 | /** | 218 | /** |
| 208 | * Get the program id of the application | 219 | * Get the program id of the application |
| 209 | * @param out_program_id Reference to store program id into | 220 | * |
| 221 | * @param[out] out_program_id Reference to store program id into | ||
| 222 | * | ||
| 210 | * @return ResultStatus result of function | 223 | * @return ResultStatus result of function |
| 211 | */ | 224 | */ |
| 212 | virtual ResultStatus ReadProgramId(u64& out_program_id) { | 225 | virtual ResultStatus ReadProgramId(u64& out_program_id) { |
| @@ -216,19 +229,23 @@ public: | |||
| 216 | /** | 229 | /** |
| 217 | * Get the RomFS of the application | 230 | * Get the RomFS of the application |
| 218 | * Since the RomFS can be huge, we return a file reference instead of copying to a buffer | 231 | * Since the RomFS can be huge, we return a file reference instead of copying to a buffer |
| 219 | * @param file The directory containing the RomFS | 232 | * |
| 233 | * @param[out] out_file The directory containing the RomFS | ||
| 234 | * | ||
| 220 | * @return ResultStatus result of function | 235 | * @return ResultStatus result of function |
| 221 | */ | 236 | */ |
| 222 | virtual ResultStatus ReadRomFS(FileSys::VirtualFile& file) { | 237 | virtual ResultStatus ReadRomFS(FileSys::VirtualFile& out_file) { |
| 223 | return ResultStatus::ErrorNotImplemented; | 238 | return ResultStatus::ErrorNotImplemented; |
| 224 | } | 239 | } |
| 225 | 240 | ||
| 226 | /** | 241 | /** |
| 227 | * Get the raw update of the application, should it come packed with one | 242 | * Get the raw update of the application, should it come packed with one |
| 228 | * @param file The raw update NCA file (Program-type | 243 | * |
| 244 | * @param[out] out_file The raw update NCA file (Program-type) | ||
| 245 | * | ||
| 229 | * @return ResultStatus result of function | 246 | * @return ResultStatus result of function |
| 230 | */ | 247 | */ |
| 231 | virtual ResultStatus ReadUpdateRaw(FileSys::VirtualFile& file) { | 248 | virtual ResultStatus ReadUpdateRaw(FileSys::VirtualFile& out_file) { |
| 232 | return ResultStatus::ErrorNotImplemented; | 249 | return ResultStatus::ErrorNotImplemented; |
| 233 | } | 250 | } |
| 234 | 251 | ||
| @@ -236,7 +253,8 @@ public: | |||
| 236 | * Get whether or not updates can be applied to the RomFS. | 253 | * Get whether or not updates can be applied to the RomFS. |
| 237 | * By default, this is true, however for formats where it cannot be guaranteed that the RomFS is | 254 | * By default, this is true, however for formats where it cannot be guaranteed that the RomFS is |
| 238 | * the base game it should be set to false. | 255 | * the base game it should be set to false. |
| 239 | * @return bool whether or not updatable. | 256 | * |
| 257 | * @return bool indicating whether or not the RomFS is updatable. | ||
| 240 | */ | 258 | */ |
| 241 | virtual bool IsRomFSUpdatable() const { | 259 | virtual bool IsRomFSUpdatable() const { |
| 242 | return true; | 260 | return true; |
| @@ -244,8 +262,9 @@ public: | |||
| 244 | 262 | ||
| 245 | /** | 263 | /** |
| 246 | * Gets the difference between the start of the IVFC header and the start of level 6 (RomFS) | 264 | * Gets the difference between the start of the IVFC header and the start of level 6 (RomFS) |
| 247 | * data. Needed for bktr patching. | 265 | * data. Needed for BKTR patching. |
| 248 | * @return IVFC offset for romfs. | 266 | * |
| 267 | * @return IVFC offset for RomFS. | ||
| 249 | */ | 268 | */ |
| 250 | virtual u64 ReadRomFSIVFCOffset() const { | 269 | virtual u64 ReadRomFSIVFCOffset() const { |
| 251 | return 0; | 270 | return 0; |
| @@ -253,7 +272,9 @@ public: | |||
| 253 | 272 | ||
| 254 | /** | 273 | /** |
| 255 | * Get the title of the application | 274 | * Get the title of the application |
| 256 | * @param title Reference to store the application title into | 275 | * |
| 276 | * @param[out] title Reference to store the application title into | ||
| 277 | * | ||
| 257 | * @return ResultStatus result of function | 278 | * @return ResultStatus result of function |
| 258 | */ | 279 | */ |
| 259 | virtual ResultStatus ReadTitle(std::string& title) { | 280 | virtual ResultStatus ReadTitle(std::string& title) { |
| @@ -262,7 +283,9 @@ public: | |||
| 262 | 283 | ||
| 263 | /** | 284 | /** |
| 264 | * Get the control data (CNMT) of the application | 285 | * Get the control data (CNMT) of the application |
| 265 | * @param control Reference to store the application control data into | 286 | * |
| 287 | * @param[out] control Reference to store the application control data into | ||
| 288 | * | ||
| 266 | * @return ResultStatus result of function | 289 | * @return ResultStatus result of function |
| 267 | */ | 290 | */ |
| 268 | virtual ResultStatus ReadControlData(FileSys::NACP& control) { | 291 | virtual ResultStatus ReadControlData(FileSys::NACP& control) { |
| @@ -271,10 +294,12 @@ public: | |||
| 271 | 294 | ||
| 272 | /** | 295 | /** |
| 273 | * Get the RomFS of the manual of the application | 296 | * Get the RomFS of the manual of the application |
| 274 | * @param file The raw manual RomFS of the game | 297 | * |
| 298 | * @param[out] out_file The raw manual RomFS of the game | ||
| 299 | * | ||
| 275 | * @return ResultStatus result of function | 300 | * @return ResultStatus result of function |
| 276 | */ | 301 | */ |
| 277 | virtual ResultStatus ReadManualRomFS(FileSys::VirtualFile& file) { | 302 | virtual ResultStatus ReadManualRomFS(FileSys::VirtualFile& out_file) { |
| 278 | return ResultStatus::ErrorNotImplemented; | 303 | return ResultStatus::ErrorNotImplemented; |
| 279 | } | 304 | } |
| 280 | 305 | ||