From a2494033a1c99ada61dd74b7f6f716c877bf89f4 Mon Sep 17 00:00:00 2001 From: Le Philousophe Date: Tue, 8 Oct 2024 08:30:16 +0200 Subject: [PATCH] DO NOT MERGE: Check commit --- backends/platform/psp/tests.cpp | 4 ++-- backends/saves/default/default-saves.cpp | 2 +- common/file.cpp | 2 +- common/fs.h | 2 +- common/system.cpp | 2 +- engines/bladerunner/debugger.cpp | 2 +- engines/director/lingo/xlibs/unittest.cpp | 2 +- engines/kyra/gui/saveload_eob.cpp | 2 +- engines/testbed/config.cpp | 2 +- engines/testbed/fs.cpp | 2 +- gui/downloadpacksdialog.cpp | 2 +- test/image/blending.h | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/backends/platform/psp/tests.cpp b/backends/platform/psp/tests.cpp index 5d49108a233a7..22740713a8957 100644 --- a/backends/platform/psp/tests.cpp +++ b/backends/platform/psp/tests.cpp @@ -562,7 +562,7 @@ bool PspUnitTests::testFileSystem() { PSP_INFO_PRINT("creating write stream...\n"); - wrStream = file.createWriteStream(); + wrStream = file.createWriteStream(true); if (!wrStream) { PSP_ERROR("%s couldn't be created.\n", path); delete[] buffer; @@ -654,7 +654,7 @@ bool PspUnitTests::testFileSystem() { PSP_INFO_PRINT("writing...\n"); - wrStream = file.createWriteStream(); + wrStream = file.createWriteStream(true); if (!wrStream) { PSP_ERROR("%s couldn't be created.\n", path); return false; diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index 957602a73e752..7203cd3822efc 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -162,7 +162,7 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String } // Open the file for saving. - Common::SeekableWriteStream *const sf = fileNode.createWriteStream(); + Common::SeekableWriteStream *const sf = fileNode.createWriteStream(true); if (!sf) return nullptr; Common::OutSaveFile *const result = new Common::OutSaveFile(compress ? Common::wrapCompressedWriteStream(sf) : sf); diff --git a/common/file.cpp b/common/file.cpp index 45f1087f09df3..2ba0b9c1bd36c 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -197,7 +197,7 @@ bool DumpFile::open(const FSNode &node) { return false; } - _handle = node.createWriteStream(); + _handle = node.createWriteStream(true); if (_handle == nullptr) debug(2, "File %s not found", node.getName().c_str()); diff --git a/common/fs.h b/common/fs.h index b5c6f8d95a806..5c3379655ebe7 100644 --- a/common/fs.h +++ b/common/fs.h @@ -283,7 +283,7 @@ class FSNode : public ArchiveMember { * * @return Pointer to the stream object, 0 in case of a failure. */ - SeekableWriteStream *createWriteStream(bool atomic = true) const; + SeekableWriteStream *createWriteStream(bool atomic /*= true*/) const; /** * Create a directory referred by this node. This assumes that this diff --git a/common/system.cpp b/common/system.cpp index 6d0b013e8c447..a24c20dd38c3e 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -238,7 +238,7 @@ Common::WriteStream *OSystem::createConfigWriteStream() { return nullptr; #else Common::FSNode file(getDefaultConfigFileName()); - return file.createWriteStream(); + return file.createWriteStream(true); #endif } diff --git a/engines/bladerunner/debugger.cpp b/engines/bladerunner/debugger.cpp index 426bdda0d2c39..285e4a4518dce 100644 --- a/engines/bladerunner/debugger.cpp +++ b/engines/bladerunner/debugger.cpp @@ -1202,7 +1202,7 @@ bool Debugger::cmdSave(int argc, const char **argv) { return true; } - Common::WriteStream *saveFile = fs.createWriteStream(); + Common::WriteStream *saveFile = fs.createWriteStream(true); Graphics::Surface thumbnail = _vm->generateThumbnail(); diff --git a/engines/director/lingo/xlibs/unittest.cpp b/engines/director/lingo/xlibs/unittest.cpp index 4ac4f2046c8eb..df9c61248f355 100644 --- a/engines/director/lingo/xlibs/unittest.cpp +++ b/engines/director/lingo/xlibs/unittest.cpp @@ -136,7 +136,7 @@ void UnitTestXObj::m_screenshot(int nargs) { Common::FSNode file = screenDir.getChild(Common::String::format("%s.bmp", filenameBase.c_str())); #endif - Common::SeekableWriteStream *stream = file.createWriteStream(); + Common::SeekableWriteStream *stream = file.createWriteStream(true); if (!stream) { warning("UnitTestXObj::m_screenshot(): could not open file %s", file.getPath().toString(Common::Path::kNativeSeparator).c_str()); return; diff --git a/engines/kyra/gui/saveload_eob.cpp b/engines/kyra/gui/saveload_eob.cpp index 868d3ad4634f9..d64909796f452 100644 --- a/engines/kyra/gui/saveload_eob.cpp +++ b/engines/kyra/gui/saveload_eob.cpp @@ -1090,7 +1090,7 @@ bool EoBCoreEngine::saveAsOriginalSaveFile(int slot) { return false; Common::FSNode nf = nd.getChild(_flags.gameID == GI_EOB1 ? "EOBDATA.SAV" : Common::String::format("EOBDATA%d.SAV", slot)); - Common::OutSaveFile *out = new Common::OutSaveFile(nf.createWriteStream()); + Common::OutSaveFile *out = new Common::OutSaveFile(nf.createWriteStream(true)); if (_flags.gameID == GI_EOB2) { static const char tempStr[31] = "SCUMMVM EXPORT\0"; diff --git a/engines/testbed/config.cpp b/engines/testbed/config.cpp index aa9555fd67cb4..5b53da243eb1c 100644 --- a/engines/testbed/config.cpp +++ b/engines/testbed/config.cpp @@ -235,7 +235,7 @@ Common::WriteStream *TestbedConfigManager::getConfigWriteStream() const { Common::WriteStream *ws; Common::FSNode gameRoot(path); Common::FSNode config = gameRoot.getChild(_configFileName); - ws = config.createWriteStream(); + ws = config.createWriteStream(true); return ws; } diff --git a/engines/testbed/fs.cpp b/engines/testbed/fs.cpp index 8edf98f68dd88..6cc54b294d3c9 100644 --- a/engines/testbed/fs.cpp +++ b/engines/testbed/fs.cpp @@ -143,7 +143,7 @@ TestExitStatus FStests::testWriteFile() { Common::FSNode fileToWrite = gameRoot.getChild("testbed.out"); - Common::WriteStream *ws = fileToWrite.createWriteStream(); + Common::WriteStream *ws = fileToWrite.createWriteStream(true); if (!ws) { Testsuite::logDetailedPrintf("Can't open writable file in game data dir\n"); diff --git a/gui/downloadpacksdialog.cpp b/gui/downloadpacksdialog.cpp index ed02282c5b62a..99ba6f6b30f58 100644 --- a/gui/downloadpacksdialog.cpp +++ b/gui/downloadpacksdialog.cpp @@ -470,7 +470,7 @@ void DownloadPacksDialog::clearCache() { for (auto ic = iconFiles.begin(); ic != iconFiles.end(); ++ic) { Common::String fname = (*ic)->getName(); Common::FSNode fs(iconsPath.join(fname)); - Common::WriteStream *str = fs.createWriteStream(); + Common::WriteStream *str = fs.createWriteStream(true); // Overwrite previously downloaded pack files with dummy data str->writeByte(0); diff --git a/test/image/blending.h b/test/image/blending.h index d898223f1d400..d4a125e3d45ce 100644 --- a/test/image/blending.h +++ b/test/image/blending.h @@ -748,7 +748,7 @@ OldTransparentSurface *OldTransparentSurface::scale(int16 newWidth, int16 newHei #ifdef TEST_IMAGE_BLENDING_SAVE static int save_bitmap(const char *path, const Graphics::Surface *surf) { Common::FSNode fileNode(path); - Common::SeekableWriteStream *out = fileNode.createWriteStream(); + Common::SeekableWriteStream *out = fileNode.createWriteStream(true); #ifdef SCUMM_LITTLE_ENDIAN const Graphics::PixelFormat requiredFormat_3byte(3, 8, 8, 8, 0, 16, 8, 0, 0); #else