summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--raul/TableImpl.hpp8
-rw-r--r--src/SMFReader.cpp1
-rw-r--r--src/SMFWriter.cpp1
-rw-r--r--src/Thread.cpp1
-rw-r--r--tests/midi_ringbuffer_test.cpp1
-rw-r--r--tests/ringbuffer_test.cpp1
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<K,T>::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<K,T>::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<K,T>::insert(const std::pair<K, T>& 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 <cstdio>
#include <cassert>
+#include <cstring>
#include <iostream>
#include <glibmm/miscutils.h>
#include <raul/SMFReader.hpp>
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 <stdint.h>
#include <cassert>
+#include <cstring>
#include <iostream>
#include <glibmm/miscutils.h>
#include <raul/SMFWriter.hpp>
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 <iostream>
+#include <cstring>
#include <raul/Thread.hpp>
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 <iostream>
+#include <cstring>
#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 <iostream>
+#include <cstring>
#include "raul/RingBuffer.hpp"
using namespace std;