summaryrefslogtreecommitdiffstats
path: root/raul
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-08 16:05:32 +0000
committerDavid Robillard <d@drobilla.net>2011-01-08 16:05:32 +0000
commitba3e966984bc8864bccb247daa9d78d5165e13bf (patch)
treef1d4a10a2989772298f6e57ddfdb847b259f54af /raul
parenta6a719577de47ad695b568b7bc451b9475104a28 (diff)
downloadraul-ba3e966984bc8864bccb247daa9d78d5165e13bf.tar.gz
raul-ba3e966984bc8864bccb247daa9d78d5165e13bf.tar.bz2
raul-ba3e966984bc8864bccb247daa9d78d5165e13bf.zip
Code clean-up (cpplint).
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@2796 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul')
-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
20 files changed, 65 insertions, 43 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 {