diff options
author | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-06-14 15:03:29 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-06-15 14:34:53 -0300 |
commit | 4bab9a89c8a0bd22b1a95e46cf75d9e2dd7f42e1 (patch) | |
tree | e607d9389ae53de2ddc6010262bf746fd3a60478 /tests/libsample | |
parent | f516832ae986a42e7b01f2bcf01b1f1c76259718 (diff) |
Fix problems on MacOSX due to uninitialized variables and mixing of int, uint and ulong variables.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/libsample')
-rw-r--r-- | tests/libsample/bucket.cpp | 4 | ||||
-rw-r--r-- | tests/libsample/bucket.h | 3 | ||||
-rw-r--r-- | tests/libsample/collector.cpp | 22 | ||||
-rw-r--r-- | tests/libsample/collector.h | 7 | ||||
-rw-r--r-- | tests/libsample/echo.h | 6 |
5 files changed, 20 insertions, 22 deletions
diff --git a/tests/libsample/bucket.cpp b/tests/libsample/bucket.cpp index d0da98a0c..1cfe828e7 100644 --- a/tests/libsample/bucket.cpp +++ b/tests/libsample/bucket.cpp @@ -37,6 +37,10 @@ using namespace std; +Bucket::Bucket() : m_locked(false) +{ +} + void Bucket::push(int x) { m_data.push_back(x); diff --git a/tests/libsample/bucket.h b/tests/libsample/bucket.h index 127cfcdf7..7ea5428a5 100644 --- a/tests/libsample/bucket.h +++ b/tests/libsample/bucket.h @@ -41,9 +41,10 @@ class ObjectType; -class LIBSAMPLE_API Bucket: public ObjectType +class LIBSAMPLE_API Bucket : public ObjectType { public: + Bucket(); void push(int); int pop(); bool empty(); diff --git a/tests/libsample/collector.cpp b/tests/libsample/collector.cpp index c33269de1..b87eb2957 100644 --- a/tests/libsample/collector.cpp +++ b/tests/libsample/collector.cpp @@ -34,41 +34,29 @@ #include "collector.h" -void -Collector::clear() +void Collector::clear() { m_items.clear(); } -Collector& -Collector::operator<<(unsigned int item) +Collector& Collector::operator<<(unsigned long item) { m_items.push_back(item); return *this; } -Collector& -Collector::operator<<(signed int item) -{ - m_items.push_back(item); - return *this; -} - -Collector& -Collector::operator<<(const ObjectType *obj) +Collector& Collector::operator<<(const ObjectType *obj) { m_items.push_back(obj->identifier()); return *this; } -std::list<int> -Collector::items() +std::list<unsigned long> Collector::items() { return m_items; } -int -Collector::size() +int Collector::size() { return (int) m_items.size(); } diff --git a/tests/libsample/collector.h b/tests/libsample/collector.h index 623f64696..e82280333 100644 --- a/tests/libsample/collector.h +++ b/tests/libsample/collector.h @@ -48,16 +48,15 @@ public: void clear(); - Collector& operator<<(unsigned int item); - Collector& operator<<(signed int item); + Collector& operator<<(unsigned long item); Collector& operator<<(const ObjectType *); - std::list<int> items(); + std::list<unsigned long> items(); int size(); private: - std::list<int> m_items; + std::list<unsigned long> m_items; Collector(const Collector&); Collector& operator=(const Collector&); diff --git a/tests/libsample/echo.h b/tests/libsample/echo.h index 962e19492..139fb60a3 100644 --- a/tests/libsample/echo.h +++ b/tests/libsample/echo.h @@ -37,12 +37,18 @@ #include "libsamplemacros.h" +class ObjectType; + class LIBSAMPLE_API Echo { public: Echo(){} ~Echo(){} + // These method are here just for compilation test purposes + Echo& operator<<(unsigned int item) { return *this; } + Echo& operator<<(signed int item) { return *this; } + Echo& operator<<(const ObjectType* item) { return *this; } }; #endif |