summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--raul/ArrayStack.hpp7
-rw-r--r--raul/AtomLiblo.hpp4
-rw-r--r--raul/Configuration.hpp7
-rw-r--r--raul/List.hpp6
-rw-r--r--raul/MIDISink.hpp2
-rw-r--r--raul/Path.hpp1
-rw-r--r--raul/Process.hpp11
-rw-r--r--raul/RingBuffer.hpp2
-rw-r--r--raul/SMFWriter.hpp2
-rw-r--r--raul/SRMWQueue.hpp2
-rw-r--r--raul/SRSWQueue.hpp2
-rw-r--r--raul/SharedPtr.hpp28
-rw-r--r--raul/Symbol.hpp7
-rw-r--r--raul/Table.hpp7
-rw-r--r--raul/TableImpl.hpp7
-rw-r--r--raul/Thread.hpp4
-rw-r--r--raul/TimeSlice.hpp2
-rw-r--r--raul/log.hpp1
-rw-r--r--raul/midi_events.h4
-rw-r--r--raul/midi_names.h2
-rw-r--r--src/Configuration.cpp6
-rw-r--r--src/Path.cpp4
-rw-r--r--src/SMFReader.cpp17
-rw-r--r--src/SMFWriter.cpp29
-rw-r--r--src/Symbol.cpp4
-rw-r--r--src/Thread.cpp4
-rw-r--r--src/log.cpp2
27 files changed, 108 insertions, 66 deletions
diff --git a/raul/ArrayStack.hpp b/raul/ArrayStack.hpp
index 2204b69..6d34426 100644
--- a/raul/ArrayStack.hpp
+++ b/raul/ArrayStack.hpp
@@ -18,11 +18,12 @@
#ifndef RAUL_ARRAYSTACK_HPP
#define RAUL_ARRAYSTACK_HPP
-#include "raul/Array.hpp"
+#include <algorithm>
#include <cassert>
#include <cstddef>
-#include <algorithm>
-#include "Deletable.hpp"
+
+#include "raul/Array.hpp"
+#include "raul/Deletable.hpp"
namespace Raul {
diff --git a/raul/AtomLiblo.hpp b/raul/AtomLiblo.hpp
index 02bbee9..87a5dda 100644
--- a/raul/AtomLiblo.hpp
+++ b/raul/AtomLiblo.hpp
@@ -18,8 +18,10 @@
#ifndef RAUL_ATOM_LIBLO_HPP
#define RAUL_ATOM_LIBLO_HPP
-#include <iostream>
#include <lo/lo.h>
+
+#include <iostream>
+
#include "raul/log.hpp"
#include "raul/Atom.hpp"
diff --git a/raul/Configuration.hpp b/raul/Configuration.hpp
index e26de9d..c851d08 100644
--- a/raul/Configuration.hpp
+++ b/raul/Configuration.hpp
@@ -18,11 +18,12 @@
#ifndef RAUL_CONFIGURATION_HPP
#define RAUL_CONFIGURATION_HPP
-#include <map>
-#include <string>
+#include <exception>
#include <list>
+#include <map>
#include <ostream>
-#include <exception>
+#include <string>
+
#include "raul/Atom.hpp"
namespace Raul {
diff --git a/raul/List.hpp b/raul/List.hpp
index 27e88f5..aa4ddb3 100644
--- a/raul/List.hpp
+++ b/raul/List.hpp
@@ -20,10 +20,12 @@
#include <cstddef>
#include <cassert>
+
#include <boost/utility.hpp>
-#include "raul/Deletable.hpp"
-#include "raul/AtomicPtr.hpp"
+
#include "raul/AtomicInt.hpp"
+#include "raul/AtomicPtr.hpp"
+#include "raul/Deletable.hpp"
namespace Raul {
diff --git a/raul/MIDISink.hpp b/raul/MIDISink.hpp
index 23815f6..6d39823 100644
--- a/raul/MIDISink.hpp
+++ b/raul/MIDISink.hpp
@@ -31,7 +31,7 @@ class MIDISink : public Deletable {
public:
virtual void write_event(TimeStamp time,
size_t ev_size,
- const uint8_t* ev) throw (std::logic_error) = 0;
+ const uint8_t* ev) = 0;
};
diff --git a/raul/Path.hpp b/raul/Path.hpp
index ce94cae..e59da60 100644
--- a/raul/Path.hpp
+++ b/raul/Path.hpp
@@ -96,7 +96,6 @@ public:
*/
Path(const char* cpath);
-
/** Construct a Path from another path.
*
* This is faster than constructing a path from the other path's string
diff --git a/raul/Process.hpp b/raul/Process.hpp
index f9f12b0..f0ceffc 100644
--- a/raul/Process.hpp
+++ b/raul/Process.hpp
@@ -18,12 +18,15 @@
#ifndef RAUL_PROCESS_HPP
#define RAUL_PROCESS_HPP
-#include <string>
-#include <iostream>
-#include <unistd.h>
-#include <sys/time.h>
#include <sys/resource.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+#include <iostream>
+#include <string>
+
#include <boost/utility.hpp>
+
#include "raul/log.hpp"
namespace Raul {
diff --git a/raul/RingBuffer.hpp b/raul/RingBuffer.hpp
index 4bae30a..e2647fc 100644
--- a/raul/RingBuffer.hpp
+++ b/raul/RingBuffer.hpp
@@ -21,8 +21,8 @@
#include <stdint.h>
#include <cassert>
-#include <cstring>
#include <cstdlib>
+#include <cstring>
#include <iostream>
#include <glib.h>
diff --git a/raul/SMFWriter.hpp b/raul/SMFWriter.hpp
index 4643624..ae62a1d 100644
--- a/raul/SMFWriter.hpp
+++ b/raul/SMFWriter.hpp
@@ -19,6 +19,8 @@
#define RAUL_SMF_WRITER_HPP
#include <stdexcept>
+#include <string>
+
#include "raul/MIDISink.hpp"
#include "raul/TimeStamp.hpp"
diff --git a/raul/SRMWQueue.hpp b/raul/SRMWQueue.hpp
index 7257ec3..82606f2 100644
--- a/raul/SRMWQueue.hpp
+++ b/raul/SRMWQueue.hpp
@@ -21,7 +21,9 @@
#include <cassert>
#include <cstdlib>
#include <cmath>
+
#include <boost/utility.hpp>
+
#include "raul/AtomicInt.hpp"
namespace Raul {
diff --git a/raul/SRSWQueue.hpp b/raul/SRSWQueue.hpp
index e089f07..0b843bc 100644
--- a/raul/SRSWQueue.hpp
+++ b/raul/SRSWQueue.hpp
@@ -19,7 +19,9 @@
#define RAUL_SRSW_QUEUE_HPP
#include <cassert>
+
#include <boost/utility.hpp>
+
#include "raul/AtomicInt.hpp"
namespace Raul {
diff --git a/raul/SharedPtr.hpp b/raul/SharedPtr.hpp
index 8e803ed..ae41b17 100644
--- a/raul/SharedPtr.hpp
+++ b/raul/SharedPtr.hpp
@@ -18,33 +18,25 @@
#ifndef RAUL_SHARED_PTR_HPP
#define RAUL_SHARED_PTR_HPP
+#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
+#include <algorithm>
#include <cassert>
#include <cstddef>
-
-#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
#include <iostream>
-#include <list>
-#include <algorithm>
+#include <set>
-static std::list<void*> shared_ptr_counters;
+static std::set<void*> shared_ptr_counters;
// Use debug hooks to ensure 2 shared_ptrs never point to the same thing
namespace boost {
-
- inline void sp_scalar_constructor_hook(void* object, unsigned long cnt, void* ptr) {
- assert(std::find(shared_ptr_counters.begin(), shared_ptr_counters.end(),
- (void*)object) == shared_ptr_counters.end());
- shared_ptr_counters.push_back(object);
- //std::cerr << "Creating SharedPtr to "
- // << object << ", count = " << cnt << std::endl;
+ inline void sp_scalar_constructor_hook(void* px, std::size_t size, void* pn) {
+ assert(shared_ptr_counters.find(px) == shared_ptr_counters.end());
+ shared_ptr_counters.push_back(px);
}
- inline void sp_scalar_destructor_hook(void* object, unsigned long cnt, void* ptr) {
- shared_ptr_counters.remove(object);
- //std::cerr << "Destroying SharedPtr to "
- // << object << ", count = " << cnt << std::endl;
+ inline void sp_scalar_destructor_hook(void* px, std::size_t size, void* pn) {
+ shared_ptr_counters.remove(px);
}
-
}
#endif // BOOST_SP_ENABLE_DEBUG_HOOKS
@@ -52,7 +44,7 @@ namespace boost {
#include <boost/shared_ptr.hpp>
#ifdef BOOST_AC_USE_PTHREADS
-#error "Boost is using mutex locking for pointer reference counting."
+#error "Boost is using mutexes for shared_ptr reference counting."
#error "This is VERY slow. Please report your platform to d@drobilla.net"
#endif
diff --git a/raul/Symbol.hpp b/raul/Symbol.hpp
index 7c650ee..735d901 100644
--- a/raul/Symbol.hpp
+++ b/raul/Symbol.hpp
@@ -18,11 +18,12 @@
#ifndef RAUL_SYMBOL_HPP
#define RAUL_SYMBOL_HPP
-#include <iostream>
+#include <cassert>
#include <cctype>
-#include <string>
#include <cstring>
-#include <cassert>
+#include <iostream>
+#include <string>
+
#include <glib.h>
namespace Raul {
diff --git a/raul/Table.hpp b/raul/Table.hpp
index 177b2d9..79817ed 100644
--- a/raul/Table.hpp
+++ b/raul/Table.hpp
@@ -18,10 +18,13 @@
#ifndef RAUL_TABLE_HPP
#define RAUL_TABLE_HPP
-#include <vector>
#include <algorithm>
+#include <utility>
+#include <vector>
+
#include <boost/utility.hpp>
-#include "SharedPtr.hpp"
+
+#include "raul/SharedPtr.hpp"
//#define TABLE_SORT_DEBUG
diff --git a/raul/TableImpl.hpp b/raul/TableImpl.hpp
index 3c53385..e123e6e 100644
--- a/raul/TableImpl.hpp
+++ b/raul/TableImpl.hpp
@@ -18,10 +18,13 @@
#ifndef RAUL_TABLE_IMPL_HPP
#define RAUL_TABLE_IMPL_HPP
-#include <cassert>
-#include <stdexcept>
#include <algorithm>
+#include <cassert>
#include <iostream>
+#include <stdexcept>
+#include <utility>
+#include <vector>
+
#include "raul/Table.hpp"
namespace Raul {
diff --git a/raul/Thread.hpp b/raul/Thread.hpp
index 757b791..b81d32a 100644
--- a/raul/Thread.hpp
+++ b/raul/Thread.hpp
@@ -18,10 +18,12 @@
#ifndef RAUL_THREAD_HPP
#define RAUL_THREAD_HPP
+#include <iostream>
#include <set>
#include <string>
-#include <iostream>
+
#include <pthread.h>
+
#include <boost/utility.hpp>
namespace Raul {
diff --git a/raul/TimeSlice.hpp b/raul/TimeSlice.hpp
index 901b3db..cd8381f 100644
--- a/raul/TimeSlice.hpp
+++ b/raul/TimeSlice.hpp
@@ -20,7 +20,9 @@
#include <cassert>
#include <cmath>
+
#include <boost/utility.hpp>
+
#include "raul/TimeStamp.hpp"
namespace Raul {
diff --git a/raul/log.hpp b/raul/log.hpp
index f7e1253..187df64 100644
--- a/raul/log.hpp
+++ b/raul/log.hpp
@@ -20,6 +20,7 @@
#include <iostream>
#include <sstream>
+#include <string>
namespace Raul {
diff --git a/raul/midi_events.h b/raul/midi_events.h
index 1c786aa..a269c2a 100644
--- a/raul/midi_events.h
+++ b/raul/midi_events.h
@@ -1,6 +1,10 @@
/* Definitions to ease working with raw MIDI.
+ * Copyright (C) 2005-2011 David Robillard <http://drobilla.net>
*
* Adapted from ALSA's asounddef.h
+ * Copyright (C) 1998-2001 Jaroslav Kysela <perex@perex.cz>
+ * Abramo Bagnara <abramo@alsa-project.org>
+ * Takashi Iwai <tiwai@suse.de>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
diff --git a/raul/midi_names.h b/raul/midi_names.h
index cbc7ef6..205a8ec 100644
--- a/raul/midi_names.h
+++ b/raul/midi_names.h
@@ -20,7 +20,7 @@
#ifndef RAUL_MIDI_NAMES_H
#define RAUL_MIDI_NAMES_H
-#include "midi_events.h"
+#include "raul/midi_events.h"
#ifdef __cplusplus
namespace Raul {
diff --git a/src/Configuration.cpp b/src/Configuration.cpp
index 624274f..a471441 100644
--- a/src/Configuration.cpp
+++ b/src/Configuration.cpp
@@ -15,9 +15,13 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <algorithm>
+#include <string>
+
#include "raul/Configuration.hpp"
-using namespace std;
+using std::endl;
+using std::string;
namespace Raul {
diff --git a/src/Path.cpp b/src/Path.cpp
index de17cdf..9f1bcb7 100644
--- a/src/Path.cpp
+++ b/src/Path.cpp
@@ -15,9 +15,11 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string>
+
#include "raul/Path.hpp"
-using namespace std;
+using std::string;
namespace Raul {
diff --git a/src/SMFReader.cpp b/src/SMFReader.cpp
index 6fda04a..5a20470 100644
--- a/src/SMFReader.cpp
+++ b/src/SMFReader.cpp
@@ -15,15 +15,18 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <glib.h>
+
#include <cstdio>
#include <cassert>
#include <cstring>
-#include <glib.h>
+#include <string>
+
#include "raul/log.hpp"
#include "raul/SMFReader.hpp"
#include "raul/midi_events.h"
-using namespace std;
+using std::endl;
namespace Raul {
@@ -90,10 +93,10 @@ SMFReader::~SMFReader()
bool
-SMFReader::open(const std::string& filename) throw (logic_error, UnsupportedTime)
+SMFReader::open(const std::string& filename) throw (std::logic_error, UnsupportedTime)
{
if (_fd)
- throw logic_error("Attempt to start new read while write in progress.");
+ throw std::logic_error("Attempt to start new read while write in progress.");
info << "Opening SMF file " << filename << " for reading." << endl;
@@ -148,10 +151,10 @@ bool
SMFReader::seek_to_track(unsigned track) throw (std::logic_error)
{
if (track == 0)
- throw logic_error("Seek to track 0 out of range (must be >= 1)");
+ throw std::logic_error("Seek to track 0 out of range (must be >= 1)");
if (!_fd)
- throw logic_error("Attempt to seek to track on unopened SMF file.");
+ throw std::logic_error("Attempt to seek to track on unopened SMF file.");
unsigned track_pos = 0;
@@ -210,7 +213,7 @@ SMFReader::read_event(size_t buf_len,
throw (std::logic_error, PrematureEOF, CorruptFile)
{
if (_track == 0)
- throw logic_error("Attempt to read from unopened SMF file");
+ throw std::logic_error("Attempt to read from unopened SMF file");
if (!_fd || feof(_fd)) {
return -1;
diff --git a/src/SMFWriter.cpp b/src/SMFWriter.cpp
index ebb1380..0c343b6 100644
--- a/src/SMFWriter.cpp
+++ b/src/SMFWriter.cpp
@@ -14,16 +14,21 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdio.h>
+
+#include <glib.h>
#include <stdint.h>
+#include <stdio.h>
+
#include <cassert>
-#include <cstring>
#include <cstdio>
-#include <glib.h>
+#include <cstring>
+#include <limits>
+#include <string>
+
#include "raul/log.hpp"
#include "raul/SMFWriter.hpp"
-using namespace std;
+using std::endl;
namespace Raul {
@@ -63,10 +68,10 @@ SMFWriter::~SMFWriter()
*/
bool
SMFWriter::start(const std::string& filename,
- Raul::TimeStamp start_time) throw (logic_error)
+ Raul::TimeStamp start_time) throw (std::logic_error)
{
if (_fd)
- throw logic_error("Attempt to start new write while write in progress.");
+ throw std::logic_error("Attempt to start new write while write in progress.");
info << "Opening SMF file " << filename << " for writing." << endl;
@@ -94,14 +99,14 @@ SMFWriter::start(const std::string& filename,
void
SMFWriter::write_event(Raul::TimeStamp time,
size_t ev_size,
- const unsigned char* ev) throw (logic_error)
+ const unsigned char* ev) throw (std::logic_error)
{
if (time < _start_time)
- throw logic_error("Event time is before file start time");
+ throw std::logic_error("Event time is before file start time");
else if (time < _last_ev_time)
- throw logic_error("Event time not monotonically increasing");
+ throw std::logic_error("Event time not monotonically increasing");
else if (time.unit() != _unit)
- throw logic_error("Event has unexpected time unit");
+ throw std::logic_error("Event has unexpected time unit");
Raul::TimeStamp delta_time = time;
delta_time -= _start_time;
@@ -141,10 +146,10 @@ SMFWriter::flush()
void
-SMFWriter::finish() throw (logic_error)
+SMFWriter::finish() throw (std::logic_error)
{
if (!_fd)
- throw logic_error("Attempt to finish write with no write in progress.");
+ throw std::logic_error("Attempt to finish write with no write in progress.");
write_footer();
fclose(_fd);
diff --git a/src/Symbol.cpp b/src/Symbol.cpp
index fb6bf7f..2005074 100644
--- a/src/Symbol.cpp
+++ b/src/Symbol.cpp
@@ -15,10 +15,12 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string>
+
#include "raul/Symbol.hpp"
#include "raul/Path.hpp"
-using namespace std;
+using std::string;
namespace Raul {
diff --git a/src/Thread.cpp b/src/Thread.cpp
index 35cb569..d45f363 100644
--- a/src/Thread.cpp
+++ b/src/Thread.cpp
@@ -16,12 +16,14 @@
*/
#include <cstring>
+#include <string>
+
#include "raul/log.hpp"
#include "raul/Thread.hpp"
#define LOG(s) s << "[" << _name << "] "
-using namespace std;
+using std::endl;
namespace Raul {
diff --git a/src/log.cpp b/src/log.cpp
index 01620ee..201f8f1 100644
--- a/src/log.cpp
+++ b/src/log.cpp
@@ -15,6 +15,8 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string>
+
#include "raul/log.hpp"
#include "raul-config.h"