From 89c3b3a60fc5e46a1f89a97666ead6d414add9af Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 14 Mar 2012 23:08:10 +0000 Subject: [PATCH] ps3: fix PS3 build after the Queue refactoring. --- src/lol/math/remez.h | 2 ++ src/platform/ps3/threadbase.h | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lol/math/remez.h b/src/lol/math/remez.h index 634233f0..c4037382 100644 --- a/src/lol/math/remez.h +++ b/src/lol/math/remez.h @@ -34,6 +34,8 @@ public: void Run(T a, T b, RealFunc *func, RealFunc *weight, int decimals) { + using std::printf; + m_func = func; m_weight = weight; m_k1 = (b + a) / 2; diff --git a/src/platform/ps3/threadbase.h b/src/platform/ps3/threadbase.h index 0a46b1be..cf8c26be 100644 --- a/src/platform/ps3/threadbase.h +++ b/src/platform/ps3/threadbase.h @@ -52,7 +52,7 @@ private: sys_lwmutex_t m_mutex; }; -class QueueBase +template class QueueBase { public: QueueBase() @@ -80,7 +80,7 @@ public: ; } - void Push(int value) + void Push(T value) { /* FIXME: this is a copy of the pthread implementation, but we * should really use libsync2 instead. */ @@ -96,14 +96,14 @@ public: sys_lwmutex_unlock(&m_mutex); } - int Pop() + T Pop() { sys_lwmutex_lock(&m_mutex, 0); m_poppers++; while (m_count == 0) sys_lwcond_wait(&m_empty_cond, 0); m_poppers--; - int ret = m_values[m_start]; + T ret = m_values[m_start]; m_start = (m_start + 1) % CAPACITY; m_count--; if (m_pushers) @@ -113,8 +113,8 @@ public: } private: - static size_t const CAPACITY = 100; - int m_values[CAPACITY]; + static size_t const CAPACITY = N; + T m_values[CAPACITY]; size_t m_start, m_count; size_t m_poppers, m_pushers; sys_lwmutex_t m_mutex;