mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Merge pull request #3604 from lioncash/ptr
archive_systemsavedata: Remove pointer cast from GetSystemSaveDataPath()
This commit is contained in:
		
						commit
						1c4b230346
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		|  | @ -3,6 +3,7 @@ | ||||||
| // Refer to the license.txt file included.
 | // Refer to the license.txt file included.
 | ||||||
| 
 | 
 | ||||||
| #include <algorithm> | #include <algorithm> | ||||||
|  | #include <cstring> | ||||||
| #include <memory> | #include <memory> | ||||||
| #include <vector> | #include <vector> | ||||||
| #include "common/common_types.h" | #include "common/common_types.h" | ||||||
|  | @ -19,10 +20,11 @@ | ||||||
| namespace FileSys { | namespace FileSys { | ||||||
| 
 | 
 | ||||||
| std::string GetSystemSaveDataPath(const std::string& mount_point, const Path& path) { | std::string GetSystemSaveDataPath(const std::string& mount_point, const Path& path) { | ||||||
|     std::vector<u8> vec_data = path.AsBinary(); |     const std::vector<u8> vec_data = path.AsBinary(); | ||||||
|     const u32* data = reinterpret_cast<const u32*>(vec_data.data()); |     u32 save_low; | ||||||
|     u32 save_low = data[1]; |     u32 save_high; | ||||||
|     u32 save_high = data[0]; |     std::memcpy(&save_low, &vec_data[4], sizeof(u32)); | ||||||
|  |     std::memcpy(&save_high, &vec_data[0], sizeof(u32)); | ||||||
|     return Common::StringFromFormat("%s%08X/%08X/", mount_point.c_str(), save_low, save_high); |     return Common::StringFromFormat("%s%08X/%08X/", mount_point.c_str(), save_low, save_high); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue