From 9c0d6de6406bee77c907d7e131b3bf5bcfbd0057 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 1 May 2008 21:16:31 +0000 Subject: GCC 4.3 fixes. git-svn-id: http://svn.drobilla.net/lad/raul@1191 a436a847-0d15-0410-975c-d299462d15a1 --- raul/TableImpl.hpp | 8 +++++--- src/SMFReader.cpp | 1 + src/SMFWriter.cpp | 1 + src/Thread.cpp | 1 + tests/midi_ringbuffer_test.cpp | 1 + tests/ringbuffer_test.cpp | 1 + 6 files changed, 10 insertions(+), 3 deletions(-) diff --git a/raul/TableImpl.hpp b/raul/TableImpl.hpp index 4f1f6aa..e8053c5 100644 --- a/raul/TableImpl.hpp +++ b/raul/TableImpl.hpp @@ -150,11 +150,12 @@ Table::find_range_end(iterator start, bool (*comp)(const K&,const K&)) size_t lower = start._index; size_t upper = size() - 1; - if (lower == upper) + if (lower == upper) { if (comp(key, _entries[lower].first)) return iterator(*this, lower+1); else return this->end(); + } size_t i; @@ -162,11 +163,12 @@ Table::find_range_end(iterator start, bool (*comp)(const K&,const K&)) i = lower + ((upper - lower) / 2); - if (upper - lower == 1) + if (upper - lower == 1) { if (comp(key, _entries[upper].first) && upper < size()) return iterator(*this, upper+1); else if (lower < size()) return iterator(*this, lower+1); + } const Entry& elem = _entries[i]; @@ -268,7 +270,7 @@ Table::insert(const std::pair& entry) const K& key = entry.first; const T& value = entry.second; - if (size() == 0 || size() == 1 && key > _entries[0].first) { + if (size() == 0 || (size() == 1 && key > _entries[0].first)) { _entries.push_back(entry); return std::make_pair(iterator(*this, size()-1), true); } else if (size() == 1) { diff --git a/src/SMFReader.cpp b/src/SMFReader.cpp index c21058b..e2fd24b 100644 --- a/src/SMFReader.cpp +++ b/src/SMFReader.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include diff --git a/src/SMFWriter.cpp b/src/SMFWriter.cpp index 4ea65b0..e1ae440 100644 --- a/src/SMFWriter.cpp +++ b/src/SMFWriter.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include diff --git a/src/Thread.cpp b/src/Thread.cpp index 5b5fa27..91ed0e2 100644 --- a/src/Thread.cpp +++ b/src/Thread.cpp @@ -16,6 +16,7 @@ */ #include +#include #include using namespace std; diff --git a/tests/midi_ringbuffer_test.cpp b/tests/midi_ringbuffer_test.cpp index 2bf138c..98c251b 100644 --- a/tests/midi_ringbuffer_test.cpp +++ b/tests/midi_ringbuffer_test.cpp @@ -1,6 +1,7 @@ #include "raul/TimeStamp.hpp" #include "raul/EventRingBuffer.hpp" #include +#include #include "raul/midi_names.h" using namespace std; diff --git a/tests/ringbuffer_test.cpp b/tests/ringbuffer_test.cpp index 851d7b9..162d984 100644 --- a/tests/ringbuffer_test.cpp +++ b/tests/ringbuffer_test.cpp @@ -1,4 +1,5 @@ #include +#include #include "raul/RingBuffer.hpp" using namespace std; -- cgit v1.2.1