diff options
author | Max Horn | 2009-01-23 03:30:40 +0000 |
---|---|---|
committer | Max Horn | 2009-01-23 03:30:40 +0000 |
commit | e4b013f616818f6da4cf7a1896f31d1429ef8f04 (patch) | |
tree | 81ea72ac2ccb737bd8e2934af9335c1f56f46c18 /common | |
parent | 3e7155981e020bc19540abc8486b816cb57c8a41 (diff) | |
download | scummvm-rg350-e4b013f616818f6da4cf7a1896f31d1429ef8f04.tar.gz scummvm-rg350-e4b013f616818f6da4cf7a1896f31d1429ef8f04.tar.bz2 scummvm-rg350-e4b013f616818f6da4cf7a1896f31d1429ef8f04.zip |
Renamed OSystem::openConfigFileForReading & openConfigFileForWriting to createConfigReadStream & createConfigWriteStream, in order to make it clear that the *caller* is responsible for deleting the streams (i.e., 'owns' them)
svn-id: r36013
Diffstat (limited to 'common')
-rw-r--r-- | common/config-manager.cpp | 4 | ||||
-rw-r--r-- | common/system.cpp | 4 | ||||
-rw-r--r-- | common/system.h | 4 | ||||
-rw-r--r-- | common/util.cpp | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp index e0a8dfa56b..88e5e8512a 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -62,7 +62,7 @@ ConfigManager::ConfigManager() void ConfigManager::loadDefaultConfigFile() { // Open the default config file - SeekableReadStream *stream = g_system->openConfigFileForReading(); + SeekableReadStream *stream = g_system->createConfigReadStream(); _filename.clear(); // clear the filename to indicate that we are using the default config file // ... load it, if available ... @@ -190,7 +190,7 @@ void ConfigManager::flushToDisk() { if (_filename.empty()) { // Write to the default config file - stream = g_system->openConfigFileForWriting(); + stream = g_system->createConfigWriteStream(); if (!stream) // If writing to the config file is not possible, do nothing return; } else { diff --git a/common/system.cpp b/common/system.cpp index 2d55162869..dbbfef54b2 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -114,12 +114,12 @@ void OSystem::clearScreen() { #define DEFAULT_CONFIG_FILE "scummvm.ini" #endif -Common::SeekableReadStream *OSystem::openConfigFileForReading() { +Common::SeekableReadStream *OSystem::createConfigReadStream() { Common::FSNode file(DEFAULT_CONFIG_FILE); return file.openForReading(); } -Common::WriteStream *OSystem::openConfigFileForWriting() { +Common::WriteStream *OSystem::createConfigWriteStream() { #ifdef __DC__ return 0; #else diff --git a/common/system.h b/common/system.h index 155ec81b8a..447feeebe5 100644 --- a/common/system.h +++ b/common/system.h @@ -908,7 +908,7 @@ public: * ReadStream instance. It is the callers responsiblity to delete * the stream after use. */ - virtual Common::SeekableReadStream *openConfigFileForReading(); + virtual Common::SeekableReadStream *createConfigReadStream(); /** * Open the default config file for writing, by returning a suitable @@ -917,7 +917,7 @@ public: * * May return 0 to indicate that writing to config file is not possible. */ - virtual Common::WriteStream *openConfigFileForWriting(); + virtual Common::WriteStream *createConfigWriteStream(); //@} }; diff --git a/common/util.cpp b/common/util.cpp index 3771c3433b..73e76fa94a 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -27,6 +27,8 @@ #include "common/system.h" #include "gui/debugger.h" +#include <stdarg.h> // For va_list etc. + #ifdef _WIN32_WCE // This is required for the debugger attachment extern bool isSmartphone(void); |