- Fixed GCC/Clang regression post serialization.

This commit is contained in:
Edoardo Prezioso 2016-09-24 09:00:31 +02:00
parent b7c822d208
commit 7e4d0ecdbf
3 changed files with 5 additions and 5 deletions

View file

@ -1884,7 +1884,7 @@ void G_DoLoadGame ()
} }
else else
{ {
Printf("Savegame is from another ZDoom-based engine: %s\n", engine); Printf("Savegame is from another ZDoom-based engine: %s\n", engine.GetChars());
} }
delete resfile; delete resfile;
return; return;
@ -2261,7 +2261,7 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
} }
auto picdata = savepic.GetBuffer(); auto picdata = savepic.GetBuffer();
FCompressedBuffer bufpng = { picdata->Size(), picdata->Size(), METHOD_STORED, 0, crc32(0, &(*picdata)[0], picdata->Size()), (char*)&(*picdata)[0] }; FCompressedBuffer bufpng = { picdata->Size(), picdata->Size(), METHOD_STORED, 0, static_cast<unsigned int>(crc32(0, &(*picdata)[0], picdata->Size())), (char*)&(*picdata)[0] };
savegame_content.Push(bufpng); savegame_content.Push(bufpng);
savegame_filenames.Push("savepic.png"); savegame_filenames.Push("savepic.png");

View file

@ -859,7 +859,7 @@ void FSerializer::ReadObjects(bool hubtravel)
PClass *cls = PClass::FindClass(clsname); PClass *cls = PClass::FindClass(clsname);
if (cls == nullptr) if (cls == nullptr)
{ {
Printf("Unknown object class '%d' in savegame", clsname.GetChars()); Printf("Unknown object class '%s' in savegame", clsname.GetChars());
founderrors = true; founderrors = true;
r->mDObjects[i] = RUNTIME_CLASS(AActor)->CreateNew(); // make sure we got at least a valid pointer for the duration of the loading process. r->mDObjects[i] = RUNTIME_CLASS(AActor)->CreateNew(); // make sure we got at least a valid pointer for the duration of the loading process.
r->mDObjects[i]->Destroy(); // but we do not want to keep this around, so destroy it right away. r->mDObjects[i]->Destroy(); // but we do not want to keep this around, so destroy it right away.

View file

@ -163,7 +163,7 @@ public:
template<class T> template<class T>
FSerializer &Enum(const char *key, T &obj) FSerializer &Enum(const char *key, T &obj)
{ {
auto val = (std::underlying_type<T>::type)obj; auto val = (typename std::underlying_type<T>::type)obj;
Serialize(*this, key, val, nullptr); Serialize(*this, key, val, nullptr);
obj = (T)val; obj = (T)val;
return *this; return *this;
@ -299,4 +299,4 @@ FSerializer &Serialize(FSerializer &arc, const char *key, TFlags<T, TT> &flags,
} }
#endif #endif