1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-13 11:40:38 +02:00

Fix: 9 typos

Signed-off-by: RoboSchmied <github@roboschmie.de>
This commit is contained in:
RoboSchmied 2024-03-28 03:03:44 +01:00
parent 9214044f80
commit 9c334f54fe
4 changed files with 9 additions and 9 deletions

View File

@ -25,7 +25,7 @@ Additionally, if your class is part of one of registered object hierarchies (bas
They are simply stored in a binary form, as in memory. Compatibility is ensued through the following means: They are simply stored in a binary form, as in memory. Compatibility is ensued through the following means:
- VCMI uses internally types that have constant, defined size (like int32_t - has 32 bits on all platforms) - VCMI uses internally types that have constant, defined size (like int32_t - has 32 bits on all platforms)
- serializer stores information about its endianess - serializer stores information about its endianness
It's not "really" portable, yet it works properly across all platforms we currently support. It's not "really" portable, yet it works properly across all platforms we currently support.
@ -132,7 +132,7 @@ struct DLL_LINKAGE Rumor
### Common information ### Common information
Serializer classes provide iostream-like interface with operator `<<` for serialization and operator `>>` for deserialization. Serializer upon creation will retrieve/store some metadata (version number, endianess), so even if no object is actually serialized, some data will be passed. Serializer classes provide iostream-like interface with operator `<<` for serialization and operator `>>` for deserialization. Serializer upon creation will retrieve/store some metadata (version number, endianness), so even if no object is actually serialized, some data will be passed.
### Serialization to file ### Serialization to file

View File

@ -18,7 +18,7 @@ BinaryDeserializer::BinaryDeserializer(IBinaryReader * r): CLoaderBase(r)
saving = false; saving = false;
version = Version::NONE; version = Version::NONE;
smartPointerSerialization = true; smartPointerSerialization = true;
reverseEndianess = false; reverseEndianness = false;
registerTypes(*this); registerTypes(*this);
} }

View File

@ -23,12 +23,12 @@ protected:
public: public:
CLoaderBase(IBinaryReader * r): reader(r){}; CLoaderBase(IBinaryReader * r): reader(r){};
inline void read(void * data, unsigned size, bool reverseEndianess) inline void read(void * data, unsigned size, bool reverseEndianness)
{ {
auto bytePtr = reinterpret_cast<std::byte*>(data); auto bytePtr = reinterpret_cast<std::byte*>(data);
reader->read(bytePtr, size); reader->read(bytePtr, size);
if(reverseEndianess) if(reverseEndianness)
std::reverse(bytePtr, bytePtr + size); std::reverse(bytePtr, bytePtr + size);
}; };
}; };
@ -153,7 +153,7 @@ class DLL_LINKAGE BinaryDeserializer : public CLoaderBase
public: public:
using Version = ESerializationVersion; using Version = ESerializationVersion;
bool reverseEndianess; //if source has different endianness than us, we reverse bytes bool reverseEndianness; //if source has different endianness than us, we reverse bytes
Version version; Version version;
std::map<ui32, void*> loadedPointers; std::map<ui32, void*> loadedPointers;
@ -174,7 +174,7 @@ public:
template < class T, typename std::enable_if_t < std::is_fundamental_v<T> && !std::is_same_v<T, bool>, int > = 0 > template < class T, typename std::enable_if_t < std::is_fundamental_v<T> && !std::is_same_v<T, bool>, int > = 0 >
void load(T &data) void load(T &data)
{ {
this->read(static_cast<void *>(&data), sizeof(data), reverseEndianess); this->read(static_cast<void *>(&data), sizeof(data), reverseEndianness);
} }
template < typename T, typename std::enable_if_t < is_serializeable<BinaryDeserializer, T>::value, int > = 0 > template < typename T, typename std::enable_if_t < is_serializeable<BinaryDeserializer, T>::value, int > = 0 >

View File

@ -29,7 +29,7 @@ int CLoadFile::read(std::byte * data, unsigned size)
void CLoadFile::openNextFile(const boost::filesystem::path & fname, ESerializationVersion minimalVersion) void CLoadFile::openNextFile(const boost::filesystem::path & fname, ESerializationVersion minimalVersion)
{ {
assert(!serializer.reverseEndianess); assert(!serializer.reverseEndianness);
assert(minimalVersion <= ESerializationVersion::CURRENT); assert(minimalVersion <= ESerializationVersion::CURRENT);
try try
@ -62,7 +62,7 @@ void CLoadFile::openNextFile(const boost::filesystem::path & fname, ESerializati
if(serializer.version == ESerializationVersion::CURRENT) if(serializer.version == ESerializationVersion::CURRENT)
{ {
logGlobal->warn("%s seems to have different endianness! Entering reversing mode.", fname.string()); logGlobal->warn("%s seems to have different endianness! Entering reversing mode.", fname.string());
serializer.reverseEndianess = true; serializer.reverseEndianness = true;
} }
else else
THROW_FORMAT("Error: too new file format (%s)!", fName); THROW_FORMAT("Error: too new file format (%s)!", fName);