diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-04 14:51:05 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-04 14:51:05 -0400 |
commit | 4dc63966f0872efe768dad61eb9b8785d06b92d1 (patch) | |
tree | e54104d57d6c2da7840979181368151fd0819c96 /libs/pbd | |
parent | 297e80e020da94a56984b20782584bb1dd96ea34 (diff) |
globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
Diffstat (limited to 'libs/pbd')
112 files changed, 431 insertions, 431 deletions
diff --git a/libs/pbd/base_ui.cc b/libs/pbd/base_ui.cc index 99d9fbff5b..1b48a19eff 100644 --- a/libs/pbd/base_ui.cc +++ b/libs/pbd/base_ui.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/basename.cc b/libs/pbd/basename.cc index 2d132408c7..767459f9f9 100644 --- a/libs/pbd/basename.cc +++ b/libs/pbd/basename.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/boost_debug.cc b/libs/pbd/boost_debug.cc index 6b9c0cbc92..9d152a6f86 100644 --- a/libs/pbd/boost_debug.cc +++ b/libs/pbd/boost_debug.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Paul Davis + Copyright (C) 2009 Paul Davis From an idea by Carl Hetherington. This program is free software; you can redistribute it and/or modify @@ -48,8 +48,8 @@ private: std::ostream& operator<< (std::ostream& str, const Backtrace& bt) { return bt.print (str); } -Backtrace::Backtrace() -{ +Backtrace::Backtrace() +{ #ifdef HAVE_EXECINFO size = ::backtrace (trace, 200); #endif @@ -76,7 +76,7 @@ Backtrace::print (std::ostream& str) const return str; } -struct BTPair { +struct BTPair { Backtrace* ref; Backtrace* rel; @@ -94,10 +94,10 @@ std::ostream& operator<<(std::ostream& str, const BTPair& btp) { return str; } -struct SPDebug { +struct SPDebug { Backtrace* constructor; Backtrace* destructor; - + SPDebug (Backtrace* c) : constructor (c), destructor (0) {} ~SPDebug () { delete constructor; @@ -121,7 +121,7 @@ typedef std::map<void const*,const char*> IPointerMap; using namespace std; static PointerMap* _sptrs; -PointerMap& sptrs() { +PointerMap& sptrs() { if (_sptrs == 0) { _sptrs = new PointerMap; } @@ -129,7 +129,7 @@ PointerMap& sptrs() { } static IPointerMap* _interesting_pointers; -IPointerMap& interesting_pointers() { +IPointerMap& interesting_pointers() { if (_interesting_pointers == 0) { _interesting_pointers = new IPointerMap; } @@ -193,7 +193,7 @@ boost_debug_shared_ptr_operator_equals (void const *sp, void const *old_obj, int if (is_interesting_object (old_obj)) { if (debug_out) { - cerr << "\tlost old sp @ " << sp << " for " << old_obj << " UC = " << old_use_count << " now for " << obj << " UC = " << new_use_count + cerr << "\tlost old sp @ " << sp << " for " << old_obj << " UC = " << old_use_count << " now for " << obj << " UC = " << new_use_count << " (total sp's = " << sptrs().size() << ')' << endl; } PointerMap::iterator x = sptrs().find (sp); @@ -216,12 +216,12 @@ boost_debug_shared_ptr_operator_equals (void const *sp, void const *old_obj, int sptrs().insert (newpair); if (debug_out) { - cerr << "assignment created sp for " << obj << " @ " << sp << " used to point to " << old_obj << " UC = " << old_use_count - << " UC = " << new_use_count + cerr << "assignment created sp for " << obj << " @ " << sp << " used to point to " << old_obj << " UC = " << old_use_count + << " UC = " << new_use_count << " (total sp's = " << sptrs().size() << ')' << endl; cerr << *newpair.second << endl; } - } + } } void @@ -241,7 +241,7 @@ boost_debug_shared_ptr_reset (void const *sp, void const *old_obj, int old_use_c if (is_interesting_object (old_obj)) { if (debug_out) { - cerr << "\tlost old sp @ " << sp << " for " << old_obj << " UC = " << old_use_count << " now for " << obj << " UC = " << new_use_count + cerr << "\tlost old sp @ " << sp << " for " << old_obj << " UC = " << old_use_count << " now for " << obj << " UC = " << new_use_count << " (total sp's = " << sptrs().size() << ')' << endl; } PointerMap::iterator x = sptrs().find (sp); @@ -264,12 +264,12 @@ boost_debug_shared_ptr_reset (void const *sp, void const *old_obj, int old_use_c sptrs().insert (newpair); if (debug_out) { - cerr << "reset created sp for " << obj << " @ " << sp << " used to point to " << old_obj << " UC = " << old_use_count - << " UC = " << new_use_count + cerr << "reset created sp for " << obj << " @ " << sp << " used to point to " << old_obj << " UC = " << old_use_count + << " UC = " << new_use_count << " (total sp's = " << sptrs().size() << ')' << endl; cerr << *newpair.second << endl; } - } + } } void @@ -341,7 +341,7 @@ void sp_counter_ref_hook (void* /*pn*/, long /* use count */) { } -void sp_counter_release_hook (void* /*pn*/, long /*use_count*/) +void sp_counter_release_hook (void* /*pn*/, long /*use_count*/) { } diff --git a/libs/pbd/cartesian.cc b/libs/pbd/cartesian.cc index c228cf3c44..3288f68e98 100644 --- a/libs/pbd/cartesian.cc +++ b/libs/pbd/cartesian.cc @@ -28,7 +28,7 @@ PBD::spherical_to_cartesian (double azi, double ele, double len, double& x, doub /* convert from cylindrical coordinates in degrees to cartesian */ static const double atorad = 2.0 * M_PI / 360.0 ; - + if (len == 0.0) { len = 1.0; } @@ -38,7 +38,7 @@ PBD::spherical_to_cartesian (double azi, double ele, double len, double& x, doub z = len * sin (ele * atorad); } -void +void PBD::cartesian_to_spherical (double x, double y, double z, double& azimuth, double& elevation, double& length) { /* converts cartesian coordinates to cylindrical in degrees*/ @@ -64,7 +64,7 @@ PBD::cartesian_to_spherical (double x, double y, double z, double& azimuth, doub } else { elevation = 180.0 * (phi / M_PI); } - + length = rho; } diff --git a/libs/pbd/command.cc b/libs/pbd/command.cc index 452223317b..22ec8d8cc7 100644 --- a/libs/pbd/command.cc +++ b/libs/pbd/command.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/controllable.cc b/libs/pbd/controllable.cc index b0aeaac2c0..17b81334f0 100644 --- a/libs/pbd/controllable.cc +++ b/libs/pbd/controllable.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -144,7 +144,7 @@ Controllable::set_state (const XMLNode& node, int /*version*/) if (sscanf (prop->value().c_str(), "%f", &val) == 1) { set_value (val); - } + } } return 0; diff --git a/libs/pbd/controllable_descriptor.cc b/libs/pbd/controllable_descriptor.cc index 63ecab12bf..c3c0752c84 100644 --- a/libs/pbd/controllable_descriptor.cc +++ b/libs/pbd/controllable_descriptor.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Paul Davis + Copyright (C) 2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -137,7 +137,7 @@ ControllableDescriptor::target (uint32_t n) const { if (n < _target.size()) { return _target[n]; - } + } return 0; } diff --git a/libs/pbd/convert.cc b/libs/pbd/convert.cc index 940aa87189..8653b504e9 100644 --- a/libs/pbd/convert.cc +++ b/libs/pbd/convert.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2006 Paul Davis + Copyright (C) 2006 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ #include <cmath> #include <algorithm> -#include <string> +#include <string> #include <stdint.h> #include <stdlib.h> @@ -172,8 +172,8 @@ internationalize (const char *package_name, const char **array) return v; } -static int32_t -int_from_hex (char hic, char loc) +static int32_t +int_from_hex (char hic, char loc) { int hi; /* hi byte */ int lo; /* low byte */ @@ -260,7 +260,7 @@ length2string (const int64_t frames, const double sample_rate) return duration_str; } -static bool +static bool chars_equal_ignore_case(char x, char y) { /* app should have called setlocale() if its wants this comparison to be @@ -269,7 +269,7 @@ chars_equal_ignore_case(char x, char y) return toupper (x) == toupper (y); } -bool +bool strings_equal_ignore_case (const string& a, const string& b) { if (a.length() == b.length()) { diff --git a/libs/pbd/crossthread.cc b/libs/pbd/crossthread.cc index 3792e19471..8e24f3e092 100644 --- a/libs/pbd/crossthread.cc +++ b/libs/pbd/crossthread.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Paul Davis + Copyright (C) 2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,7 +42,7 @@ using namespace Glib; #include "crossthread.win.cc" #endif -gboolean +gboolean cross_thread_channel_call_receive_slot (GIOChannel*, GIOCondition condition, void *data) { CrossThreadChannel* ctc = static_cast<CrossThreadChannel*>(data); diff --git a/libs/pbd/crossthread.posix.cc b/libs/pbd/crossthread.posix.cc index 6dbca9dcec..5e743ba557 100644 --- a/libs/pbd/crossthread.posix.cc +++ b/libs/pbd/crossthread.posix.cc @@ -35,12 +35,12 @@ CrossThreadChannel::~CrossThreadChannel () if (fds[0] >= 0) { close (fds[0]); fds[0] = -1; - } + } if (fds[1] >= 0) { close (fds[1]); fds[1] = -1; - } + } } void @@ -87,7 +87,7 @@ CrossThreadChannel::poll_for_request() return false; } -int +int CrossThreadChannel::receive (char& msg, bool wait) { if (wait) { diff --git a/libs/pbd/crossthread.win.cc b/libs/pbd/crossthread.win.cc index 73ff74ddcf..69d744e81d 100644 --- a/libs/pbd/crossthread.win.cc +++ b/libs/pbd/crossthread.win.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Paul Davis + Copyright (C) 2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ */ CrossThreadChannel::CrossThreadChannel (bool non_blocking) - : receive_channel (0) + : receive_channel (0) , receive_source (0) , receive_slot () , send_socket() @@ -32,7 +32,7 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking) send_address.sin_family = AF_INET; send_address.sin_addr.s_addr = inet_addr("127.0.0.1"); send_address.sin_port = htons(0); - int status = bind(send_socket, (SOCKADDR*)&send_address, + int status = bind(send_socket, (SOCKADDR*)&send_address, sizeof(send_address)); if (status != 0) { @@ -54,9 +54,9 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking) recv_address.sin_family = AF_INET; recv_address.sin_addr.s_addr = inet_addr("127.0.0.1"); recv_address.sin_port = htons(0); - status = bind(receive_socket, (SOCKADDR*)&recv_address, + status = bind(receive_socket, (SOCKADDR*)&recv_address, sizeof(recv_address)); - + if (status != 0) { std::cerr << "CrossThreadChannel::CrossThreadChannel() Receive socket binding failed with error: " << WSAGetLastError() << std::endl; return; @@ -67,7 +67,7 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking) // get assigned port number for Receive Socket int recv_addr_len = sizeof(recv_address); status = getsockname(receive_socket, (SOCKADDR*)&recv_address, &recv_addr_len); - + if (status != 0) { std::cerr << "CrossThreadChannel::CrossThreadChannel() Setting receive socket address to local failed with error: " << WSAGetLastError() << std::endl; return; @@ -173,7 +173,7 @@ CrossThreadChannel::poll_for_request() return false; } -int +int CrossThreadChannel::receive (char& msg, bool wait) { gsize read = 0; diff --git a/libs/pbd/debug.cc b/libs/pbd/debug.cc index a914cfd871..8ceea3f1af 100644 --- a/libs/pbd/debug.cc +++ b/libs/pbd/debug.cc @@ -125,7 +125,7 @@ void PBD::list_debug_options () { cout << _("The following debug options are available. Separate multiple options with commas.\nNames are case-insensitive and can be abbreviated.") << endl << endl; - cout << '\t' << X_("all") << endl; + cout << '\t' << X_("all") << endl; vector<string> options; diff --git a/libs/pbd/enums.cc b/libs/pbd/enums.cc index 87e8da4b71..9e33ec6df1 100644 --- a/libs/pbd/enums.cc +++ b/libs/pbd/enums.cc @@ -24,7 +24,7 @@ using namespace PBD; using namespace std; void -setup_libpbd_enums () +setup_libpbd_enums () { EnumWriter& enum_writer (EnumWriter::instance()); vector<int> i; diff --git a/libs/pbd/enumwriter.cc b/libs/pbd/enumwriter.cc index 243cd1c6ab..50507972c2 100644 --- a/libs/pbd/enumwriter.cc +++ b/libs/pbd/enumwriter.cc @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2006 Paul Davis This program is free software; you can redistribute it and/or modify @@ -36,16 +36,16 @@ using namespace PBD; EnumWriter* EnumWriter::_instance = 0; map<string,string> EnumWriter::hack_table; -static int -nocase_cmp(const string & s1, const string& s2) +static int +nocase_cmp(const string & s1, const string& s2) { string::const_iterator it1 = s1.begin(); string::const_iterator it2 = s2.begin(); - while ((it1 != s1.end()) && (it2 != s2.end())) { + while ((it1 != s1.end()) && (it2 != s2.end())) { if(::toupper(*it1) != ::toupper(*it2)) {//letters differ? // return -1 to indicate 'smaller than', 1 otherwise - return (::toupper(*it1) < ::toupper(*it2)) ? -1 : 1; + return (::toupper(*it1) < ::toupper(*it2)) ? -1 : 1; } ++it1; @@ -65,11 +65,11 @@ nocase_cmp(const string & s1, const string& s2) } EnumWriter& -EnumWriter::instance() +EnumWriter::instance() { if (_instance == 0) { _instance = new EnumWriter; - } + } return *_instance; } @@ -166,7 +166,7 @@ EnumWriter::write_bits (EnumRegistration& er, int value) if (value & (*i)) { if (!result.empty()) { result += ','; - } + } result += (*s); } } @@ -204,22 +204,22 @@ EnumWriter::validate (EnumRegistration& er, int val) const vector<int>::iterator i; string enum_name = _("unknown enumeration"); - + for (Registry::const_iterator x = registry.begin(); x != registry.end(); ++x) { if (&er == &(*x).second) { enum_name = (*x).first; } } - + for (i = er.values.begin(); i != er.values.end(); ++i) { if (*i == val) { return val; } } - + warning << string_compose (_("Illegal value loaded for %1 (%2) - %3 used instead"), - enum_name, val, er.names.front()) + enum_name, val, er.names.front()) << endmsg; return er.values.front(); } diff --git a/libs/pbd/epa.cc b/libs/pbd/epa.cc index 0fc386072f..cfc5692138 100644 --- a/libs/pbd/epa.cc +++ b/libs/pbd/epa.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2010 Paul Davis + Copyright (C) 2010 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -64,7 +64,7 @@ EnvironmentalProtectionAgency::save () e.clear (); if (!_envname.empty()) { - + /* fetch environment from named environment variable, rather than "environ" */ @@ -73,8 +73,8 @@ EnvironmentalProtectionAgency::save () if (!estr) { return; } - - /* parse line by line, and save into "e" + + /* parse line by line, and save into "e" */ vector<string> lines; @@ -84,40 +84,40 @@ EnvironmentalProtectionAgency::save () string estring = *i; string::size_type equal = estring.find_first_of ('='); - + if (equal == string::npos) { /* say what? an environ value without = ? */ continue; } - + string before = estring.substr (0, equal); string after = estring.substr (equal+1); - + e.insert (pair<string,string>(before,after)); } - + } else { /* fetch environment from "environ" */ for (size_t i = 0; environ[i]; ++i) { - + string estring = environ[i]; string::size_type equal = estring.find_first_of ('='); - + if (equal == string::npos) { /* say what? an environ value without = ? */ continue; } - + string before = estring.substr (0, equal); string after = estring.substr (equal+1); - + e.insert (pair<string,string>(before,after)); } } -} +} void EnvironmentalProtectionAgency::restore () const { @@ -126,7 +126,7 @@ EnvironmentalProtectionAgency::restore () const for (map<string,string>::const_iterator i = e.begin(); i != e.end(); ++i) { g_setenv (i->first.c_str(), i->second.c_str(), 1); } -} +} void EnvironmentalProtectionAgency::clear () const diff --git a/libs/pbd/error.cc b/libs/pbd/error.cc index f428c16c5b..1dd8fb8501 100644 --- a/libs/pbd/error.cc +++ b/libs/pbd/error.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/event_loop.cc b/libs/pbd/event_loop.cc index b6888f0f7d..6506c18be9 100644 --- a/libs/pbd/event_loop.cc +++ b/libs/pbd/event_loop.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,20 +25,20 @@ using namespace std; static void do_not_delete_the_loop_pointer (void*) { } -Glib::Threads::Private<EventLoop> EventLoop::thread_event_loop (do_not_delete_the_loop_pointer); +Glib::Threads::Private<EventLoop> EventLoop::thread_event_loop (do_not_delete_the_loop_pointer); -EventLoop* +EventLoop* EventLoop::get_event_loop_for_thread() { return thread_event_loop.get (); } -void -EventLoop::set_event_loop_for_thread (EventLoop* loop) +void +EventLoop::set_event_loop_for_thread (EventLoop* loop) { thread_event_loop.set (loop); } -void* +void* EventLoop::invalidate_request (void* data) { InvalidationRecord* ir = (InvalidationRecord*) data; @@ -46,7 +46,7 @@ EventLoop::invalidate_request (void* data) /* Some of the requests queued with an EventLoop may involve functors * that make method calls to objects whose lifetime is shorter * than the EventLoop's. We do not want to make those calls if the - * object involve has been destroyed. To prevent this, we + * object involve has been destroyed. To prevent this, we * provide a way to invalidate those requests when the object is * destroyed. * @@ -57,7 +57,7 @@ EventLoop::invalidate_request (void* data) * * The object is currently being destroyed and so we want to * mark all requests involving this object that are queued with - * any EventLoop as invalid. + * any EventLoop as invalid. * * As of April 2012, we are usign sigc::trackable as the base object * used to queue calls to ::invalidate_request() to be made upon @@ -74,7 +74,7 @@ EventLoop::invalidate_request (void* data) (*i)->invalidation = 0; } delete ir; - } + } return 0; } diff --git a/libs/pbd/ffs.cc b/libs/pbd/ffs.cc index 557504f14e..48a417c4f5 100644 --- a/libs/pbd/ffs.cc +++ b/libs/pbd/ffs.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Tim Mayberry + Copyright (C) 2013 Tim Mayberry This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/file_utils.cc b/libs/pbd/file_utils.cc index 3cd0689f4b..26a33db159 100644 --- a/libs/pbd/file_utils.cc +++ b/libs/pbd/file_utils.cc @@ -501,7 +501,7 @@ toggle_file_existence (string const & path) { if (Glib::file_test (path, Glib::FILE_TEST_IS_REGULAR)) { return g_unlink (path.c_str()); - } + } PBD::ScopedFileDescriptor fd = g_open (path.c_str(), O_CREAT|O_TRUNC|O_RDWR, 0666); return !((int) fd >= 0); diff --git a/libs/pbd/fpu.cc b/libs/pbd/fpu.cc index 33e646f744..7812ad6696 100644 --- a/libs/pbd/fpu.cc +++ b/libs/pbd/fpu.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -69,7 +69,7 @@ __cpuid(int regs[4], int cpuid_leaf) "%ebx", #endif "%ecx", "%edx"); - + regs[0] = eax; regs[1] = ebx; regs[2] = ecx; @@ -106,7 +106,7 @@ _xgetbv (uint32_t xcr) // N.B. The following would probably work for a pre-VC10 build, // although it might suffer from optimization issues. We'd need // to place this function into its own (unoptimized) source file. - __asm { + __asm { mov ecx, [xcr] __asm _emit 0x0f __asm _emit 0x01 __asm _emit 0xd0 /*xgetbv*/ } @@ -255,7 +255,7 @@ FPU::FPU () if (mxcsr_mask & (1<<6)) { _flags = Flags (_flags | HasDenormalsAreZero); - } + } #if !defined HAVE_POSIX_MEMALIGN && defined PLATFORM_WINDOWS _aligned_free (*fxbuf); @@ -284,7 +284,7 @@ FPU::FPU () } cpu_brand.assign(cpu_string, cpu_string_ptr - cpu_string); info << string_compose (_("CPU brand: %1"), cpu_brand) << endmsg; - } + } } #endif /* !ARCH_X86 */ } diff --git a/libs/pbd/id.cc b/libs/pbd/id.cc index 24cf02ab2e..c9823f0dc8 100644 --- a/libs/pbd/id.cc +++ b/libs/pbd/id.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/locale_guard.cc b/libs/pbd/locale_guard.cc index aa5a575521..4ec64984b0 100644 --- a/libs/pbd/locale_guard.cc +++ b/libs/pbd/locale_guard.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/malign.cc b/libs/pbd/malign.cc index 4be9f0a9e8..14fa9ea66c 100644 --- a/libs/pbd/malign.cc +++ b/libs/pbd/malign.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/md5.cc b/libs/pbd/md5.cc index 0532d29879..2fd7ab11da 100644 --- a/libs/pbd/md5.cc +++ b/libs/pbd/md5.cc @@ -101,7 +101,7 @@ MD5::Init () * context. */ -void +void MD5::Update(uint8_t const *input, size_t inputLen) { unsigned int i, index, partLen; @@ -139,7 +139,7 @@ MD5::Update(uint8_t const *input, size_t inputLen) // the message digest and zeroizing the context. // Writes to digestRaw -void +void MD5::Final() { uint8_t bits[8]; @@ -165,8 +165,8 @@ MD5::Final() writeToString(); } -/// Buffer must be 32+1 (nul) = 33 chars long at least -void +/// Buffer must be 32+1 (nul) = 33 chars long at least +void MD5::writeToString() { int pos; @@ -178,7 +178,7 @@ MD5::writeToString() /// Load a file from disk and digest it // Digests a file and returns the result. -char* +char* MD5::digestFile (char *filename) { Init(); @@ -201,18 +201,18 @@ MD5::digestFile (char *filename) } /// Digests a byte-array already in memory -char* +char* MD5::digestMemory (uint8_t const * memchunk, size_t len) { Init (); Update (memchunk, len); Final (); - + return digestChars; } // Digests a string and prints the result. -char* +char* MD5::digestString (char const * string) { Init (); @@ -222,7 +222,7 @@ MD5::digestString (char const * string) return digestChars; } -void +void MD5::Transform (uint32_t state[4], uint8_t const * block) { uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16]; @@ -313,7 +313,7 @@ MD5::Transform (uint32_t state[4], uint8_t const * block) /* Encodes input (uint32_t) into output (unsigned char). Assumes len is * a multiple of 4. */ -void +void MD5::Encode (uint8_t *output, uint32_t const * input, size_t len) { size_t i, j; @@ -330,7 +330,7 @@ MD5::Encode (uint8_t *output, uint32_t const * input, size_t len) * a multiple of 4. */ -void +void MD5::Decode (uint32_t *output, uint8_t const * input, size_t len) { size_t i, j; diff --git a/libs/pbd/mountpoint.cc b/libs/pbd/mountpoint.cc index ba4243979d..4867d3675c 100644 --- a/libs/pbd/mountpoint.cc +++ b/libs/pbd/mountpoint.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002 Paul Davis + Copyright (C) 2002 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,7 +63,7 @@ mountpoint (string path) n = 0; matchlen = 0; - /* note: strcmp's semantics are not + /* note: strcmp's semantics are not strict enough to use for this. */ @@ -123,9 +123,9 @@ mountpoint (string path) const char *cpath = path.c_str(); char best[PATH_MAX+1]; - /* From the manpage, under "BUGS" : "The memory allocated by getmntinfo() cannot be free(3)'d by the + /* From the manpage, under "BUGS" : "The memory allocated by getmntinfo() cannot be free(3)'d by the application." - + Thus: we do NOT try to free memory allocated by getmntinfo() */ @@ -139,7 +139,7 @@ mountpoint (string path) unsigned int n = 0; matchlen = 0; - /* note: strcmp's semantics are not + /* note: strcmp's semantics are not strict enough to use for this. */ diff --git a/libs/pbd/msvc/getopt.h b/libs/pbd/msvc/getopt.h index 233a0eefa6..ac7126123a 100644 --- a/libs/pbd/msvc/getopt.h +++ b/libs/pbd/msvc/getopt.h @@ -106,5 +106,5 @@ GETOPT_API int getopt __P((int, char * const *, const char *)); __END_DECLS #endif - + #endif /* !_GETOPT_H_ */ diff --git a/libs/pbd/msvc/getopt_long.c b/libs/pbd/msvc/getopt_long.c index 06c459ab84..bf10e5df58 100644 --- a/libs/pbd/msvc/getopt_long.c +++ b/libs/pbd/msvc/getopt_long.c @@ -152,7 +152,7 @@ gcd(int a, int b) b = c; c = a % b; } - + return b; } @@ -251,7 +251,7 @@ start: place = EMSG; if (IN_ORDER) { /* - * GNU extension: + * GNU extension: * return non-option as argument to option 1 */ optarg = nargv[optind++]; @@ -301,7 +301,7 @@ start: } if (optchar == 'W' && oli[1] == ';') { /* -W long-option */ /* XXX: what if no long options provided (called by getopt)? */ - if (*place) + if (*place) return -2; if (++optind >= nargc) { /* no arg */ @@ -435,7 +435,7 @@ getopt_long(int nargc, has_equal++; } else current_argv_len = strlen(current_argv); - + for (i = 0; long_options[i].name; i++) { /* find matching long option */ if (strncmp(current_argv, long_options[i].name, @@ -534,7 +534,7 @@ getopt_long(int nargc, if (long_options[match].flag) { *long_options[match].flag = long_options[match].val; retval = 0; - } else + } else retval = long_options[match].val; if (idx) *idx = match; diff --git a/libs/pbd/openuri.cc b/libs/pbd/openuri.cc index e2575185df..5f4f1ab546 100644 --- a/libs/pbd/openuri.cc +++ b/libs/pbd/openuri.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ PBD::open_uri (const char* uri) } bool -PBD::open_uri (const std::string& uri) +PBD::open_uri (const std::string& uri) { return open_uri (uri.c_str()); } diff --git a/libs/pbd/pathexpand.cc b/libs/pbd/pathexpand.cc index ee9fc2d351..805e0b85cd 100644 --- a/libs/pbd/pathexpand.cc +++ b/libs/pbd/pathexpand.cc @@ -52,7 +52,7 @@ using std::vector; * On Failure: 0 (NULL) */ -static char* +static char* realpath (const char *original_path, char resolved_path[_MAX_PATH+1]) { char *rpath = 0; @@ -135,7 +135,7 @@ PBD::path_expand (string path) return path; } - while (true) { + while (true) { if (regexec (&compiled_pattern, path.c_str(), nmatches, matches, 0)) { break; @@ -161,7 +161,7 @@ PBD::path_expand (string path) } /* go back and do it again with whatever remains after the - * substitution + * substitution */ } diff --git a/libs/pbd/pbd/abstract_ui.cc b/libs/pbd/pbd/abstract_ui.cc index cf5292b9e6..d2f8840b90 100644 --- a/libs/pbd/pbd/abstract_ui.cc +++ b/libs/pbd/pbd/abstract_ui.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,7 +39,7 @@ DECLARE_DEFAULT_COMPARISONS(ptw32_handle_t) using namespace std; -template<typename RequestBuffer> void +template<typename RequestBuffer> void cleanup_request_buffer (void* ptr) { RequestBuffer* rb = (RequestBuffer*) ptr; @@ -48,13 +48,13 @@ cleanup_request_buffer (void* ptr) * allocated dies. That could be before or after the end of the UI * event loop for which this request buffer provides communication. * - * We are not modifying the UI's thread/buffer map, just marking it + * We are not modifying the UI's thread/buffer map, just marking it * dead. If the UI is currently processing the buffers and misses * this "dead" signal, it will find it the next time it receives * a request. If the UI has finished processing requests, then * we will leak this buffer object. */ - + rb->dead = true; } @@ -67,7 +67,7 @@ AbstractUI<RequestObject>::AbstractUI (const string& name) { void (AbstractUI<RequestObject>::*pmf)(string,pthread_t,string,uint32_t) = &AbstractUI<RequestObject>::register_thread; - /* better to make this connect a handler that runs in the UI event loop but the syntax seems hard, and + /* better to make this connect a handler that runs in the UI event loop but the syntax seems hard, and register_thread() is thread safe anyway. */ @@ -112,14 +112,14 @@ AbstractUI<RequestObject>::register_thread (string target_gui, pthread_t thread_ /* add the new request queue (ringbuffer) to our map so that we can iterate over it when the time is right. This step is not RT-safe, but is assumed to be called - only at thread initialization time, not repeatedly, + only at thread initialization time, not repeatedly, and so this is of little consequence. */ Glib::Threads::Mutex::Lock lm (request_buffer_map_lock); request_buffers[thread_id] = b; } - /* set this thread's per_thread_request_buffer to this new + /* set this thread's per_thread_request_buffer to this new queue/ringbuffer. remember that only this thread will get this queue when it calls per_thread_request_buffer.get() @@ -188,7 +188,7 @@ AbstractUI<RequestObject>::handle_ui_requests () for (i = request_buffers.begin(); i != request_buffers.end(); ++i) { while (true) { - + /* we must process requests 1 by 1 because the request may run a recursive main event loop that will itself call @@ -198,9 +198,9 @@ AbstractUI<RequestObject>::handle_ui_requests () is even remotely consistent with the condition before we called it. */ - + i->second->get_read_vector (&vec); - + if (vec.len[0] == 0) { break; } else { @@ -214,7 +214,7 @@ AbstractUI<RequestObject>::handle_ui_requests () delete vec.buf[0]; i->second->increment_read_ptr (1); } - } + } } } @@ -246,7 +246,7 @@ AbstractUI<RequestObject>::handle_ui_requests () /* We need to use this lock, because its the one returned by slot_invalidation_mutex() and protects - against request invalidation. + against request invalidation. */ request_buffer_map_lock.lock (); @@ -276,7 +276,7 @@ AbstractUI<RequestObject>::handle_ui_requests () /* at this point, an object involved in a functor could be * deleted before we actually execute the functor. so there is * a race condition that makes the invalidation architecture - * somewhat pointless. + * somewhat pointless. * * really, we should only allow functors containing shared_ptr * references to objects to enter into the request queue. @@ -285,7 +285,7 @@ AbstractUI<RequestObject>::handle_ui_requests () request_buffer_map_lock.unlock (); /* unlock the request lock while we execute the request, so - * that we don't needlessly block other threads (note: not RT + * that we don't needlessly block other threads (note: not RT * threads since they have their own queue) from making requests. */ @@ -386,7 +386,7 @@ AbstractUI<RequestObject>::call_slot (InvalidationRecord* invalidation, const bo req->the_slot = f; /* the invalidation record is an object which will carry out - * invalidation of any requests associated with it when it is + * invalidation of any requests associated with it when it is * destroyed. it can be null. if its not null, associate this * request with the invalidation record. this allows us to * "cancel" requests submitted to the UI because they involved diff --git a/libs/pbd/pbd/abstract_ui.h b/libs/pbd/pbd/abstract_ui.h index a8602c7d78..060d05d37f 100644 --- a/libs/pbd/pbd/abstract_ui.h +++ b/libs/pbd/pbd/abstract_ui.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1998-2009 Paul Davis + Copyright (C) 1998-2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ /* We have a special case in libpbd of a template class that gets instantiated * as the base class of several classes in other libraries. It is not possible - * to use LIBFOO_API to mark this visible, because the FOO in each case is + * to use LIBFOO_API to mark this visible, because the FOO in each case is * different. So we define this generic visible/export/hidden/import pair * of macros to try to deal with this special case. These should NEVER be * used anywhere except AbstractUI<T> (or similar cases if they arise. @@ -46,7 +46,7 @@ #define ABSTRACT_UI_API LIBPBD_DLL_EXPORT #else #define ABSTRACT_UI_API LIBPBD_DLL_IMPORT -#endif +#endif class Touchable; @@ -68,9 +68,9 @@ class ABSTRACT_UI_API AbstractUI : public BaseUI struct RequestBuffer : public PBD::RingBufferNPT<RequestObject> { bool dead; AbstractUI<RequestObject>& ui; - RequestBuffer (uint32_t size, AbstractUI<RequestObject>& uir) + RequestBuffer (uint32_t size, AbstractUI<RequestObject>& uir) : PBD::RingBufferNPT<RequestObject> (size) - , dead (false) + , dead (false) , ui (uir) {} }; typedef typename RequestBuffer::rw_vector RequestBufferVector; diff --git a/libs/pbd/pbd/base_ui.h b/libs/pbd/pbd/base_ui.h index fbee20dd64..eddaf862c5 100644 --- a/libs/pbd/pbd/base_ui.h +++ b/libs/pbd/pbd/base_ui.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2009 Paul Davis + Copyright (C) 2000-2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ * events/requests and dispatch/process them as they arrive. * * This implementation starts up a thread that runs a Glib main loop - * to wait on events/requests etc. + * to wait on events/requests etc. */ @@ -62,7 +62,7 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop static RequestType CallSlot; static RequestType Quit; - /** start up a thread to run the main loop + /** start up a thread to run the main loop */ void run (); @@ -72,7 +72,7 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop void quit (); protected: - bool _ok; + bool _ok; Glib::RefPtr<Glib::MainLoop> _main_loop; Glib::RefPtr<Glib::MainContext> m_context; @@ -81,7 +81,7 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop Glib::Threads::Cond _running; /* this signals _running from within the event loop, - from an idle callback + from an idle callback */ bool signal_running (); @@ -107,7 +107,7 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop virtual void handle_ui_requests () = 0; private: - std::string _name; + std::string _name; BaseUI* base_ui_instance; CrossThreadChannel request_channel; diff --git a/libs/pbd/pbd/basename.h b/libs/pbd/pbd/basename.h index 16e7905748..b93f70b59e 100644 --- a/libs/pbd/pbd/basename.h +++ b/libs/pbd/pbd/basename.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,6 @@ namespace PBD { LIBPBD_API Glib::ustring basename_nosuffix (Glib::ustring); -} +} #endif /* __libpbd_basename_h__ */ diff --git a/libs/pbd/pbd/boost_debug.h b/libs/pbd/pbd/boost_debug.h index 294a3468f6..9467fa87c3 100644 --- a/libs/pbd/pbd/boost_debug.h +++ b/libs/pbd/pbd/boost_debug.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Paul Davis + Copyright (C) 2009 Paul Davis From an idea by Carl Hetherington. This program is free software; you can redistribute it and/or modify diff --git a/libs/pbd/pbd/cartesian.h b/libs/pbd/pbd/cartesian.h index 5f0b951d5f..5da136d056 100644 --- a/libs/pbd/pbd/cartesian.h +++ b/libs/pbd/pbd/cartesian.h @@ -28,7 +28,7 @@ namespace PBD { LIBPBD_API void spherical_to_cartesian (double azi, double ele, double len, double& x, double& y, double& z); LIBPBD_API void cartesian_to_spherical (double x, double y, double z, double& azi, double& ele, double& len); - + struct AngularVector; struct LIBPBD_API CartesianVector { diff --git a/libs/pbd/pbd/command.h b/libs/pbd/pbd/command.h index 4547b779fb..9feac6366a 100644 --- a/libs/pbd/pbd/command.h +++ b/libs/pbd/pbd/command.h @@ -1,5 +1,5 @@ -/* +/* Copyright (C) 2006 Paul Davis Author: Hans Fugal diff --git a/libs/pbd/pbd/compose.h b/libs/pbd/pbd/compose.h index b3b6ea21d1..768820b61a 100644 --- a/libs/pbd/pbd/compose.h +++ b/libs/pbd/pbd/compose.h @@ -110,7 +110,7 @@ namespace StringPrivate case '8': case '9': return true; - + default: return false; } @@ -124,21 +124,21 @@ namespace StringPrivate os << obj; std::string rep = os.str(); - + if (!rep.empty()) { // manipulators don't produce output for (specification_map::const_iterator i = specs.lower_bound(arg_no), end = specs.upper_bound(arg_no); i != end; ++i) { output_list::iterator pos = i->second; ++pos; - + output.insert(pos, rep); } - + os.str(std::string()); //os.clear(); ++arg_no; } - + return *this; } @@ -174,7 +174,7 @@ namespace StringPrivate } ++arg_no; - + return *this; } @@ -182,7 +182,7 @@ namespace StringPrivate : arg_no(1) { std::string::size_type b = 0, i = 0; - + // fill in output with the strings between the %1 %2 %3 etc. and // fill in specs with the positions while (i < fmt.length()) { @@ -220,7 +220,7 @@ namespace StringPrivate else ++i; } - + if (i - b > 0) // add the rest of the string output.push_back(fmt.substr(b, i - b)); } @@ -229,11 +229,11 @@ namespace StringPrivate { // assemble string std::string str; - + for (output_list::const_iterator i = output.begin(), end = output.end(); i != end; ++i) str += *i; - + return str; } } @@ -244,7 +244,7 @@ namespace StringPrivate // a series of functions which accept a format string on the form "text %1 // more %2 less %3" and a number of templated parameters and spits out the // composited string - template <typename T1> + template <typename T1> inline std::string string_compose(const std::string &fmt, const T1 &o1) { StringPrivate::Composition c(fmt); @@ -252,7 +252,7 @@ namespace StringPrivate return c.str(); } - template <typename T1, typename T2> + template <typename T1, typename T2> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2) { @@ -261,7 +261,7 @@ namespace StringPrivate return c.str(); } - template <typename T1, typename T2, typename T3> + template <typename T1, typename T2, typename T3> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3) { @@ -270,7 +270,7 @@ namespace StringPrivate return c.str(); } - template <typename T1, typename T2, typename T3, typename T4> + template <typename T1, typename T2, typename T3, typename T4> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4) @@ -280,7 +280,7 @@ namespace StringPrivate return c.str(); } - template <typename T1, typename T2, typename T3, typename T4, typename T5> + template <typename T1, typename T2, typename T3, typename T4, typename T5> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5) @@ -291,7 +291,7 @@ namespace StringPrivate } template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6> + typename T6> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5, const T6 &o6) @@ -302,7 +302,7 @@ namespace StringPrivate } template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7> + typename T6, typename T7> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5, const T6 &o6, @@ -314,7 +314,7 @@ namespace StringPrivate } template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8> + typename T6, typename T7, typename T8> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5, const T6 &o6, @@ -326,7 +326,7 @@ namespace StringPrivate } template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9> + typename T6, typename T7, typename T8, typename T9> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5, const T6 &o6, @@ -338,7 +338,7 @@ namespace StringPrivate } template <typename T1, typename T2, typename T3, typename T4, typename T5, - typename T6, typename T7, typename T8, typename T9, typename T10> + typename T6, typename T7, typename T8, typename T9, typename T10> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5, const T6 &o6, @@ -350,10 +350,10 @@ namespace StringPrivate .arg(o10); return c.str(); } - + template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11> + typename T11> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5, const T6 &o6, @@ -368,7 +368,7 @@ namespace StringPrivate template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12> + typename T11, typename T12> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5, const T6 &o6, @@ -383,7 +383,7 @@ namespace StringPrivate template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13> + typename T11, typename T12, typename T13> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5, const T6 &o6, @@ -399,7 +399,7 @@ namespace StringPrivate template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, - typename T11, typename T12, typename T13, typename T14> + typename T11, typename T12, typename T13, typename T14> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5, const T6 &o6, @@ -416,7 +416,7 @@ namespace StringPrivate template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, - typename T15> + typename T15> inline std::string string_compose(const std::string &fmt, const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4, const T5 &o5, const T6 &o6, diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h index 4260429952..257fe8dcab 100644 --- a/libs/pbd/pbd/controllable.h +++ b/libs/pbd/pbd/controllable.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -134,12 +134,12 @@ class LIBPBD_API Controllable : public PBD::StatefulDestructible { a Controllable */ -class LIBPBD_API IgnorableControllable : public Controllable +class LIBPBD_API IgnorableControllable : public Controllable { - public: + public: IgnorableControllable () : PBD::Controllable ("ignoreMe") {} ~IgnorableControllable () {} - + void set_value (double /*v*/) {} double get_value () const { return 0.0; } }; diff --git a/libs/pbd/pbd/controllable_descriptor.h b/libs/pbd/pbd/controllable_descriptor.h index ddb29a2015..e4366c86eb 100644 --- a/libs/pbd/pbd/controllable_descriptor.h +++ b/libs/pbd/pbd/controllable_descriptor.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Paul Davis + Copyright (C) 2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,7 +48,7 @@ public: PluginParameter }; - ControllableDescriptor () + ControllableDescriptor () : _top_level_type (RemoteControlID) , _subtype (Gain) , _rid (0) diff --git a/libs/pbd/pbd/convert.h b/libs/pbd/pbd/convert.h index b5c7e10f5d..d638ab8c8d 100644 --- a/libs/pbd/pbd/convert.h +++ b/libs/pbd/pbd/convert.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002 Paul Davis + Copyright (C) 2002 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,7 +49,7 @@ LIBPBD_API std::string length2string (const int64_t frames, const double sample_ LIBPBD_API std::vector<std::string> internationalize (const char *, const char **); LIBPBD_API bool strings_equal_ignore_case (const std::string& a, const std::string& b); -template <class T> std::string /*LIBPBD_API*/ +template <class T> std::string /*LIBPBD_API*/ to_string (T t, std::ios_base & (*f)(std::ios_base&)) { std::ostringstream oss; diff --git a/libs/pbd/pbd/crossthread.h b/libs/pbd/pbd/crossthread.h index d48f1bfe68..d9b80db48c 100644 --- a/libs/pbd/pbd/crossthread.h +++ b/libs/pbd/pbd/crossthread.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,14 +35,14 @@ /** A simple abstraction of a mechanism of signalling one thread from another. * The signaller calls ::wakeup() to tell the signalled thread to check for - * work to be done. + * work to be done. * * This implementation provides both ::selectable() for use in direct * poll/select-based event loops, and a Glib::IOSource via ::ios() for use - * in Glib main loop based situations. + * in Glib main loop based situations. */ -class LIBPBD_API CrossThreadChannel { +class LIBPBD_API CrossThreadChannel { public: /** if @a non_blocking is true, the channel will not cause blocking * when used in an event loop based on poll/select or the glib main @@ -74,7 +74,7 @@ public: int receive (char& msg, bool wait = false); /** empty the channel of all requests. - * Typically this is done as soon as input + * Typically this is done as soon as input * is noticed on the channel, because the * handler will look at a separately managed work * queue. The actual number of queued "wakeups" diff --git a/libs/pbd/pbd/debug.h b/libs/pbd/pbd/debug.h index 16341fc0cd..3696e7a346 100644 --- a/libs/pbd/pbd/debug.h +++ b/libs/pbd/pbd/debug.h @@ -46,7 +46,7 @@ namespace PBD { namespace DEBUG { /* this namespace is so that we can write DEBUG::bit_name */ - + LIBPBD_API extern DebugBits Stateful; LIBPBD_API extern DebugBits Properties; LIBPBD_API extern DebugBits FileManager; diff --git a/libs/pbd/pbd/demangle.h b/libs/pbd/pbd/demangle.h index 12dc58839c..a8487f96d0 100644 --- a/libs/pbd/pbd/demangle.h +++ b/libs/pbd/pbd/demangle.h @@ -32,7 +32,7 @@ namespace PBD { - template<typename T> /*LIBPBD_API*/ + template<typename T> /*LIBPBD_API*/ std::string demangled_name (T const & obj) { #ifdef __GNUC__ @@ -49,7 +49,7 @@ namespace PBD See http://msdn.microsoft.com/en-us/library/ms681400%28VS.85%29.aspx See also: http://msdn.microsoft.com/en-us/library/ms680344%28VS.85%29.aspx */ - + return typeid(obj).name(); } } // namespace diff --git a/libs/pbd/pbd/destructible.h b/libs/pbd/pbd/destructible.h index 78f6f83b7a..0c401a947f 100644 --- a/libs/pbd/pbd/destructible.h +++ b/libs/pbd/pbd/destructible.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/enumwriter.h b/libs/pbd/pbd/enumwriter.h index 0be9b7be19..405a187817 100644 --- a/libs/pbd/pbd/enumwriter.h +++ b/libs/pbd/pbd/enumwriter.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2006 Paul Davis This program is free software; you can redistribute it and/or modify @@ -72,7 +72,7 @@ class LIBPBD_API EnumWriter { bool bitwise; EnumRegistration() {} - EnumRegistration (std::vector<int>& v, std::vector<std::string>& s, bool b) + EnumRegistration (std::vector<int>& v, std::vector<std::string>& s, bool b) : values (v), names (s), bitwise (b) {} }; diff --git a/libs/pbd/pbd/epa.h b/libs/pbd/pbd/epa.h index 6d305c5c4c..89c085a5bc 100644 --- a/libs/pbd/pbd/epa.h +++ b/libs/pbd/pbd/epa.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2010 Paul Davis + Copyright (C) 2010 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,14 +31,14 @@ class LIBPBD_API EnvironmentalProtectionAgency { public: EnvironmentalProtectionAgency (bool arm = true, const std::string& envname = std::string()); ~EnvironmentalProtectionAgency (); - + void arm (); void save (); void restore () const; - + static EnvironmentalProtectionAgency* get_global_epa () { return _global_epa; } static void set_global_epa (EnvironmentalProtectionAgency* epa) { _global_epa = epa; } - + private: void clear () const; diff --git a/libs/pbd/pbd/event_loop.h b/libs/pbd/pbd/event_loop.h index 5baa5e04be..a100365497 100644 --- a/libs/pbd/pbd/event_loop.h +++ b/libs/pbd/pbd/event_loop.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Paul Davis + Copyright (C) 2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ namespace PBD * when something like this is needed (it inherits from EventLoop). */ -class LIBPBD_API EventLoop +class LIBPBD_API EventLoop { public: EventLoop() {} @@ -49,7 +49,7 @@ class LIBPBD_API EventLoop }; struct BaseRequestObject; - + struct InvalidationRecord { std::list<BaseRequestObject*> requests; PBD::EventLoop* event_loop; @@ -66,7 +66,7 @@ class LIBPBD_API EventLoop bool valid; InvalidationRecord* invalidation; boost::function<void()> the_slot; - + BaseRequestObject() : valid (true), invalidation (0) {} }; diff --git a/libs/pbd/pbd/failed_constructor.h b/libs/pbd/pbd/failed_constructor.h index 92c3f19c76..837bb51d10 100644 --- a/libs/pbd/pbd/failed_constructor.h +++ b/libs/pbd/pbd/failed_constructor.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/ffs.h b/libs/pbd/pbd/ffs.h index f21fc82a39..a2158dac46 100644 --- a/libs/pbd/pbd/ffs.h +++ b/libs/pbd/pbd/ffs.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Tim Mayberry + Copyright (C) 2013 Tim Mayberry This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,6 @@ namespace PBD { LIBPBD_API int ffs(int x); -} +} #endif /* __libpbd_ffs_h__ */ diff --git a/libs/pbd/pbd/file_utils.h b/libs/pbd/pbd/file_utils.h index 876f1148d5..e9baaa3e81 100644 --- a/libs/pbd/pbd/file_utils.h +++ b/libs/pbd/pbd/file_utils.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2007 Tim Mayberry + Copyright (C) 2007 Tim Mayberry This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/floating.h b/libs/pbd/pbd/floating.h index c0003a3113..86ab4a68f0 100644 --- a/libs/pbd/pbd/floating.h +++ b/libs/pbd/pbd/floating.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,18 +42,18 @@ union /*LIBPBD_API*/ Float_t bool negative() const { return (i >> 31) != 0; } int32_t raw_mantissa() const { return i & ((1 << 23) - 1); } int32_t raw_exponent() const { return (i >> 23) & 0xFF; } - + int32_t i; float f; }; - + /* Note: ULPS = Units in the Last Place */ static inline bool floateq (float a, float b, int max_ulps_diff) { Float_t ua (a); Float_t ub (b); - + if (a == b) { return true; } @@ -69,7 +69,7 @@ static inline bool floateq (float a, float b, int max_ulps_diff) if (ulps_diff <= max_ulps_diff) { return true; } - + return false; } diff --git a/libs/pbd/pbd/forkexec.h b/libs/pbd/pbd/forkexec.h index e6d8f0c5ea..f0a077cc9d 100644 --- a/libs/pbd/pbd/forkexec.h +++ b/libs/pbd/pbd/forkexec.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/fpu.h b/libs/pbd/pbd/fpu.h index 463fef3ff2..8be9e1a35b 100644 --- a/libs/pbd/pbd/fpu.h +++ b/libs/pbd/pbd/fpu.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/functor_command.h b/libs/pbd/pbd/functor_command.h index 6cca13209f..68092a77bb 100644 --- a/libs/pbd/pbd/functor_command.h +++ b/libs/pbd/pbd/functor_command.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2007 Paul Davis This program is free software; you can redistribute it and/or modify @@ -31,7 +31,7 @@ #include "pbd/command.h" #include "pbd/failed_constructor.h" -/** This command class is initialized +/** This command class is initialized */ namespace PBD { @@ -45,11 +45,11 @@ class /*LIBPBD_API*/ FunctorCommand : public Command typedef typename FunctorMap::iterator FunctorMapIterator; public: - FunctorCommand(std::string functor, obj_type& object, arg_type b, arg_type a) + FunctorCommand(std::string functor, obj_type& object, arg_type b, arg_type a) : functor_name(functor) , object(object) , before(b) - , after(a) + , after(a) { method = find_functor(functor); @@ -65,7 +65,7 @@ class /*LIBPBD_API*/ FunctorCommand : public Command (object.*method) (after); } - void undo() { + void undo() { (object.*method) (before); } @@ -108,7 +108,7 @@ class /*LIBPBD_API*/ FunctorCommand : public Command static FunctorMap functor_map; }; -// static initialization of functor_map... +// static initialization of functor_map... template <class obj_type, class arg_type> typename FunctorCommand<obj_type, arg_type>::FunctorMap FunctorCommand<obj_type, arg_type>::functor_map; diff --git a/libs/pbd/pbd/id.h b/libs/pbd/pbd/id.h index a7d0c2c622..05ac69e26d 100644 --- a/libs/pbd/pbd/id.h +++ b/libs/pbd/pbd/id.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ class LIBPBD_API ID { void reset (); bool operator== (const ID& other) const { - return _id == other._id; + return _id == other._id; } bool operator!= (const ID& other) const { @@ -47,8 +47,8 @@ class LIBPBD_API ID { bool operator== (const std::string&) const; - ID& operator= (std::string); - ID& operator= (const ID&); + ID& operator= (std::string); + ID& operator= (const ID&); bool operator< (const ID& other) const { return _id < other._id; diff --git a/libs/pbd/pbd/libpbd_visibility.h b/libs/pbd/pbd/libpbd_visibility.h index f77eeb15ed..51fed25084 100644 --- a/libs/pbd/pbd/libpbd_visibility.h +++ b/libs/pbd/pbd/libpbd_visibility.h @@ -52,7 +52,7 @@ #define LIBPBD_API LIBPBD_DLL_IMPORT #define LIBPBD_TEMPLATE_API LIBPBD_TEMPLATE_DLL_IMPORT #define LIBPBD_TEMPLATE_MEMBER_API LIBPBD_TEMPLATE_MEMBER_DLL_IMPORT - #endif + #endif #define LIBPBD_LOCAL LIBPBD_DLL_LOCAL #endif diff --git a/libs/pbd/pbd/malign.h b/libs/pbd/pbd/malign.h index 09d182fa40..8676c801bd 100644 --- a/libs/pbd/pbd/malign.h +++ b/libs/pbd/pbd/malign.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/mathfix.h b/libs/pbd/pbd/mathfix.h index fd0468905f..eae748b4bc 100644 --- a/libs/pbd/pbd/mathfix.h +++ b/libs/pbd/pbd/mathfix.h @@ -1,6 +1,6 @@ /* Copyright (C) 2005 Paul Davis - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or diff --git a/libs/pbd/pbd/md5.h b/libs/pbd/pbd/md5.h index 80f45bc8ea..8a5ee71aab 100644 --- a/libs/pbd/pbd/md5.h +++ b/libs/pbd/pbd/md5.h @@ -58,7 +58,7 @@ class LIBPBD_API MD5 void Transform (uint32_t state[4], uint8_t const * block); void Encode (uint8_t *output, uint32_t const *input, size_t len); void Decode (uint32_t *output, uint8_t const * input, size_t len); - void Update (uint8_t const *input, size_t inputLen); + void Update (uint8_t const *input, size_t inputLen); void Final (); }; diff --git a/libs/pbd/pbd/memento_command.h b/libs/pbd/pbd/memento_command.h index d22561ab21..437f58631d 100644 --- a/libs/pbd/pbd/memento_command.h +++ b/libs/pbd/pbd/memento_command.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2006 Paul Davis Author: Hans Fugal @@ -95,7 +95,7 @@ private: PBD::ScopedConnection _object_death_connection; }; -/** This command class is initialized with before and after mementos +/** This command class is initialized with before and after mementos * (from Stateful::get_state()), so undo becomes restoring the before * memento, and redo is restoring the after memento. */ @@ -103,14 +103,14 @@ template <class obj_T> class LIBPBD_TEMPLATE_API MementoCommand : public Command { public: - MementoCommand (obj_T& a_object, XMLNode* a_before, XMLNode* a_after) + MementoCommand (obj_T& a_object, XMLNode* a_before, XMLNode* a_after) : _binder (new SimpleMementoCommandBinder<obj_T> (a_object)), before (a_before), after (a_after) { /* The binder's object died, so we must die */ _binder->DropReferences.connect_same_thread (_binder_death_connection, boost::bind (&MementoCommand::binder_dying, this)); } - MementoCommand (MementoCommandBinder<obj_T>* b, XMLNode* a_before, XMLNode* a_after) + MementoCommand (MementoCommandBinder<obj_T>* b, XMLNode* a_before, XMLNode* a_after) : _binder (b), before (a_before), after (a_after) { /* The binder's object died, so we must die */ @@ -130,13 +130,13 @@ public: void operator() () { if (after) { - _binder->get()->set_state(*after, Stateful::current_state_version); + _binder->get()->set_state(*after, Stateful::current_state_version); } } - void undo() { + void undo() { if (before) { - _binder->get()->set_state(*before, Stateful::current_state_version); + _binder->get()->set_state(*before, Stateful::current_state_version); } } diff --git a/libs/pbd/pbd/mountpoint.h b/libs/pbd/pbd/mountpoint.h index 3500f8a4ca..3c2c3f2129 100644 --- a/libs/pbd/pbd/mountpoint.h +++ b/libs/pbd/pbd/mountpoint.h @@ -1,6 +1,6 @@ /* Copyright (C) 1998-99 Paul Barton-Davis - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or diff --git a/libs/pbd/pbd/openuri.h b/libs/pbd/pbd/openuri.h index 8ba6ffca62..64ae46b1d9 100644 --- a/libs/pbd/pbd/openuri.h +++ b/libs/pbd/pbd/openuri.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/pool.h b/libs/pbd/pbd/pool.h index 37ca1adf00..8aff60fb6a 100644 --- a/libs/pbd/pbd/pool.h +++ b/libs/pbd/pbd/pool.h @@ -1,6 +1,6 @@ /* Copyright (C) 1998-99 Paul Barton-Davis - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -31,7 +31,7 @@ /** A pool of data items that can be allocated, read from and written to * without system memory allocation or locking. */ -class LIBPBD_API Pool +class LIBPBD_API Pool { public: Pool (std::string name, unsigned long item_size, unsigned long nitems); @@ -87,15 +87,15 @@ class LIBPBD_API PerThreadPool; /** Management of a per-thread pool of data that is allocated by one thread and * freed by one other thread. Not safe for use when there is more than 1 - * reader and 1 writer. + * reader and 1 writer. * - * This is basically a wrapper around a thread-local storage instance of a + * This is basically a wrapper around a thread-local storage instance of a * ringbuffer, made safe for use in the case where multiple threads allocate * from the ringbuffer and a single thread "frees" the allocations. - * + * * Rather than using locks, each thread has its own ringbuffer (and associated * data), and so it calls alloc(), passes a pointer to the result of the alloc - * to another thread, which later calls push() to "free" it. + * to another thread, which later calls push() to "free" it. */ class LIBPBD_API CrossThreadPool : public Pool { diff --git a/libs/pbd/pbd/properties.h b/libs/pbd/pbd/properties.h index 684fc37ffe..f67fe50413 100644 --- a/libs/pbd/pbd/properties.h +++ b/libs/pbd/pbd/properties.h @@ -180,7 +180,7 @@ protected: } _current = v; - } + } } virtual std::string to_string (T const& v) const = 0; @@ -197,7 +197,7 @@ private: PropertyTemplate (PropertyTemplate<T> const &); }; -template<class T> /*LIBPBD_API*/ +template<class T> /*LIBPBD_API*/ std::ostream & operator<<(std::ostream& os, PropertyTemplate<T> const& s) { return os << s.val (); diff --git a/libs/pbd/pbd/property_basics_impl.h b/libs/pbd/pbd/property_basics_impl.h index c63c5ccc5c..18bfcc44be 100644 --- a/libs/pbd/pbd/property_basics_impl.h +++ b/libs/pbd/pbd/property_basics_impl.h @@ -23,29 +23,29 @@ namespace PBD { template<typename T> -PropertyChange::PropertyChange(PropertyDescriptor<T> p) -{ - insert (p.property_id); +PropertyChange::PropertyChange(PropertyDescriptor<T> p) +{ + insert (p.property_id); } -template<typename T> PropertyChange -PropertyChange::operator=(PropertyDescriptor<T> p) +template<typename T> PropertyChange +PropertyChange::operator=(PropertyDescriptor<T> p) { clear (); insert (p.property_id); return *this; } -template<typename T> bool -PropertyChange::contains (PropertyDescriptor<T> p) const -{ - return find (p.property_id) != end (); +template<typename T> bool +PropertyChange::contains (PropertyDescriptor<T> p) const +{ + return find (p.property_id) != end (); } -template<typename T> void -PropertyChange::add (PropertyDescriptor<T> p) -{ - insert (p.property_id); +template<typename T> void +PropertyChange::add (PropertyDescriptor<T> p) +{ + insert (p.property_id); } } diff --git a/libs/pbd/pbd/property_list.h b/libs/pbd/pbd/property_list.h index abb85e77d5..28b60b521e 100644 --- a/libs/pbd/pbd/property_list.h +++ b/libs/pbd/pbd/property_list.h @@ -35,7 +35,7 @@ class LIBPBD_API PropertyList : public std::map<PropertyID, PropertyBase*> public: PropertyList (); PropertyList (PropertyList const &); - + virtual ~PropertyList(); void get_changes_as_xml (XMLNode *); diff --git a/libs/pbd/pbd/pthread_utils.h b/libs/pbd/pbd/pthread_utils.h index 007a97c9dc..a5173ad24d 100644 --- a/libs/pbd/pbd/pthread_utils.h +++ b/libs/pbd/pbd/pthread_utils.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/receiver.h b/libs/pbd/pbd/receiver.h index d3303ae192..2919063cbe 100644 --- a/libs/pbd/pbd/receiver.h +++ b/libs/pbd/pbd/receiver.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1998-99 Paul Barton-Davis + Copyright (C) 1998-99 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/replace_all.h b/libs/pbd/pbd/replace_all.h index f769bcb3fb..6e5b4bd864 100644 --- a/libs/pbd/pbd/replace_all.h +++ b/libs/pbd/pbd/replace_all.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/ringbuffer.h b/libs/pbd/pbd/ringbuffer.h index f811048a1d..935beb0469 100644 --- a/libs/pbd/pbd/ringbuffer.h +++ b/libs/pbd/pbd/ringbuffer.h @@ -26,7 +26,7 @@ #include "pbd/libpbd_visibility.h" template<class T> -class /*LIBPBD_API*/ RingBuffer +class /*LIBPBD_API*/ RingBuffer { public: RingBuffer (guint sz) { @@ -69,15 +69,15 @@ class /*LIBPBD_API*/ RingBuffer void decrement_read_idx (guint cnt) { g_atomic_int_set (&read_idx, (g_atomic_int_get(&read_idx) - cnt) & size_mask); - } + } void increment_read_idx (guint cnt) { g_atomic_int_set (&read_idx, (g_atomic_int_get(&read_idx) + cnt) & size_mask); - } + } void increment_write_idx (guint cnt) { g_atomic_int_set (&write_idx, (g_atomic_int_get(&write_idx) + cnt) & size_mask); - } + } guint write_space () const { guint w, r; @@ -120,7 +120,7 @@ class /*LIBPBD_API*/ RingBuffer guint size_mask; }; -template<class T> /*LIBPBD_API*/ guint +template<class T> /*LIBPBD_API*/ guint RingBuffer<T>::read (T *dest, guint cnt) { guint free_cnt; @@ -136,7 +136,7 @@ RingBuffer<T>::read (T *dest, guint cnt) } to_read = cnt > free_cnt ? free_cnt : cnt; - + cnt2 = priv_read_idx + to_read; if (cnt2 > size) { @@ -146,7 +146,7 @@ RingBuffer<T>::read (T *dest, guint cnt) n1 = to_read; n2 = 0; } - + memcpy (dest, &buf[priv_read_idx], n1 * sizeof (T)); priv_read_idx = (priv_read_idx + n1) & size_mask; @@ -176,7 +176,7 @@ RingBuffer<T>::write (T const *src, guint cnt) } to_write = cnt > free_cnt ? free_cnt : cnt; - + cnt2 = priv_write_idx + to_write; if (cnt2 > size) { @@ -220,7 +220,7 @@ RingBuffer<T>::get_read_vector (typename RingBuffer<T>::rw_vector *vec) if (cnt2 > size) { /* Two part vector: the rest of the buffer after the - current write ptr, plus some from the start of + current write ptr, plus some from the start of the buffer. */ @@ -264,7 +264,7 @@ RingBuffer<T>::get_write_vector (typename RingBuffer<T>::rw_vector *vec) if (cnt2 > size) { /* Two part vector: the rest of the buffer after the - current write ptr, plus some from the start of + current write ptr, plus some from the start of the buffer. */ diff --git a/libs/pbd/pbd/ringbufferNPT.h b/libs/pbd/pbd/ringbufferNPT.h index cd17299961..e700e89d2e 100644 --- a/libs/pbd/pbd/ringbufferNPT.h +++ b/libs/pbd/pbd/ringbufferNPT.h @@ -70,15 +70,15 @@ class /*LIBPBD_API*/ RingBufferNPT void decrement_read_ptr (size_t cnt) { g_atomic_int_set (&read_ptr, (g_atomic_int_get(&read_ptr) - cnt) % size); - } + } void increment_read_ptr (size_t cnt) { g_atomic_int_set (&read_ptr, (g_atomic_int_get(&read_ptr) + cnt) % size); - } + } void increment_write_ptr (size_t cnt) { g_atomic_int_set (&write_ptr, (g_atomic_int_get(&write_ptr) + cnt) % size); - } + } size_t write_space () { size_t w, r; @@ -136,7 +136,7 @@ RingBufferNPT<T>::read (T *dest, size_t cnt) } to_read = cnt > free_cnt ? free_cnt : cnt; - + cnt2 = priv_read_ptr + to_read; if (cnt2 > size) { @@ -146,7 +146,7 @@ RingBufferNPT<T>::read (T *dest, size_t cnt) n1 = to_read; n2 = 0; } - + memcpy (dest, &buf[priv_read_ptr], n1 * sizeof (T)); priv_read_ptr = (priv_read_ptr + n1) % size; @@ -175,7 +175,7 @@ RingBufferNPT<T>::write (const T *src, size_t cnt) } to_write = cnt > free_cnt ? free_cnt : cnt; - + cnt2 = priv_write_ptr + to_write; if (cnt2 > size) { @@ -218,7 +218,7 @@ RingBufferNPT<T>::get_read_vector (typename RingBufferNPT<T>::rw_vector *vec) if (cnt2 > size) { /* Two part vector: the rest of the buffer after the - current write ptr, plus some from the start of + current write ptr, plus some from the start of the buffer. */ @@ -261,7 +261,7 @@ RingBufferNPT<T>::get_write_vector (typename RingBufferNPT<T>::rw_vector *vec) if (cnt2 > size) { /* Two part vector: the rest of the buffer after the - current write ptr, plus some from the start of + current write ptr, plus some from the start of the buffer. */ diff --git a/libs/pbd/pbd/search_path.h b/libs/pbd/pbd/search_path.h index 74ac764dc0..9f0d407751 100644 --- a/libs/pbd/pbd/search_path.h +++ b/libs/pbd/pbd/search_path.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2007 Tim Mayberry + Copyright (C) 2007 Tim Mayberry This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,8 +31,8 @@ namespace PBD { * @class Searchpath * * The Searchpath class is a helper class for getting a - * vector of paths contained in a search path string where a - * "search path string" contains absolute directory paths + * vector of paths contained in a search path string where a + * "search path string" contains absolute directory paths * separated by a colon(:) or a semi-colon(;) on windows. * * The Searchpath class does not test whether the paths exist @@ -48,13 +48,13 @@ public: /** * Initialize Searchpath from a string where the string contains - * one or more absolute paths to directories which are delimited - * by a path separation character. The path delimeter is a + * one or more absolute paths to directories which are delimited + * by a path separation character. The path delimeter is a * colon(:) on unix and a semi-colon(;) on windows. * * Each path contained in the search path may or may not resolve to * an existing directory in the filesystem. - * + * * @param search_path A path string. */ LIBPBD_TEMPLATE_MEMBER_API Searchpath (const std::string& search_path); @@ -109,7 +109,7 @@ public: /** * Add a sub-directory to each path in the search path. - * @param subdir The directory name, it should not contain + * @param subdir The directory name, it should not contain * any path separating tokens. */ LIBPBD_TEMPLATE_MEMBER_API Searchpath& add_subdirectory_to_paths (const std::string& subdir); diff --git a/libs/pbd/pbd/sequence_property.h b/libs/pbd/pbd/sequence_property.h index e105e82e47..5ab938b257 100644 --- a/libs/pbd/pbd/sequence_property.h +++ b/libs/pbd/pbd/sequence_property.h @@ -91,7 +91,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase XMLNode* child = new XMLNode (PBD::capitalize (property_name())); history_node->add_child_nocopy (*child); - + /* record the change described in our change member */ if (!_changes.added.empty()) { @@ -126,7 +126,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase void get_value (XMLNode & node) const { for (typename Container::const_iterator i = _val.begin(); i != _val.end(); ++i) { node.add_child_nocopy ((*i)->get_state ()); - } + } } bool changed () const { @@ -144,7 +144,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase } /** Given a record of changes to this property, pass it to a callback that will - * update the property in some appropriate way. + * update the property in some appropriate way. * * This exists because simply using std::sequence methods to add/remove items * from the property is far too simplistic - the semantics of add/remove may @@ -170,7 +170,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase it. the Destructible is likely to be the Command being built with this diff(). */ - + for (typename ChangeContainer::const_iterator i = a->changes().added.begin(); i != a->changes().added.end(); ++i) { (*i)->DropReferences.connect_same_thread (*cmd, boost::bind (&Destructible::drop_references, cmd)); } @@ -302,11 +302,11 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase _val.clear (); } - typename Container::size_type size() const { + typename Container::size_type size() const { return _val.size(); } - bool empty() const { + bool empty() const { return _val.empty(); } @@ -320,30 +320,30 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase return _val = other; } - typename Container::reference front() { + typename Container::reference front() { return _val.front (); } - typename Container::const_reference front() const { + typename Container::const_reference front() const { return _val.front (); } - typename Container::reference back() { + typename Container::reference back() { return _val.back (); } - typename Container::const_reference back() const { + typename Container::const_reference back() const { return _val.back (); } - void sort() { + void sort() { _val.sort (); } template<class BinaryPredicate> void sort(BinaryPredicate comp) { _val.sort (comp); } - + const ChangeRecord& changes () const { return _changes; } protected: diff --git a/libs/pbd/pbd/shortpath.h b/libs/pbd/pbd/shortpath.h index 48dbb0eee2..58cf83f2a6 100644 --- a/libs/pbd/pbd/shortpath.h +++ b/libs/pbd/pbd/shortpath.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h index 983c56c6de..cc70d07ca5 100644 --- a/libs/pbd/pbd/signals.h +++ b/libs/pbd/pbd/signals.h @@ -1,6 +1,6 @@ /* - Copyright (C) 2009-2012 Paul Davis - + Copyright (C) 2009-2012 Paul Davis + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -166,9 +166,9 @@ class LIBPBD_API ScopedConnectionList : public boost::noncopyable scoped connections needs to be protected in 2 cases: (1) (unlikely) we make a connection involving a callback on the - same object from 2 threads. (wouldn't that just be appalling + same object from 2 threads. (wouldn't that just be appalling programming style?) - + (2) where we are dropping connections in one thread and adding one from another. */ diff --git a/libs/pbd/pbd/stacktrace.h b/libs/pbd/pbd/stacktrace.h index 19e354649a..754501eea7 100644 --- a/libs/pbd/pbd/stacktrace.h +++ b/libs/pbd/pbd/stacktrace.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ namespace PBD { LIBPBD_API std::string demangle (const std::string&); template<typename T> -class /*LIBPBD_API*/ thing_with_backtrace +class /*LIBPBD_API*/ thing_with_backtrace { public: thing_with_backtrace () { @@ -52,7 +52,7 @@ class /*LIBPBD_API*/ thing_with_backtrace #ifdef HAVE_EXECINFO allocation_backtrace = new void*[50]; allocation_backtrace_size = backtrace (allocation_backtrace, 50); -#else +#else allocation_backtrace_size = 0; #endif Glib::Threads::Mutex::Lock lm (all_mutex); @@ -64,14 +64,14 @@ class /*LIBPBD_API*/ thing_with_backtrace #ifdef HAVE_EXECINFO allocation_backtrace = new void*[50]; allocation_backtrace_size = backtrace (allocation_backtrace, 50); -#else +#else allocation_backtrace_size = 0; #endif Glib::Threads::Mutex::Lock lm (all_mutex); all.push_back (this); } - ~thing_with_backtrace() { + ~thing_with_backtrace() { if (allocation_backtrace_size) { delete [] allocation_backtrace; } @@ -90,9 +90,9 @@ class /*LIBPBD_API*/ thing_with_backtrace for (x = all.begin(); x != all.end(); ++x) { char **strings; size_t i; - + strings = backtrace_symbols ((*x)->allocation_backtrace, (*x)->allocation_backtrace_size); - + if (strings) { stream << "--- ALLOCATED SHARED_PTR @ " << (*x) << std::endl; for (i = 0; i < (*x)->allocation_backtrace_size && i < 50U; i++) { diff --git a/libs/pbd/pbd/stateful.h b/libs/pbd/pbd/stateful.h index ab09b7aa84..48f7f24d9a 100644 --- a/libs/pbd/pbd/stateful.h +++ b/libs/pbd/pbd/stateful.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2010 Paul Davis + Copyright (C) 2000-2010 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -93,7 +93,7 @@ class LIBPBD_API Stateful { virtual void resume_property_changes (); bool property_changes_suspended() const { return g_atomic_int_get (const_cast<gint*>(&_stateful_frozen)) > 0; } - + protected: void add_instant_xml (XMLNode&, const std::string& directory_path); @@ -103,7 +103,7 @@ class LIBPBD_API Stateful { PropertyChange set_values (XMLNode const &); /* derived classes can implement this to do cross-checking - of property values after either a PropertyList or XML + of property values after either a PropertyList or XML driven property change. */ virtual void post_set (const PropertyChange&) { }; diff --git a/libs/pbd/pbd/stateful_diff_command.h b/libs/pbd/pbd/stateful_diff_command.h index 2187c727ed..95ece8732a 100644 --- a/libs/pbd/pbd/stateful_diff_command.h +++ b/libs/pbd/pbd/stateful_diff_command.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2010 Paul Davis + Copyright (C) 2010 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ public: void operator() (); void undo (); - + XMLNode& get_state (); bool empty () const; diff --git a/libs/pbd/pbd/statefuldestructible.h b/libs/pbd/pbd/statefuldestructible.h index 79f5356c9f..501633d517 100644 --- a/libs/pbd/pbd/statefuldestructible.h +++ b/libs/pbd/pbd/statefuldestructible.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ namespace PBD { -class LIBPBD_API StatefulDestructible : public Stateful, public Destructible +class LIBPBD_API StatefulDestructible : public Stateful, public Destructible { }; diff --git a/libs/pbd/pbd/stl_delete.h b/libs/pbd/pbd/stl_delete.h index 1598a90e2c..3e9040bfad 100644 --- a/libs/pbd/pbd/stl_delete.h +++ b/libs/pbd/pbd/stl_delete.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1998-99 Paul Barton-Davis + Copyright (C) 1998-99 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ template<class T> /*LIBPBD_API*/ void vector_delete (std::vector<T *> *vec) #endif // _CPP_VECTOR || _GLIBCXX_VECTOR || __SGI_STL_VECTOR || _LIBCPP_VECTOR #if defined(_CPP_MAP) || defined(_GLIBCXX_MAP) || defined(__SGI_STL_MAP) -template<class K, class T> /*LIBPBD_API*/ void map_delete (std::map<K, T *> *m) +template<class K, class T> /*LIBPBD_API*/ void map_delete (std::map<K, T *> *m) { typename std::map<K, T *>::iterator i; @@ -50,7 +50,7 @@ template<class K, class T> /*LIBPBD_API*/ void map_delete (std::map<K, T *> *m) #endif // _CPP_MAP || _GLIBCXX_MAP || __SGI_STL_MAP #if defined(_CPP_LIST) || defined(_GLIBCXX_LIST) || defined(__SGI_STL_LIST) -template<class T> /*LIBPBD_API*/ void list_delete (std::list<T *> *l) +template<class T> /*LIBPBD_API*/ void list_delete (std::list<T *> *l) { typename std::list<T *>::iterator i; @@ -63,7 +63,7 @@ template<class T> /*LIBPBD_API*/ void list_delete (std::list<T *> *l) #endif // _CPP_LIST || _GLIBCXX_LIST || __SGI_STL_LIST #if defined(_CPP_SLIST) || defined(_GLIBCXX_SLIST) || defined(__SGI_STL_SLIST) -template<class T> /*LIBPBD_API*/ void slist_delete (std::slist<T *> *l) +template<class T> /*LIBPBD_API*/ void slist_delete (std::slist<T *> *l) { typename std::slist<T *>::iterator i; @@ -76,7 +76,7 @@ template<class T> /*LIBPBD_API*/ void slist_delete (std::slist<T *> *l) #endif // _CPP_SLIST || _GLIBCXX_SLIST || __SGI_STL_SLIST #if defined(_CPP_SET) || defined(_GLIBCXX_SET) || defined(__SGI_STL_SET) -template<class T> void /*LIBPBD_API*/ set_delete (std::set<T *> *sset) +template<class T> void /*LIBPBD_API*/ set_delete (std::set<T *> *sset) { typename std::set<T *>::iterator i; diff --git a/libs/pbd/pbd/stl_functors.h b/libs/pbd/pbd/stl_functors.h index 5815dacb05..4976f41b88 100644 --- a/libs/pbd/pbd/stl_functors.h +++ b/libs/pbd/pbd/stl_functors.h @@ -1,6 +1,6 @@ /* Copyright (C) 1998-99 Paul Barton-Davis - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -85,7 +85,7 @@ struct LIBPBD_API equal_to<std::string *> #ifndef LESS_CONST_STRING_R struct LIBPBD_API less<const std::string &> { bool operator() (const std::string &s1, const std::string &s2) { - return s1 < s2; + return s1 < s2; } }; #define LESS_CONST_STRING_R diff --git a/libs/pbd/pbd/strsplit.h b/libs/pbd/pbd/strsplit.h index 045974d00c..707bf680d6 100644 --- a/libs/pbd/pbd/strsplit.h +++ b/libs/pbd/pbd/strsplit.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/textreceiver.h b/libs/pbd/pbd/textreceiver.h index 9fe7e0828d..3fad63f66c 100644 --- a/libs/pbd/pbd/textreceiver.h +++ b/libs/pbd/pbd/textreceiver.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1998-99 Paul Barton-Davis + Copyright (C) 1998-99 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ #include "pbd/libpbd_visibility.h" #include "receiver.h" -class LIBPBD_API TextReceiver : public Receiver +class LIBPBD_API TextReceiver : public Receiver { public: TextReceiver (const std::string &n); diff --git a/libs/pbd/pbd/thrown_error.h b/libs/pbd/pbd/thrown_error.h index be68be918f..d4e5e5a529 100644 --- a/libs/pbd/pbd/thrown_error.h +++ b/libs/pbd/pbd/thrown_error.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1998-99 Paul Barton-Davis + Copyright (C) 1998-99 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/tokenizer.h b/libs/pbd/pbd/tokenizer.h index 3253473519..ef9f3c951e 100644 --- a/libs/pbd/pbd/tokenizer.h +++ b/libs/pbd/pbd/tokenizer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ namespace PBD { */ template<typename StringType, typename Iter> /*LIBPBD_API*/ unsigned int -tokenize(const StringType& str, +tokenize(const StringType& str, const StringType& delims, Iter it, bool strip_whitespace=false) diff --git a/libs/pbd/pbd/touchable.h b/libs/pbd/pbd/touchable.h index 297be8b0f1..797260882a 100644 --- a/libs/pbd/pbd/touchable.h +++ b/libs/pbd/pbd/touchable.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1999 Paul Barton-Davis + Copyright (C) 1999 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -40,7 +40,7 @@ template<class T> class /*LIBPBD_API*/ DynamicTouchable : public Touchable { public: - DynamicTouchable (T& t, void (T::*m)(void)) + DynamicTouchable (T& t, void (T::*m)(void)) : object (t), method (m) { set_delete_after_touch (true); } void touch () { @@ -56,7 +56,7 @@ template<class T1, class T2> class /*LIBPBD_API*/ DynamicTouchable1 : public Touchable { public: - DynamicTouchable1 (T1& t, void (T1::*m)(T2), T2 a) + DynamicTouchable1 (T1& t, void (T1::*m)(T2), T2 a) : object (t), method (m), arg (a) { set_delete_after_touch (true); } void touch () { @@ -73,7 +73,7 @@ template<class T1, class T2, class T3> class /*LIBPBD_API*/ DynamicTouchable2 : public Touchable { public: - DynamicTouchable2 (T1& t, void (T1::*m)(T2, T3), T2 a1, T3 a2) + DynamicTouchable2 (T1& t, void (T1::*m)(T2, T3), T2 a1, T3 a2) : object (t), method (m), arg1 (a1), arg2 (a2) { set_delete_after_touch (true); } void touch () { diff --git a/libs/pbd/pbd/transmitter.h b/libs/pbd/pbd/transmitter.h index d77fca8da3..cf1e587dfd 100644 --- a/libs/pbd/pbd/transmitter.h +++ b/libs/pbd/pbd/transmitter.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1998-99 Paul Barton-Davis + Copyright (C) 1998-99 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ class LIBPBD_API Transmitter : public std::stringstream Transmitter (Channel); - sigc::signal<void,Channel, const char *> &sender() { + sigc::signal<void,Channel, const char *> &sender() { return *send; } @@ -62,7 +62,7 @@ class LIBPBD_API Transmitter : public std::stringstream }; /* for EGCS 2.91.66, if this function is not compiled within the same - compilation unit as the one where a ThrownError is thrown, then + compilation unit as the one where a ThrownError is thrown, then nothing will catch the error. This is a pretty small function, so inlining it here seems like a reasonable workaround. */ diff --git a/libs/pbd/pbd/undo.h b/libs/pbd/pbd/undo.h index 794e68ce97..f248b8b657 100644 --- a/libs/pbd/pbd/undo.h +++ b/libs/pbd/pbd/undo.h @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2002 Brett Viren & Paul Davis This program is free software; you can redistribute it and/or modify @@ -99,7 +99,7 @@ class LIBPBD_API UndoHistory : public PBD::ScopedConnectionList If depth==0 it returns just the top node. If depth<0, it returns everything. If depth>0, it returns state for that - many elements of the history, or + many elements of the history, or the full history, whichever is smaller. */ diff --git a/libs/pbd/pbd/unknown_type.h b/libs/pbd/pbd/unknown_type.h index ef9db1ac43..17809f1d2a 100644 --- a/libs/pbd/pbd/unknown_type.h +++ b/libs/pbd/pbd/unknown_type.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/unwind.h b/libs/pbd/pbd/unwind.h index 5a0fe26559..1e84d21b29 100644 --- a/libs/pbd/pbd/unwind.h +++ b/libs/pbd/pbd/unwind.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/uuid_boost.h b/libs/pbd/pbd/uuid_boost.h index 0219603723..77e84c5f09 100644 --- a/libs/pbd/pbd/uuid_boost.h +++ b/libs/pbd/pbd/uuid_boost.h @@ -32,11 +32,11 @@ namespace PBD { class LIBPBD_API UUID : public boost::uuids::uuid { public: - UUID () + UUID () : boost::uuids::uuid (boost::uuids::random_generator()()) {} UUID (std::string const & str) : boost::uuids::uuid (boost::uuids::string_generator()(str)) {} - + explicit UUID (boost::uuids::uuid const& u) : boost::uuids::uuid(u) {} @@ -44,14 +44,14 @@ class LIBPBD_API UUID : public boost::uuids::uuid { operator boost::uuids::uuid() { return static_cast<boost::uuids::uuid&>(*this); } - + operator boost::uuids::uuid() const { return static_cast<boost::uuids::uuid const&>(*this); } UUID& operator= (std::string const & str); std::string to_s () const; - + operator bool() const { return !is_nil(); } }; diff --git a/libs/pbd/pbd/whitespace.h b/libs/pbd/pbd/whitespace.h index 5816b84cae..6ce0a7edc6 100644 --- a/libs/pbd/pbd/whitespace.h +++ b/libs/pbd/pbd/whitespace.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h index e6795e5d45..396280921c 100644 --- a/libs/pbd/pbd/xml++.h +++ b/libs/pbd/pbd/xml++.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Paul Davis + Copyright (C) 2012 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/pool.cc b/libs/pbd/pool.cc index 1fc0949eba..ef14cd0a75 100644 --- a/libs/pbd/pool.cc +++ b/libs/pbd/pool.cc @@ -1,6 +1,6 @@ /* Copyright (C) 1998-99 Paul Barton-Davis - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -43,7 +43,7 @@ Pool::Pool (string n, unsigned long item_size, unsigned long nitems) /* since some overloaded ::operator new() might use this, its important that we use a "lower level" allocator to - get more space. + get more space. */ block = malloc (nitems * item_size); @@ -99,7 +99,7 @@ Pool::release (void *ptr) /*---------------------------------------------*/ -MultiAllocSingleReleasePool::MultiAllocSingleReleasePool (string n, unsigned long isize, unsigned long nitems) +MultiAllocSingleReleasePool::MultiAllocSingleReleasePool (string n, unsigned long isize, unsigned long nitems) : Pool (n, isize, nitems) { } @@ -108,7 +108,7 @@ MultiAllocSingleReleasePool::~MultiAllocSingleReleasePool () { } -SingleAllocMultiReleasePool::SingleAllocMultiReleasePool (string n, unsigned long isize, unsigned long nitems) +SingleAllocMultiReleasePool::SingleAllocMultiReleasePool (string n, unsigned long isize, unsigned long nitems) : Pool (n, isize, nitems) { } @@ -147,7 +147,7 @@ SingleAllocMultiReleasePool::release (void* ptr) /*-------------------------------------------------------*/ -static void +static void free_per_thread_pool (void* ptr) { /* Rather than deleting the CrossThreadPool now, we add it to our trash buffer. @@ -170,7 +170,7 @@ free_per_thread_pool (void* ptr) cp->parent()->add_to_trash (cp); } } - + PerThreadPool::PerThreadPool () : _key (free_per_thread_pool) , _trash (0) @@ -264,7 +264,7 @@ CrossThreadPool::flush_pending () DEBUG_TRACE (DEBUG::Pool, string_compose ("%1 %2 has %3 pending free entries waiting, status size %4 free %5 used %6\n", pthread_name(), name(), pending.read_space(), total(), available(), used())); - + while (pending.read (&ptr, 1) == 1) { DEBUG_TRACE (DEBUG::Pool, string_compose ("%1 %2 pushes back a pending free list entry before allocating\n", pthread_name(), name())); free_list.write (&ptr, 1); @@ -277,7 +277,7 @@ CrossThreadPool::flush_pending () } void* -CrossThreadPool::alloc () +CrossThreadPool::alloc () { /* process anything waiting to be deleted (i.e. moved back to the free list) */ flush_pending (); @@ -286,7 +286,7 @@ CrossThreadPool::alloc () } void -CrossThreadPool::push (void* t) +CrossThreadPool::push (void* t) { pending.write (&t, 1); } diff --git a/libs/pbd/property_list.cc b/libs/pbd/property_list.cc index efae95e45e..c2cf4a0b86 100644 --- a/libs/pbd/property_list.cc +++ b/libs/pbd/property_list.cc @@ -24,8 +24,8 @@ using namespace PBD; -PropertyList::PropertyList() - : _property_owner (true) +PropertyList::PropertyList() + : _property_owner (true) { } @@ -57,7 +57,7 @@ PropertyList::get_changes_as_xml (XMLNode* history_node) { for (const_iterator i = begin(); i != end(); ++i) { DEBUG_TRACE (DEBUG::Properties, string_compose ("Add changes to %1 for %2\n", - history_node->name(), + history_node->name(), i->second->property_name())); i->second->get_changes_as_xml (history_node); } diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc index b8ca8fc093..190a229fb8 100644 --- a/libs/pbd/pthread_utils.cc +++ b/libs/pbd/pthread_utils.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002 Paul Davis + Copyright (C) 2002 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -68,7 +68,7 @@ struct ThreadStartWithName { void* (*thread_work)(void*); void* arg; std::string name; - + ThreadStartWithName (void* (*f)(void*), void* a, const std::string& s) : thread_work (f), arg (a), name (s) {} }; @@ -110,7 +110,7 @@ fake_thread_start (void* arg) return ret; } -int +int pthread_create_and_store (string name, pthread_t *thread, void * (*start_routine)(void *), void * arg) { pthread_attr_t default_attr; @@ -148,12 +148,12 @@ pthread_name () if (str) { return str; - } + } return "unknown"; } void -pthread_kill_all (int signum) +pthread_kill_all (int signum) { pthread_mutex_lock (&thread_map_lock); for (ThreadMap::iterator i = all_threads.begin(); i != all_threads.end(); ++i) { @@ -166,7 +166,7 @@ pthread_kill_all (int signum) } void -pthread_cancel_all () +pthread_cancel_all () { pthread_mutex_lock (&thread_map_lock); @@ -186,7 +186,7 @@ pthread_cancel_all () } void -pthread_cancel_one (pthread_t thread) +pthread_cancel_one (pthread_t thread) { pthread_mutex_lock (&thread_map_lock); for (ThreadMap::iterator i = all_threads.begin(); i != all_threads.end(); ++i) { diff --git a/libs/pbd/receiver.cc b/libs/pbd/receiver.cc index c9df4595db..b0655721ad 100644 --- a/libs/pbd/receiver.cc +++ b/libs/pbd/receiver.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 1998-99 Paul Barton-Davis + Copyright (C) 1998-99 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/search_path.cc b/libs/pbd/search_path.cc index 1d931a546d..337be399e3 100644 --- a/libs/pbd/search_path.cc +++ b/libs/pbd/search_path.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2007 Tim Mayberry + Copyright (C) 2007 Tim Mayberry This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -155,7 +155,7 @@ Searchpath& Searchpath::add_subdirectory_to_paths (const string& subdir) { for (vector<std::string>::iterator i = begin(); i != end(); ++i) { - // should these new paths just be added to the end of + // should these new paths just be added to the end of // the search path rather than replace? *i = Glib::build_filename (*i, subdir); } @@ -167,7 +167,7 @@ Searchpath::add_subdirectory_to_paths (const string& subdir) * whole idea, and we put it here for convenience. */ -void +void export_search_path (const string& base_dir, const char* varname, const char* dir) { string path; diff --git a/libs/pbd/shortpath.cc b/libs/pbd/shortpath.cc index 22636f5db9..d2d5addc94 100644 --- a/libs/pbd/shortpath.cc +++ b/libs/pbd/shortpath.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/signals.cc b/libs/pbd/signals.cc index ff535603ef..e01351a867 100644 --- a/libs/pbd/signals.cc +++ b/libs/pbd/signals.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Paul Davis + Copyright (C) 2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/stacktrace.cc b/libs/pbd/stacktrace.cc index 181b7d18e7..db27fd54df 100644 --- a/libs/pbd/stacktrace.cc +++ b/libs/pbd/stacktrace.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ PBD::trace_twb () #include <execinfo.h> #include <cxxabi.h> -static std::string +static std::string symbol_demangle (const std::string& l) { int status; @@ -63,7 +63,7 @@ symbol_demangle (const std::string& l) return l; } -std::string +std::string PBD::demangle (std::string const & l) { std::string::size_type const b = l.find_first_of ("("); @@ -93,12 +93,12 @@ PBD::stacktrace (std::ostream& out, int levels) size_t size; char **strings; size_t i; - + size = backtrace (array, 200); if (size) { strings = backtrace_symbols (array, size); - + if (strings) { for (i = 0; i < size && (levels == 0 || i < size_t(levels)); i++) { @@ -127,7 +127,7 @@ extern "C" { } #endif -std::string +std::string PBD::demangle (std::string const & l) /* JE - !!!! 'PBD' namespace might possibly get removed (except it's still used in 'libs/canvas/item.cc') */ { return std::string(); @@ -177,7 +177,7 @@ c_stacktrace () #else -std::string +std::string PBD::demangle (std::string const & l) /* JE - !!!! 'PBD' namespace might possibly get removed (except it's still used in 'libs/canvas/item.cc') */ { return std::string(); diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc index c4077f60af..476fdcc28f 100644 --- a/libs/pbd/stateful.cc +++ b/libs/pbd/stateful.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2001 Paul Davis + Copyright (C) 2000-2001 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,7 +56,7 @@ Stateful::~Stateful () { delete _properties; - // Do not delete _extra_xml. The use of add_child_nocopy() + // Do not delete _extra_xml. The use of add_child_nocopy() // means it needs to live on indefinately. delete _instant_xml; @@ -85,7 +85,7 @@ Stateful::extra_xml (const string& str, bool add_if_missing) if (!node && add_if_missing) { node = new XMLNode (str); add_extra_xml (*node); - } + } return node; } @@ -93,7 +93,7 @@ Stateful::extra_xml (const string& str, bool add_if_missing) void Stateful::save_extra_xml (const XMLNode& node) { - /* Looks for the child node called "Extra" and makes _extra_xml + /* Looks for the child node called "Extra" and makes _extra_xml point to a copy of it. Will delete any existing node pointed to by _extra_xml if a new Extra node is found, but not otherwise. @@ -131,11 +131,11 @@ Stateful::add_instant_xml (XMLNode& node, const std::string& directory_path) /* Important: the destructor for an XMLTree deletes all of its nodes, starting at _root. We therefore - cannot simply hand it our persistent _instant_xml + cannot simply hand it our persistent _instant_xml node as its _root, because we will lose it whenever the Tree goes out of scope. - So instead, copy the _instant_xml node (which does + So instead, copy the _instant_xml node (which does a deep copy), and hand that to the tree. */ @@ -322,7 +322,7 @@ Stateful::resume_property_changes () } bool -Stateful::changed() const +Stateful::changed() const { for (OwnedPropertyList::const_iterator i = _properties->begin(); i != _properties->end(); ++i) { if (i->second->changed()) { @@ -376,16 +376,16 @@ Stateful::clear_owned_changes () i->second->clear_owned_changes (); } } - + bool -Stateful::set_id (const XMLNode& node) +Stateful::set_id (const XMLNode& node) { const XMLProperty* prop; if ((prop = node.property ("id")) != 0) { _id = prop->value (); return true; - } + } return false; } diff --git a/libs/pbd/stateful_diff_command.cc b/libs/pbd/stateful_diff_command.cc index 9e22f2bc64..f7fcd65098 100644 --- a/libs/pbd/stateful_diff_command.cc +++ b/libs/pbd/stateful_diff_command.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2010 Paul Davis + Copyright (C) 2010 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -111,7 +111,7 @@ StatefulDiffCommand::get_state () XMLNode* changes = new XMLNode (X_("Changes")); _changes->get_changes_as_xml (changes); - + node->add_child_nocopy (*changes); return *node; diff --git a/libs/pbd/strreplace.cc b/libs/pbd/strreplace.cc index e043b9f54e..a2e8bdca9c 100644 --- a/libs/pbd/strreplace.cc +++ b/libs/pbd/strreplace.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ int replace_all (std::string& str, std::string const& target, - std::string const& replacement) + std::string const& replacement) { std::string::size_type start = str.find (target, 0); int cnt = 0; diff --git a/libs/pbd/strsplit.cc b/libs/pbd/strsplit.cc index f82abf4c92..c99b55f0a4 100644 --- a/libs/pbd/strsplit.cc +++ b/libs/pbd/strsplit.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/system_exec.cc b/libs/pbd/system_exec.cc index abe5fd2108..f2007a71da 100644 --- a/libs/pbd/system_exec.cc +++ b/libs/pbd/system_exec.cc @@ -256,7 +256,7 @@ SystemExec::make_argp_escaped(std::string command, const std::map<char, std::str switch (c) { case ' ' : case '"' : arg += c; break; // "\\", "\" at end-of-string => "\" - case '\0': + case '\0': case '\\': arg += '\\'; break; default : arg += '\\'; arg += c; break; } diff --git a/libs/pbd/test/xpath.cc b/libs/pbd/test/xpath.cc index 4d6f260c27..70240d3d69 100644 --- a/libs/pbd/test/xpath.cc +++ b/libs/pbd/test/xpath.cc @@ -32,7 +32,7 @@ XPathTest::testMisc () assert((*i)->property("name")); // cout << "Found bank number " << counter++ << " with name: " << (*i)->property("name")->value() << endl; for(XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) { -// cout << "\t found program " << (*j)->property("id")->value() << +// cout << "\t found program " << (*j)->property("id")->value() << // " with name: " << (*j)->property("name")->value() << endl; } } @@ -43,7 +43,7 @@ XPathTest::testMisc () assert(result->size() == 5); for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { -// cout << "\t found program " << (*i)->property("id")->value() << +// cout << "\t found program " << (*i)->property("id")->value() << // " with name: " << (*i)->property("name")->value() << endl; } @@ -58,7 +58,7 @@ XPathTest::testMisc () assert(result->size() == 16); for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { -// cout << "\t found source '" << (*i)->property("name")->value() << +// cout << "\t found source '" << (*i)->property("name")->value() << // "' with id: " << (*i)->property("id")->value() << endl; } @@ -69,8 +69,8 @@ XPathTest::testMisc () for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { assert((*i)->property("id")); assert((*i)->property("name")); -// cout << "\t found element '" << (*i)->name() << -// "' with id: " << (*i)->property("id")->value() << +// cout << "\t found element '" << (*i)->name() << +// "' with id: " << (*i)->property("id")->value() << // "' and name: " << (*i)->property("name")->value() << endl; } @@ -88,7 +88,7 @@ XPathTest::testMisc () // cout << "\t found Patchbank " << (*i)->property("Name")->value() << endl; boost::shared_ptr<XMLSharedNodeList> patches = doc3.find ("//Patch[@Name]", i->get()); for(XMLSharedNodeList::const_iterator p = patches->begin(); p != patches->end(); ++p) { -// cout << "\t\t found patch number " << (*p)->property("Number")->value() +// cout << "\t\t found patch number " << (*p)->property("Number")->value() // << " with name: " << (*p)->property("Name")->value() << endl; } } @@ -98,7 +98,7 @@ XPathTest::testMisc () for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { boost::shared_ptr<XMLNode> node = (*i); -// cout << "\t found attribute node: " << node->name() +// cout << "\t found attribute node: " << node->name() // << " value: " << node->attribute_value() << endl; } @@ -109,7 +109,7 @@ XPathTest::testMisc () assert(result->size() == 15); for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { boost::shared_ptr<XMLNode> node = (*i); -// cout << "\t found available Channel: " << node->name() +// cout << "\t found available Channel: " << node->name() // << " value: " << node->attribute_value() << endl; } diff --git a/libs/pbd/textreceiver.cc b/libs/pbd/textreceiver.cc index 19c84c6b14..6326a33934 100644 --- a/libs/pbd/textreceiver.cc +++ b/libs/pbd/textreceiver.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 1998-99 Paul Barton-Davis + Copyright (C) 1998-99 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/libs/pbd/transmitter.cc b/libs/pbd/transmitter.cc index e4266d34d7..7df370e803 100644 --- a/libs/pbd/transmitter.cc +++ b/libs/pbd/transmitter.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 1998-99 Paul Barton-Davis + Copyright (C) 1998-99 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ Transmitter::deliver () /* NOTE: this is just a default action for a Transmitter or a derived class. Any class can override this to produce some - other action when deliver() is called. + other action when deliver() is called. */ *this << '\0'; @@ -98,7 +98,7 @@ Transmitter::deliver () * provides some time for the user to see the message. */ #endif - } + } } bool @@ -115,7 +115,7 @@ Transmitter::does_not_return () extern "C" { void pbd_c_error (const char *str) - + { PBD::error << str << endmsg; } diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc index 182773ee49..ee5c56f3a5 100644 --- a/libs/pbd/undo.cc +++ b/libs/pbd/undo.cc @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2001 Brett Viren & Paul Davis This program is free software; you can redistribute it and/or modify @@ -51,7 +51,7 @@ UndoTransaction::~UndoTransaction () clear (); } -void +void command_death (UndoTransaction* ut, Command* c) { if (ut->clearing()) { @@ -65,7 +65,7 @@ command_death (UndoTransaction* ut, Command* c) } } -UndoTransaction& +UndoTransaction& UndoTransaction::operator= (const UndoTransaction& rhs) { if (this == &rhs) return *this; @@ -152,12 +152,12 @@ XMLNode &UndoTransaction::get_state() class UndoRedoSignaller { public: - UndoRedoSignaller (UndoHistory& uh) - : _history (uh) { - _history.BeginUndoRedo(); + UndoRedoSignaller (UndoHistory& uh) + : _history (uh) { + _history.BeginUndoRedo(); } - ~UndoRedoSignaller() { - _history.EndUndoRedo(); + ~UndoRedoSignaller() { + _history.EndUndoRedo(); } private: @@ -333,7 +333,7 @@ UndoHistory::clear () Changed (); /* EMIT SIGNAL */ } -XMLNode& +XMLNode& UndoHistory::get_state (int32_t depth) { XMLNode *node = new XMLNode ("UndoHistory"); diff --git a/libs/pbd/whitespace.cc b/libs/pbd/whitespace.cc index 00d47523db..fa4a94b995 100644 --- a/libs/pbd/whitespace.cc +++ b/libs/pbd/whitespace.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,11 +25,11 @@ namespace PBD { void strip_whitespace_edges (string& str) -{ - string::size_type i; - string::size_type len; +{ + string::size_type i; + string::size_type len; string::size_type s = 0; - + len = str.length(); if (len == 1) { @@ -37,7 +37,7 @@ strip_whitespace_edges (string& str) } /* strip front */ - + for (i = 0; i < len; ++i) { if (!isspace (str[i])) { break; @@ -51,16 +51,16 @@ strip_whitespace_edges (string& str) } /* strip back */ - + if (len > 1) { - + s = i; i = len - 1; if (s == i) { return; } - + do { if (!isspace (str[i]) || i == 0) { break; @@ -68,8 +68,8 @@ strip_whitespace_edges (string& str) --i; - } while (true); - + } while (true); + str = str.substr (s, (i - s) + 1); } else { diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index 5fb777bdc7..5667e933a5 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -262,7 +262,7 @@ XMLNode::clear_lists () _proplist.clear (); } -XMLNode& +XMLNode& XMLNode::operator= (const XMLNode& from) { if (&from != this) { |