1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Use std::byte in serializer

This commit is contained in:
Ivan Savenko
2024-02-02 02:36:57 +02:00
parent 29c0989849
commit 03fcfe3392
19 changed files with 41 additions and 50 deletions

View File

@@ -21,9 +21,9 @@ CSaveFile::CSaveFile(const boost::filesystem::path &fname)
//must be instantiated in .cpp file for access to complete types of all member fields
CSaveFile::~CSaveFile() = default;
int CSaveFile::write(const void * data, unsigned size)
int CSaveFile::write(const std::byte * data, unsigned size)
{
sfile->write((char *)data,size);
sfile->write(reinterpret_cast<const char *>(data), size);
return size;
}
@@ -66,7 +66,7 @@ void CSaveFile::clear()
void CSaveFile::putMagicBytes(const std::string &text)
{
write(text.c_str(), static_cast<unsigned int>(text.length()));
write(reinterpret_cast<const std::byte*>(text.c_str()), text.length());
}
VCMI_LIB_NAMESPACE_END