[Scummvm-git-logs] scummvm master -> c297d0f40f148244e8c85f3d6b6b4b0afe1be2f5
sev-
noreply at scummvm.org
Thu Mar 16 14:04:11 UTC 2023
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f8e85e9e4b COMMON: Add ability to disable valueless line warning in INI files.
c297d0f40f VCRUISE: Disable warning spam from Sfx files.
Commit: f8e85e9e4b88bd4956729dcafc2104ad523910e1
https://github.com/scummvm/scummvm/commit/f8e85e9e4b88bd4956729dcafc2104ad523910e1
Author: elasota (ejlasota at gmail.com)
Date: 2023-03-16T15:04:02+01:00
Commit Message:
COMMON: Add ability to disable valueless line warning in INI files.
Changed paths:
common/formats/ini-file.cpp
common/formats/ini-file.h
diff --git a/common/formats/ini-file.cpp b/common/formats/ini-file.cpp
index 237306e5fbf..0beb9e1e2a7 100644
--- a/common/formats/ini-file.cpp
+++ b/common/formats/ini-file.cpp
@@ -52,6 +52,7 @@ bool INIFile::isValidName(const String &name) const {
INIFile::INIFile() {
_allowNonEnglishCharacters = false;
+ _suppressValuelessLineWarning = false;
}
void INIFile::clear() {
@@ -172,7 +173,8 @@ bool INIFile::loadFromStream(SeekableReadStream &stream) {
// Split string at '=' into 'key' and 'value'. First, find the "=" delimeter.
const char *p = strchr(t, '=');
if (!p) {
- warning("Config file buggy: Junk found in line %d: '%s'", lineno, t);
+ if (!_suppressValuelessLineWarning)
+ warning("Config file buggy: Junk found in line %d: '%s'", lineno, t);
kv.key = String(t);
kv.value.clear();
} else {
@@ -476,4 +478,8 @@ void INIFile::allowNonEnglishCharacters() {
_allowNonEnglishCharacters = true;
}
+void INIFile::suppressValuelessLineWarning() {
+ _suppressValuelessLineWarning = true;
+}
+
} // End of namespace Common
diff --git a/common/formats/ini-file.h b/common/formats/ini-file.h
index d6665f49611..a2767d5c487 100644
--- a/common/formats/ini-file.h
+++ b/common/formats/ini-file.h
@@ -131,11 +131,13 @@ public:
void listKeyValues(StringMap &kv); /*!< Get a list of all key/value pairs in this INI file. */
void allowNonEnglishCharacters(); /*!< Allow non-English characters in this INI file. */
+ void suppressValuelessLineWarning(); /*!< Disable warnings for lines that contain only keys. */
private:
String _defaultSectionName;
SectionList _sections;
bool _allowNonEnglishCharacters;
+ bool _suppressValuelessLineWarning;
Section *getSection(const String §ion);
const Section *getSection(const String §ion) const;
Commit: c297d0f40f148244e8c85f3d6b6b4b0afe1be2f5
https://github.com/scummvm/scummvm/commit/c297d0f40f148244e8c85f3d6b6b4b0afe1be2f5
Author: elasota (ejlasota at gmail.com)
Date: 2023-03-16T15:04:02+01:00
Commit Message:
VCRUISE: Disable warning spam from Sfx files.
Changed paths:
engines/vcruise/runtime.cpp
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 61e89284ef5..79d005a3e43 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -164,6 +164,8 @@ void SfxData::load(Common::SeekableReadStream &stream, Audio::Mixer *mixer) {
Common::INIFile iniFile;
iniFile.allowNonEnglishCharacters();
+ iniFile.suppressValuelessLineWarning();
+
if (!iniFile.loadFromStream(stream))
warning("SfxData::load failed to parse INI file");
More information about the Scummvm-git-logs
mailing list