From ba3e966984bc8864bccb247daa9d78d5165e13bf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 8 Jan 2011 16:05:32 +0000 Subject: Code clean-up (cpplint). git-svn-id: http://svn.drobilla.net/lad/trunk/raul@2796 a436a847-0d15-0410-975c-d299462d15a1 --- raul/ArrayStack.hpp | 7 ++++--- raul/AtomLiblo.hpp | 4 +++- raul/Configuration.hpp | 7 ++++--- raul/List.hpp | 6 ++++-- raul/MIDISink.hpp | 2 +- raul/Path.hpp | 1 - raul/Process.hpp | 11 +++++++---- raul/RingBuffer.hpp | 2 +- raul/SMFWriter.hpp | 2 ++ raul/SRMWQueue.hpp | 2 ++ raul/SRSWQueue.hpp | 2 ++ raul/SharedPtr.hpp | 28 ++++++++++------------------ raul/Symbol.hpp | 7 ++++--- raul/Table.hpp | 7 +++++-- raul/TableImpl.hpp | 7 +++++-- raul/Thread.hpp | 4 +++- raul/TimeSlice.hpp | 2 ++ raul/log.hpp | 1 + raul/midi_events.h | 4 ++++ raul/midi_names.h | 2 +- 20 files changed, 65 insertions(+), 43 deletions(-) (limited to 'raul') 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 #include #include -#include -#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 #include + +#include + #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 -#include +#include #include +#include #include -#include +#include + #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 #include + #include -#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 -#include -#include -#include #include +#include +#include + +#include +#include + #include + #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 #include -#include #include +#include #include #include 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 +#include + #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 #include #include + #include + #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 + #include + #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 #include #include - -#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS #include -#include -#include +#include -static std::list shared_ptr_counters; +static std::set 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 #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 +#include #include -#include #include -#include +#include +#include + #include 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 #include +#include +#include + #include -#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 -#include #include +#include #include +#include +#include +#include + #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 #include #include -#include + #include + #include 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 #include + #include + #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 #include +#include 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 * * Adapted from ALSA's asounddef.h + * Copyright (C) 1998-2001 Jaroslav Kysela + * Abramo Bagnara + * Takashi Iwai * * 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 { -- cgit v1.2.1