[Scummvm-cvs-logs] SF.net SVN: scummvm: [24793] scummvm/trunk/common
cyx at users.sourceforge.net
cyx at users.sourceforge.net
Mon Nov 27 01:51:14 CET 2006
Revision: 24793
http://svn.sourceforge.net/scummvm/?rev=24793&view=rev
Author: cyx
Date: 2006-11-26 16:51:14 -0800 (Sun, 26 Nov 2006)
Log Message:
-----------
Changed the way String::_storage is initialised, to help GCC 2.95 (see tracker item #1602879)
Modified Paths:
--------------
scummvm/trunk/common/str.cpp
scummvm/trunk/common/str.h
Modified: scummvm/trunk/common/str.cpp
===================================================================
--- scummvm/trunk/common/str.cpp 2006-11-27 00:49:59 UTC (rev 24792)
+++ scummvm/trunk/common/str.cpp 2006-11-27 00:51:14 UTC (rev 24793)
@@ -45,8 +45,12 @@
}
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);
assert(len <= tmp);
Modified: scummvm/trunk/common/str.h
===================================================================
--- scummvm/trunk/common/str.h 2006-11-27 00:49:59 UTC (rev 24792)
+++ scummvm/trunk/common/str.h 2006-11-27 00:51:14 UTC (rev 24793)
@@ -96,7 +96,7 @@
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();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list