diff options
author | Gregory Montoir | 2006-11-27 00:51:14 +0000 |
---|---|---|
committer | Gregory Montoir | 2006-11-27 00:51:14 +0000 |
commit | b2fb23a134d7f6486bef0922159fa747411d9f14 (patch) | |
tree | f5b109adf53ba2a8a17653877c26154f5eecbfe3 /common | |
parent | fcef47947ec208b560523f26be237e475bb00b4f (diff) | |
download | scummvm-rg350-b2fb23a134d7f6486bef0922159fa747411d9f14.tar.gz scummvm-rg350-b2fb23a134d7f6486bef0922159fa747411d9f14.tar.bz2 scummvm-rg350-b2fb23a134d7f6486bef0922159fa747411d9f14.zip |
Changed the way String::_storage is initialised, to help GCC 2.95 (see tracker item #1602879)
svn-id: r24793
Diffstat (limited to 'common')
-rw-r--r-- | common/str.cpp | 6 | ||||
-rw-r--r-- | common/str.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/common/str.cpp b/common/str.cpp index 20844894b8..bea7056991 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -45,7 +45,11 @@ static int computeCapacity(int len) { } String::String(const char *str, uint32 len) -: _len(0), _str(_storage), _storage() { +: _len(0), _str(_storage) { + + // Init _storage member explicitly (ie. without calling its constructor) + // for GCC 2.95.x compatibility (see also tracker item #1602879). + _storage[0] = 0; if (str && *str) { const uint32 tmp = strlen(str); diff --git a/common/str.h b/common/str.h index 3a57be0ce4..c611b3df87 100644 --- a/common/str.h +++ b/common/str.h @@ -96,7 +96,7 @@ public: static const char *emptyString; #endif - String() : _len(0), _str(_storage), _storage() {} + String() : _len(0), _str(_storage) { _storage[0] = 0; } String(const char *str, uint32 len = 0); String(const String &str); virtual ~String(); |