[Scummvm-cvs-logs] SF.net SVN: scummvm:[42402] scummvm/trunk/common/array.h

sunmax at users.sourceforge.net sunmax at users.sourceforge.net
Sun Jul 12 07:34:46 CEST 2009


Revision: 42402
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42402&view=rev
Author:   sunmax
Date:     2009-07-12 05:34:46 +0000 (Sun, 12 Jul 2009)

Log Message:
-----------
Added a temporary work-around for PS2 backend in common/array.h
cause its vintage compiler does not support "new T[newCapacity]()"
but only "new T[newCapacity]", this will let it compile through.

It's ifdef'd as __PLAYSTATION2__, so it won't make a difference
for other backends with more modern tools.

Modified Paths:
--------------
    scummvm/trunk/common/array.h

Modified: scummvm/trunk/common/array.h
===================================================================
--- scummvm/trunk/common/array.h	2009-07-12 05:04:59 UTC (rev 42401)
+++ scummvm/trunk/common/array.h	2009-07-12 05:34:46 UTC (rev 42402)
@@ -222,7 +222,13 @@
 
 		T *old_storage = _storage;
 		_capacity = newCapacity;
+		// PS2 gcc 3.2.2 can't do "new T[newCapacity]()" but only
+		// "new T[newCapacity]" -> quick fix until we update tools.
+		#ifndef __PLAYSTATION2__
 		_storage = new T[newCapacity]();
+		#else
+		_storage = new T[newCapacity];
+		#endif
 		assert(_storage);
 
 		if (old_storage) {
@@ -273,7 +279,13 @@
 				// If there is not enough space, allocate more and
 				// copy old elements over.
 				uint newCapacity = roundUpCapacity(_size + n);
+				// PS2 gcc 3.2.2 can't do "new T[newCapacity]()" but only
+				// "new T[newCapacity]" -> quick fix until we update tools.
+				#ifndef __PLAYSTATION2__
 				newStorage = new T[newCapacity]();
+				#else
+				newStorage = new T[newCapacity];
+				#endif
 				assert(newStorage);
 				copy(_storage, _storage + idx, newStorage);
 				pos = newStorage + idx;


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