From 13a1dc0a58a33cdc974a877ccf6208890e9b4e9f Mon Sep 17 00:00:00 2001 From: Max Lingua Date: Sun, 12 Jul 2009 05:34:46 +0000 Subject: 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. svn-id: r42402 --- common/array.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'common/array.h') diff --git a/common/array.h b/common/array.h index 7852cabf06..ac8a4b20d7 100644 --- a/common/array.h +++ b/common/array.h @@ -222,7 +222,13 @@ public: 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 @@ protected: // 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; -- cgit v1.2.3 From 3ed4f388d7c3a8f162be2463cc12c4c52db88214 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 13 Jul 2009 22:08:56 +0000 Subject: Unify PS2 and non-PS2 alloc code in Common::Array code (if this causes regressions somewhere, we better find a fix that also works on PS2) svn-id: r42455 --- common/array.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'common/array.h') diff --git a/common/array.h b/common/array.h index ac8a4b20d7..0b5a65e9bd 100644 --- a/common/array.h +++ b/common/array.h @@ -222,13 +222,7 @@ public: 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) { @@ -279,13 +273,7 @@ protected: // 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; -- cgit v1.2.3