mirror of
https://github.com/PabloMK7/citra.git
synced 2025-10-11 20:10:03 +00:00
code: Use std::span where appropriate (#6658)
* code: Use std::span when possible * code: Prefix memcpy and memcmp with std::
This commit is contained in:
parent
4ccd9f24fb
commit
cf9bb90ae3
106 changed files with 362 additions and 329 deletions
|
@ -230,7 +230,7 @@ ResultVal<FileSys::ArchiveFormatInfo> ArchiveManager::GetArchiveFormatInfo(
|
|||
}
|
||||
|
||||
ResultCode ArchiveManager::CreateExtSaveData(MediaType media_type, u32 high, u32 low,
|
||||
const std::vector<u8>& smdh_icon,
|
||||
std::span<const u8> smdh_icon,
|
||||
const FileSys::ArchiveFormatInfo& format_info,
|
||||
u64 program_id) {
|
||||
// Construct the binary path to the archive first
|
||||
|
@ -247,10 +247,11 @@ ResultCode ArchiveManager::CreateExtSaveData(MediaType media_type, u32 high, u32
|
|||
auto ext_savedata = static_cast<FileSys::ArchiveFactory_ExtSaveData*>(archive->second.get());
|
||||
|
||||
ResultCode result = ext_savedata->Format(path, format_info, program_id);
|
||||
if (result.IsError())
|
||||
if (result.IsError()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
ext_savedata->WriteIcon(path, smdh_icon.data(), smdh_icon.size());
|
||||
ext_savedata->WriteIcon(path, smdh_icon);
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <boost/serialization/unique_ptr.hpp>
|
||||
#include <boost/serialization/unordered_map.hpp>
|
||||
#include "common/common_types.h"
|
||||
|
@ -219,7 +219,7 @@ public:
|
|||
* @return ResultCode 0 on success or the corresponding code on error
|
||||
*/
|
||||
ResultCode CreateExtSaveData(MediaType media_type, u32 high, u32 low,
|
||||
const std::vector<u8>& smdh_icon,
|
||||
std::span<const u8> smdh_icon,
|
||||
const FileSys::ArchiveFormatInfo& format_info, u64 program_id);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue