diff options
author | Robin Gareus <robin@gareus.org> | 2015-10-05 16:17:49 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-10-05 16:17:49 +0200 |
commit | 22b07e0233a29d9633ffa825a79503befaf2e16e (patch) | |
tree | 1d8b06056f8e12197158f5d906319767d3dedda5 /libs/pbd | |
parent | e11ba7b79d68bc1070b170236c22123966d7bcc3 (diff) |
NOOP, remove trailing tabs/whitespace.
Diffstat (limited to 'libs/pbd')
78 files changed, 298 insertions, 298 deletions
diff --git a/libs/pbd/base_ui.cc b/libs/pbd/base_ui.cc index 1b48a19eff..09dfa74785 100644 --- a/libs/pbd/base_ui.cc +++ b/libs/pbd/base_ui.cc @@ -42,7 +42,7 @@ using namespace std; using namespace PBD; using namespace Glib; - + uint64_t BaseUI::rt_bit = 1; BaseUI::RequestType BaseUI::CallSlot = BaseUI::new_request_type(); BaseUI::RequestType BaseUI::Quit = BaseUI::new_request_type(); @@ -91,7 +91,7 @@ BaseUI::signal_running () { Glib::Threads::Mutex::Lock lm (_run_lock); _running.signal (); - + return false; // don't call it again } @@ -130,7 +130,7 @@ BaseUI::request_handler (Glib::IOCondition ioc) if (ioc & IO_IN) { request_channel.drain (); - + /* there may been an error. we'd rather handle requests first, and then get IO_HUP or IO_ERR on the next loop. */ diff --git a/libs/pbd/boost_debug.cc b/libs/pbd/boost_debug.cc index 9d152a6f86..e1c6571f9c 100644 --- a/libs/pbd/boost_debug.cc +++ b/libs/pbd/boost_debug.cc @@ -64,7 +64,7 @@ Backtrace::print (std::ostream& str) const if (size) { #ifdef HAVE_EXECINFO strings = ::backtrace_symbols (trace, size); -#endif +#endif if (strings) { for (i = 3; i < 5+18 && i < size; i++) { str << strings[i] << std::endl; @@ -151,7 +151,7 @@ is_interesting_object (void const* ptr) if (ptr == 0) { return false; } - + return interesting_pointers().find (ptr) != interesting_pointers().end(); } @@ -194,10 +194,10 @@ 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 - << " (total sp's = " << sptrs().size() << ')' << endl; + << " (total sp's = " << sptrs().size() << ')' << endl; } PointerMap::iterator x = sptrs().find (sp); - + if (x != sptrs().end()) { sptrs().erase (x); if (debug_out) { @@ -214,11 +214,11 @@ boost_debug_shared_ptr_operator_equals (void const *sp, void const *old_obj, int newpair.second = new SPDebug (new Backtrace()); 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 - << " (total sp's = " << sptrs().size() << ')' << endl; + << " (total sp's = " << sptrs().size() << ')' << endl; cerr << *newpair.second << endl; } } @@ -242,10 +242,10 @@ 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 - << " (total sp's = " << sptrs().size() << ')' << endl; + << " (total sp's = " << sptrs().size() << ')' << endl; } PointerMap::iterator x = sptrs().find (sp); - + if (x != sptrs().end()) { sptrs().erase (x); if (debug_out) { @@ -262,11 +262,11 @@ boost_debug_shared_ptr_reset (void const *sp, void const *old_obj, int old_use_c newpair.second = new SPDebug (new Backtrace()); 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 - << " (total sp's = " << sptrs().size() << ')' << endl; + << " (total sp's = " << sptrs().size() << ')' << endl; cerr << *newpair.second << endl; } } diff --git a/libs/pbd/controllable_descriptor.cc b/libs/pbd/controllable_descriptor.cc index c3c0752c84..0228d004e4 100644 --- a/libs/pbd/controllable_descriptor.cc +++ b/libs/pbd/controllable_descriptor.cc @@ -35,14 +35,14 @@ ControllableDescriptor::set (const std::string& str) string front = str.substr (0, first_space); string back = str.substr (first_space); - vector<string> path; + vector<string> path; split (front, path, '/'); if (path.size() < 2) { return -1; } - vector<string> rest; + vector<string> rest; split (back, rest, ' '); if (rest.size() < 1) { @@ -106,7 +106,7 @@ ControllableDescriptor::set (const std::string& str) return -1; } } else if (path[1] == "send") { - + if (path.size() == 3 && rest.size() == 2) { if (path[2] == "gain") { _subtype = SendGain; @@ -118,7 +118,7 @@ ControllableDescriptor::set (const std::string& str) return -1; } } - + return 0; } @@ -127,7 +127,7 @@ ControllableDescriptor::rid() const { if (banked()) { return _rid + _bank_offset; - } + } return _rid; } @@ -138,6 +138,6 @@ 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 8653b504e9..660891076d 100644 --- a/libs/pbd/convert.cc +++ b/libs/pbd/convert.cc @@ -132,7 +132,7 @@ short_version (string orig, string::size_type target_length) } /* whatever the length is now, use it */ - + return orig; } @@ -187,9 +187,9 @@ int_from_hex (char hic, char loc) } else if( ('A'<=hi) && (hi<='F') ) { hi -= ('A'-10); } - + lo = (int) loc; - + if( ('0'<=lo) && (lo<='9') ) { lo -= '0'; } else if( ('a'<=lo) && (lo<='f') ) { @@ -249,14 +249,14 @@ length2string (const int64_t frames, const double sample_rate) secs -= (hrs * 3600LL); int64_t mins = secs / 60LL; secs -= (mins * 60LL); - + int64_t total_secs = (hrs * 3600LL) + (mins * 60LL) + secs; int64_t frames_remaining = (int64_t) floor (frames - (total_secs * sample_rate)); float fractional_secs = (float) frames_remaining / sample_rate; - + char duration_str[64]; sprintf (duration_str, "%02" PRIi64 ":%02" PRIi64 ":%05.2f", hrs, mins, (float) secs + fractional_secs); - + return duration_str; } diff --git a/libs/pbd/crossthread.posix.cc b/libs/pbd/crossthread.posix.cc index 5e743ba557..e3f6df5a31 100644 --- a/libs/pbd/crossthread.posix.cc +++ b/libs/pbd/crossthread.posix.cc @@ -16,7 +16,7 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking) error << "cannot set non-blocking mode for x-thread pipe (read) (" << ::strerror (errno) << ')' << endmsg; return; } - + if (fcntl (fds[1], F_SETFL, O_NONBLOCK)) { error << "cannot set non-blocking mode for x-thread pipe (write) (%2)" << ::strerror (errno) << ')' << endmsg; return; diff --git a/libs/pbd/crossthread.win.cc b/libs/pbd/crossthread.win.cc index 69d744e81d..5eca5fb4e8 100644 --- a/libs/pbd/crossthread.win.cc +++ b/libs/pbd/crossthread.win.cc @@ -43,7 +43,7 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking) // make the socket non-blockable if required u_long mode = (u_long)non_blocking; int otp_result = 0; - + otp_result = ioctlsocket(send_socket, FIONBIO, &mode); if (otp_result != NO_ERROR) { std::cerr << "CrossThreadChannel::CrossThreadChannel() Send socket cannot be set to non blocking mode with error: " << WSAGetLastError() << std::endl; @@ -72,10 +72,10 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking) std::cerr << "CrossThreadChannel::CrossThreadChannel() Setting receive socket address to local failed with error: " << WSAGetLastError() << std::endl; return; } - + // construct IOChannel receive_channel = g_io_channel_win32_new_socket((gint)receive_socket); - + // set binary data type GIOStatus g_status = g_io_channel_set_encoding (receive_channel, NULL, NULL); if (G_IO_STATUS_NORMAL != g_status ) { @@ -104,7 +104,7 @@ CrossThreadChannel::wakeup () { char c = 0; - // write one byte to wake up a thread which is listening our IOS + // write one byte to wake up a thread which is listening our IOS sendto(send_socket, &c, sizeof(c), 0, (SOCKADDR*)&recv_address, sizeof(recv_address) ); } @@ -125,7 +125,7 @@ CrossThreadChannel::drain () if (G_IO_STATUS_NORMAL != g_status) { std::cerr << "CrossThreadChannel::CrossThreadChannel() Cannot drain from read buffer! " << g_status << std::endl; - + if (g_error) { std::cerr << "Error is Domain: " << g_error->domain << " Code: " << g_error->code << std::endl; g_clear_error(&g_error); @@ -184,7 +184,7 @@ CrossThreadChannel::receive (char& msg, bool wait) return -1; } } - + // fetch the message from the channel. GIOStatus g_status = g_io_channel_read_chars (receive_channel, &msg, sizeof(msg), &read, &g_error); diff --git a/libs/pbd/debug.cc b/libs/pbd/debug.cc index 8ceea3f1af..af8cd052cd 100644 --- a/libs/pbd/debug.cc +++ b/libs/pbd/debug.cc @@ -115,9 +115,9 @@ PBD::parse_debug_options (const char* str) } } } - + debug_bits = bits; - + return 0; } diff --git a/libs/pbd/enumwriter.cc b/libs/pbd/enumwriter.cc index 50507972c2..ddc8215194 100644 --- a/libs/pbd/enumwriter.cc +++ b/libs/pbd/enumwriter.cc @@ -41,7 +41,7 @@ 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())) { if(::toupper(*it1) != ::toupper(*it2)) {//letters differ? // return -1 to indicate 'smaller than', 1 otherwise @@ -97,7 +97,7 @@ EnumWriter::register_distinct (string type, vector<int> v, vector<string> s) newpair.first = type; newpair.second = EnumRegistration (v, s, false); - + result = registry.insert (newpair); if (!result.second) { @@ -113,7 +113,7 @@ EnumWriter::register_bits (string type, vector<int> v, vector<string> s) newpair.first = type; newpair.second = EnumRegistration (v, s, true); - + result = registry.insert (newpair); if (!result.second) { @@ -153,7 +153,7 @@ EnumWriter::read (string type, string value) } else { return read_distinct (x->second, value); } -} +} string EnumWriter::write_bits (EnumRegistration& er, int value) @@ -263,7 +263,7 @@ EnumWriter::read_bits (EnumRegistration& er, string str) } do { - + comma = str.find_first_of (','); string segment = str.substr (0, comma); diff --git a/libs/pbd/epa.cc b/libs/pbd/epa.cc index cfc5692138..4af2029308 100644 --- a/libs/pbd/epa.cc +++ b/libs/pbd/epa.cc @@ -144,12 +144,12 @@ EnvironmentalProtectionAgency::clear () const for (vector<string>::const_iterator e = ecopy.begin(); e != ecopy.end(); ++e) { string::size_type equal = (*e).find_first_of ('='); - + if (equal == string::npos) { /* say what? an environ value without = ? */ continue; } - + string var_name = (*e).substr (0, equal); g_unsetenv(var_name.c_str()); } diff --git a/libs/pbd/event_loop.cc b/libs/pbd/event_loop.cc index 6506c18be9..d3f2fe5038 100644 --- a/libs/pbd/event_loop.cc +++ b/libs/pbd/event_loop.cc @@ -66,7 +66,7 @@ EventLoop::invalidate_request (void* data) * want, and many of the objects we want to do this with already * inherit (indirectly) from sigc::trackable. */ - + if (ir->event_loop) { Glib::Threads::Mutex::Lock lm (ir->event_loop->slot_invalidation_mutex()); for (list<BaseRequestObject*>::iterator i = ir->requests.begin(); i != ir->requests.end(); ++i) { diff --git a/libs/pbd/ffs.cc b/libs/pbd/ffs.cc index 48a417c4f5..1ca913c54c 100644 --- a/libs/pbd/ffs.cc +++ b/libs/pbd/ffs.cc @@ -31,7 +31,7 @@ ffs (int x) return __builtin_ffs(x); #elif defined (COMPILER_MSVC) unsigned long index; -#ifdef WIN64 +#ifdef WIN64 if (0 != _BitScanForward64(&index, (__int64)x)) #else if (0 != _BitScanForward(&index, (unsigned long)x)) diff --git a/libs/pbd/fpu.cc b/libs/pbd/fpu.cc index 7812ad6696..9838b4565b 100644 --- a/libs/pbd/fpu.cc +++ b/libs/pbd/fpu.cc @@ -172,9 +172,9 @@ FPU::FPU () info << string_compose (_("CPU vendor: %1"), cpu_vendor) << endmsg; if (num_ids > 0) { - + /* Now get CPU/FPU flags */ - + __cpuid (cpu_info, 1); if ((cpu_info[2] & (1<<27)) /* OSXSAVE */ && @@ -193,11 +193,11 @@ FPU::FPU () } /* Figure out CPU/FPU denormal handling capabilities */ - + if (cpu_info[3] & (1 << 24)) { - + char** fxbuf = 0; - + /* DAZ wasn't available in the first version of SSE. Since setting a reserved bit in MXCSR causes a general protection fault, we need to be able to check the availability of this @@ -226,10 +226,10 @@ FPU::FPU () assert (fxbuf); (void) posix_memalign ((void **) fxbuf, 16, 512); assert (*fxbuf); -#endif - +#endif + memset (*fxbuf, 0, 512); - + #ifdef COMPILER_MSVC char *buf = *fxbuf; __asm { @@ -244,19 +244,19 @@ FPU::FPU () : "memory" ); #endif - + uint32_t mxcsr_mask = *((uint32_t*) &((*fxbuf)[28])); - + /* if the mask is zero, set its default value (from intel specs) */ - + if (mxcsr_mask == 0) { mxcsr_mask = 0xffbf; } - + if (mxcsr_mask & (1<<6)) { _flags = Flags (_flags | HasDenormalsAreZero); } - + #if !defined HAVE_POSIX_MEMALIGN && defined PLATFORM_WINDOWS _aligned_free (*fxbuf); _aligned_free (fxbuf); @@ -272,10 +272,10 @@ FPU::FPU () const int parameter_end = 0x80000004; string cpu_brand; - + if (cpu_info[0] >= parameter_end) { char* cpu_string_ptr = cpu_string; - + for (int parameter = 0x80000002; parameter <= parameter_end && cpu_string_ptr < &cpu_string[sizeof(cpu_string)]; parameter++) { __cpuid(cpu_info, parameter); @@ -287,7 +287,7 @@ FPU::FPU () } } #endif /* !ARCH_X86 */ -} +} FPU::~FPU () { diff --git a/libs/pbd/id.cc b/libs/pbd/id.cc index c9823f0dc8..9a610c7418 100644 --- a/libs/pbd/id.cc +++ b/libs/pbd/id.cc @@ -61,7 +61,7 @@ ID::reset () { Glib::Threads::Mutex::Lock lm (*counter_lock); _id = _counter++; -} +} int ID::string_assign (string str) diff --git a/libs/pbd/malign.cc b/libs/pbd/malign.cc index 14fa9ea66c..c48544d160 100644 --- a/libs/pbd/malign.cc +++ b/libs/pbd/malign.cc @@ -62,7 +62,7 @@ int cache_aligned_malloc (void** memptr, size_t size) } return 0; -#endif +#endif } void cache_aligned_free (void* memptr) @@ -101,7 +101,7 @@ int aligned_malloc (void** memptr, size_t size, size_t alignment) } return 0; -#endif +#endif } void aligned_free (void* memptr) diff --git a/libs/pbd/md5.cc b/libs/pbd/md5.cc index 2fd7ab11da..ae3631bfd2 100644 --- a/libs/pbd/md5.cc +++ b/libs/pbd/md5.cc @@ -182,7 +182,7 @@ char* MD5::digestFile (char *filename) { Init(); - + FILE *file; int len; unsigned char buffer[1024]; @@ -226,9 +226,9 @@ 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]; - + Decode (x, block, 64); - + /* Round 1 */ FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ @@ -246,7 +246,7 @@ MD5::Transform (uint32_t state[4], uint8_t const * block) FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ - + /* Round 2 */ GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ @@ -264,7 +264,7 @@ MD5::Transform (uint32_t state[4], uint8_t const * block) GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ - + /* Round 3 */ HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ @@ -334,7 +334,7 @@ void MD5::Decode (uint32_t *output, uint8_t const * input, size_t len) { size_t i, j; - + for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j+1]) << 8) | (((uint32_t)input[j+2]) << 16) | (((uint32_t)input[j+3]) << 24); diff --git a/libs/pbd/mountpoint.cc b/libs/pbd/mountpoint.cc index 4867d3675c..82aaadb9eb 100644 --- a/libs/pbd/mountpoint.cc +++ b/libs/pbd/mountpoint.cc @@ -50,7 +50,7 @@ mountpoint (string path) unsigned int matchlen; const char *cpath = path.c_str(); char best[PATH_MAX+1]; - + if ((mntf = setmntent ("/etc/mtab", "r")) == 0) { return ""; } @@ -122,10 +122,10 @@ mountpoint (string path) unsigned int matchlen; 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 application." - + Thus: we do NOT try to free memory allocated by getmntinfo() */ @@ -163,13 +163,13 @@ mountpoint (string path) } } } - + return best; } #endif // HAVE_GETMNTENT #ifdef TEST_MOUNTPOINT - + main (int argc, char *argv[]) { printf ("mp of %s = %s\n", argv[1], mountpoint (argv[1]).c_str()); diff --git a/libs/pbd/msvc/getopt_long.c b/libs/pbd/msvc/getopt_long.c index bf10e5df58..609d0ef5f4 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; } @@ -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, diff --git a/libs/pbd/pathexpand.cc b/libs/pbd/pathexpand.cc index 805e0b85cd..a92005a086 100644 --- a/libs/pbd/pathexpand.cc +++ b/libs/pbd/pathexpand.cc @@ -69,7 +69,7 @@ realpath (const char *original_path, char resolved_path[_MAX_PATH+1]) // possibly need to add that functionality here at a later date. } else { char temp[(_MAX_PATH+1)*6]; // Allow for maximum length of a path in wchar characters - + // POSIX 'realpath()' requires that the buffer size is at // least PATH_MAX+1, so assume that the user knew this !! @@ -78,9 +78,9 @@ realpath (const char *original_path, char resolved_path[_MAX_PATH+1]) if (0 != rpath) { snprintf (resolved_path, _MAX_PATH+1, "%s", Glib::locale_to_utf8 (temp).c_str()); } - + } - + return (rpath); } @@ -129,7 +129,7 @@ PBD::path_expand (string path) regex_t compiled_pattern; const int nmatches = 100; regmatch_t matches[nmatches]; - + if (regcomp (&compiled_pattern, "\\$([a-zA-Z_][a-zA-Z0-9_]*|\\{[a-zA-Z_][a-zA-Z0-9_]*\\})", REG_EXTENDED)) { std::cerr << "bad regcomp\n"; return path; @@ -140,11 +140,11 @@ PBD::path_expand (string path) if (regexec (&compiled_pattern, path.c_str(), nmatches, matches, 0)) { break; } - + /* matches[0] gives the entire match */ - + string match = path.substr (matches[0].rm_so, matches[0].rm_eo - matches[0].rm_so); - + /* try to get match from the environment */ if (match[1] == '{') { diff --git a/libs/pbd/pbd.cc b/libs/pbd/pbd.cc index 229dc04f32..13383c27d1 100644 --- a/libs/pbd/pbd.cc +++ b/libs/pbd/pbd.cc @@ -101,7 +101,7 @@ PBD::init () /* Initialize windows socket DLL for PBD::CrossThreadChannel */ - + if (WSAStartup(MAKEWORD(1,1),&wsaData) != 0) { fatal << X_("Windows socket initialization failed with error: ") << WSAGetLastError() << endmsg; abort(); @@ -141,7 +141,7 @@ PBD::cleanup () #ifdef PLATFORM_WINDOWS PBD::MMCSS::deinitialize (); WSACleanup(); -#endif +#endif EnumWriter::destroy (); FPU::destroy (); diff --git a/libs/pbd/pbd/abstract_ui.cc b/libs/pbd/pbd/abstract_ui.cc index d2f8840b90..323435bdd9 100644 --- a/libs/pbd/pbd/abstract_ui.cc +++ b/libs/pbd/pbd/abstract_ui.cc @@ -43,7 +43,7 @@ template<typename RequestBuffer> void cleanup_request_buffer (void* ptr) { RequestBuffer* rb = (RequestBuffer*) ptr; - + /* this is called when the thread for which this request buffer was * allocated dies. That could be before or after the end of the UI * event loop for which this request buffer provides communication. @@ -54,7 +54,7 @@ cleanup_request_buffer (void* ptr) * a request. If the UI has finished processing requests, then * we will leak this buffer object. */ - + rb->dead = true; } @@ -127,7 +127,7 @@ AbstractUI<RequestObject>::register_thread (string target_gui, pthread_t thread_ when the thread exits, and ensures that the buffer is marked dead. it will then be deleted during a call to handle_ui_requests() */ - + per_thread_request_buffer.set (b); } @@ -229,7 +229,7 @@ AbstractUI<RequestObject>::handle_ui_requests () ++tmp; request_buffers.erase (i); i = tmp; - } else { + } else { ++i; } } @@ -264,7 +264,7 @@ AbstractUI<RequestObject>::handle_ui_requests () if (req->invalidation) { DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2 remove request from its invalidation list\n", name(), pthread_name())); - + /* after this call, if the object referenced by the * invalidation record is deleted, it will no longer * try to mark the request as invalid. @@ -283,7 +283,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 * threads since they have their own queue) from making requests. @@ -328,7 +328,7 @@ AbstractUI<RequestObject>::send_request (RequestObject *req) DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2 direct dispatch of request type %3\n", name(), pthread_name(), req->type)); do_request (req); delete req; - } else { + } else { /* If called from a different thread, we first check to see if * the calling thread is registered with this UI. If so, there @@ -374,7 +374,7 @@ AbstractUI<RequestObject>::call_slot (InvalidationRecord* invalidation, const bo } RequestObject *req = get_request (BaseUI::CallSlot); - + if (req == 0) { return; } @@ -384,7 +384,7 @@ AbstractUI<RequestObject>::call_slot (InvalidationRecord* invalidation, const bo /* copy semantics: copy the functor into the request object */ req->the_slot = f; - + /* the invalidation record is an object which will carry out * invalidation of any requests associated with it when it is * destroyed. it can be null. if its not null, associate this @@ -401,5 +401,5 @@ AbstractUI<RequestObject>::call_slot (InvalidationRecord* invalidation, const bo } send_request (req); -} +} diff --git a/libs/pbd/pbd/abstract_ui.h b/libs/pbd/pbd/abstract_ui.h index 060d05d37f..5491210db7 100644 --- a/libs/pbd/pbd/abstract_ui.h +++ b/libs/pbd/pbd/abstract_ui.h @@ -92,10 +92,10 @@ class ABSTRACT_UI_API AbstractUI : public BaseUI RequestBufferMap request_buffers; static Glib::Threads::Private<RequestBuffer> per_thread_request_buffer; - + Glib::Threads::Mutex request_list_lock; std::list<RequestObject*> request_list; - + RequestObject* get_request (RequestType); void handle_ui_requests (); void send_request (RequestObject *); diff --git a/libs/pbd/pbd/atomic_counter.h b/libs/pbd/pbd/atomic_counter.h index 019ff857f4..4b8c2e857a 100644 --- a/libs/pbd/pbd/atomic_counter.h +++ b/libs/pbd/pbd/atomic_counter.h @@ -63,7 +63,7 @@ public: { return g_atomic_int_dec_and_test (&m_value); } - + bool operator-- () { return decrement_and_test (); diff --git a/libs/pbd/pbd/base_ui.h b/libs/pbd/pbd/base_ui.h index eddaf862c5..ec2cf33678 100644 --- a/libs/pbd/pbd/base_ui.h +++ b/libs/pbd/pbd/base_ui.h @@ -57,7 +57,7 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop std::string name() const { return _name; } bool ok() const { return _ok; } - + static RequestType new_request_type(); static RequestType CallSlot; static RequestType Quit; diff --git a/libs/pbd/pbd/command.h b/libs/pbd/pbd/command.h index 9feac6366a..337140e786 100644 --- a/libs/pbd/pbd/command.h +++ b/libs/pbd/pbd/command.h @@ -34,13 +34,13 @@ public: virtual ~Command() { /* NOTE: derived classes must call drop_references() */ } virtual void operator() () = 0; - + void set_name (const std::string& str) { _name = str; } const std::string& name() const { return _name; } virtual void undo() = 0; virtual void redo() { (*this)(); } - + virtual XMLNode &get_state(); virtual int set_state(const XMLNode&, int /*version*/) { /* noop */ return 0; } diff --git a/libs/pbd/pbd/compose.h b/libs/pbd/pbd/compose.h index 768820b61a..231afa583e 100644 --- a/libs/pbd/pbd/compose.h +++ b/libs/pbd/pbd/compose.h @@ -174,7 +174,7 @@ namespace StringPrivate } ++arg_no; - + return *this; } @@ -194,7 +194,7 @@ namespace StringPrivate else if (is_number(fmt[i + 1])) { // aha! a spec! // save string output.push_back(fmt.substr(b, i - b)); - + int n = 1; // number of digits int spec_no = 0; @@ -207,9 +207,9 @@ namespace StringPrivate spec_no /= 10; output_list::iterator pos = output.end(); --pos; // safe since we have just inserted a string> - + specs.insert(specification_map::value_type(spec_no, pos)); - + // jump over spec string i += n; b = i; diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h index 257fe8dcab..235c4ce904 100644 --- a/libs/pbd/pbd/controllable.h +++ b/libs/pbd/pbd/controllable.h @@ -90,7 +90,7 @@ class LIBPBD_API Controllable : public PBD::StatefulDestructible { static PBD::Signal1<void,PBD::Controllable*> StopLearning; static PBD::Signal1<void,Controllable*> Destroyed; - + PBD::Signal0<void> Changed; int set_state (const XMLNode&, int version); diff --git a/libs/pbd/pbd/crossthread.h b/libs/pbd/pbd/crossthread.h index d9b80db48c..e87879e4a3 100644 --- a/libs/pbd/pbd/crossthread.h +++ b/libs/pbd/pbd/crossthread.h @@ -50,11 +50,11 @@ public: */ CrossThreadChannel(bool non_blocking); ~CrossThreadChannel(); - + /** Tell the listening thread that is has work to do. */ void wakeup(); - + /* if the listening thread cares about the precise message * it is being sent, then ::deliver() can be used to send * a single byte message rather than a simple wakeup. These diff --git a/libs/pbd/pbd/debug_rt_alloc.h b/libs/pbd/pbd/debug_rt_alloc.h index 0d1b4bd47c..43f62bd7da 100644 --- a/libs/pbd/pbd/debug_rt_alloc.h +++ b/libs/pbd/pbd/debug_rt_alloc.h @@ -34,7 +34,7 @@ LIBPBD_API extern int (*pbd_alloc_allowed) (); /** Call this to suspend malloc checking until a call to resume_rt_malloc_checks */ LIBPBD_API extern void suspend_rt_malloc_checks (); -/** Resume malloc checking after a suspension */ +/** Resume malloc checking after a suspension */ LIBPBD_API extern void resume_rt_malloc_checks (); } diff --git a/libs/pbd/pbd/destructible.h b/libs/pbd/pbd/destructible.h index 0c401a947f..261697cafa 100644 --- a/libs/pbd/pbd/destructible.h +++ b/libs/pbd/pbd/destructible.h @@ -29,7 +29,7 @@ class LIBPBD_API Destructible { public: Destructible() {} virtual ~Destructible () { Destroyed(); } - + PBD::Signal0<void> Destroyed; PBD::Signal0<void> DropReferences; diff --git a/libs/pbd/pbd/enumwriter.h b/libs/pbd/pbd/enumwriter.h index 405a187817..6f2333277d 100644 --- a/libs/pbd/pbd/enumwriter.h +++ b/libs/pbd/pbd/enumwriter.h @@ -40,7 +40,7 @@ class LIBPBD_API unknown_enumeration : public std::exception { } ~unknown_enumeration () throw() {} - + virtual const char *what() const throw() { return _message.c_str(); } diff --git a/libs/pbd/pbd/epa.h b/libs/pbd/pbd/epa.h index 89c085a5bc..8727fad08e 100644 --- a/libs/pbd/pbd/epa.h +++ b/libs/pbd/pbd/epa.h @@ -41,7 +41,7 @@ class LIBPBD_API EnvironmentalProtectionAgency { private: void clear () const; - + bool _armed; std::string _envname; std::map<std::string,std::string> e; diff --git a/libs/pbd/pbd/fastlog.h b/libs/pbd/pbd/fastlog.h index 21cbfbdce2..80b02e9522 100644 --- a/libs/pbd/pbd/fastlog.h +++ b/libs/pbd/pbd/fastlog.h @@ -25,9 +25,9 @@ static inline float fast_log2 (float val) x &= ~(255 << 23); x += 127 << 23; *exp_ptr = x; - + val = ((-1.0f/3) * t.f + 2) * t.f - 2.0f/3; - + return (val + log_2); } diff --git a/libs/pbd/pbd/fpu.h b/libs/pbd/pbd/fpu.h index 8be9e1a35b..045b633812 100644 --- a/libs/pbd/pbd/fpu.h +++ b/libs/pbd/pbd/fpu.h @@ -39,13 +39,13 @@ class LIBPBD_API FPU { static FPU* instance(); static void destroy(); - + bool has_flush_to_zero () const { return _flags & HasFlushToZero; } bool has_denormals_are_zero () const { return _flags & HasDenormalsAreZero; } bool has_sse () const { return _flags & HasSSE; } bool has_sse2 () const { return _flags & HasSSE2; } bool has_avx () const { return _flags & HasAVX; } - + private: Flags _flags; diff --git a/libs/pbd/pbd/functor_command.h b/libs/pbd/pbd/functor_command.h index 68092a77bb..9fc35ee138 100644 --- a/libs/pbd/pbd/functor_command.h +++ b/libs/pbd/pbd/functor_command.h @@ -71,7 +71,7 @@ class /*LIBPBD_API*/ FunctorCommand : public Command virtual XMLNode &get_state() { std::stringstream ss; - + XMLNode *node = new XMLNode("FunctorCommand"); node->add_property("type_name", typeid(obj_type).name()); node->add_property("functor", functor_name); diff --git a/libs/pbd/pbd/id.h b/libs/pbd/pbd/id.h index 05ac69e26d..1f33e6d732 100644 --- a/libs/pbd/pbd/id.h +++ b/libs/pbd/pbd/id.h @@ -56,7 +56,7 @@ class LIBPBD_API ID { void print (char* buf, uint32_t bufsize) const; std::string to_s() const; - + static uint64_t counter() { return _counter; } static void init_counter (uint64_t val) { _counter = val; } static void init (); diff --git a/libs/pbd/pbd/md5.h b/libs/pbd/pbd/md5.h index 8a5ee71aab..a02013eb72 100644 --- a/libs/pbd/pbd/md5.h +++ b/libs/pbd/pbd/md5.h @@ -32,14 +32,14 @@ class LIBPBD_API MD5 { public: MD5(); - + // an MD5 digest is a 16-byte number (32 hex digits) uint8_t digestRaw[16] ; - + // This version of the digest is actually // a "printf'd" version of the digest. char digestChars[33] ; - + void writeToString (); char* digestFile (char *filename); char* digestMemory (uint8_t const * memchunk, size_t len); @@ -53,14 +53,14 @@ class LIBPBD_API MD5 }; context_t context; - + void Init (); 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 Final (); - + }; #endif /* __libpbd_md5_h__ */ diff --git a/libs/pbd/pbd/memento_command.h b/libs/pbd/pbd/memento_command.h index 437f58631d..b6e0bc9cf3 100644 --- a/libs/pbd/pbd/memento_command.h +++ b/libs/pbd/pbd/memento_command.h @@ -84,7 +84,7 @@ public: void add_state (XMLNode* node) { node->add_property ("obj_id", _object.id().to_s()); } - + void object_died () { /* The object we are binding died, so drop references to ourselves */ this->drop_references (); @@ -116,7 +116,7 @@ public: /* The binder's object died, so we must die */ _binder->DropReferences.connect_same_thread (_binder_death_connection, boost::bind (&MementoCommand::binder_dying, this)); } - + ~MementoCommand () { drop_references (); delete before; @@ -152,13 +152,13 @@ public: XMLNode* node = new XMLNode(name); _binder->add_state (node); - + node->add_property ("type_name", _binder->type_name ()); if (before) { node->add_child_copy(*before); } - + if (after) { node->add_child_copy(*after); } diff --git a/libs/pbd/pbd/pool.h b/libs/pbd/pbd/pool.h index 8aff60fb6a..edc247332e 100644 --- a/libs/pbd/pbd/pool.h +++ b/libs/pbd/pbd/pool.h @@ -39,12 +39,12 @@ class LIBPBD_API Pool virtual void *alloc (); virtual void release (void *); - + std::string name() const { return _name; } guint available() const { return free_list.read_space(); } guint used() const { return free_list.bufsize() - available(); } guint total() const { return free_list.bufsize(); } - + protected: RingBuffer<void*> free_list; ///< a list of pointers to free items within block std::string _name; diff --git a/libs/pbd/pbd/properties.h b/libs/pbd/pbd/properties.h index f67fe50413..0ba42b8e55 100644 --- a/libs/pbd/pbd/properties.h +++ b/libs/pbd/pbd/properties.h @@ -99,7 +99,7 @@ public: /* MANAGEMENT OF Stateful State */ - + bool set_value (XMLNode const & node) { XMLProperty const* p = node.property (property_name()); @@ -120,9 +120,9 @@ public: node.add_property (property_name(), to_string (_current)); } - + /* MANAGEMENT OF HISTORY */ - + void clear_changes () { _have_old = false; } @@ -137,7 +137,7 @@ public: /* TRANSFERRING HISTORY TO / FROM A StatefulDiffCommand */ - + void get_changes_as_xml (XMLNode* history_node) const { XMLNode* node = history_node->add_child (property_name()); node->add_property ("from", to_string (_old)); @@ -225,7 +225,7 @@ public: Property<T>* clone () const { return new Property<T> (this->property_id(), this->_old, this->_current); } - + Property<T>* clone_from_xml (const XMLNode& node) const { XMLNodeList const & children = node.children (); XMLNodeList::const_iterator i = children.begin(); @@ -238,11 +238,11 @@ public: } XMLProperty* from = (*i)->property ("from"); XMLProperty* to = (*i)->property ("to"); - + if (!from || !to) { return 0; } - + return new Property<T> (this->property_id(), from_string (from->value()), from_string (to->value ())); } @@ -295,7 +295,7 @@ public: Property (PropertyDescriptor<std::string> d, std::string const & o, std::string const & c) : PropertyTemplate<std::string> (d, o, c) {} - + Property<std::string>* clone () const { return new Property<std::string> (this->property_id(), _old, _current); } @@ -356,12 +356,12 @@ class /*LIBPBD_API*/ SharedStatefulProperty : public PropertyBase { public: typedef boost::shared_ptr<T> Ptr; - + SharedStatefulProperty (PropertyID d, Ptr p) : PropertyBase (d) , _current (p) { - + } SharedStatefulProperty (PropertyID d, Ptr o, Ptr c) @@ -369,7 +369,7 @@ public: , _old (o) , _current (c) { - + } bool set_value (XMLNode const & node) { diff --git a/libs/pbd/pbd/property_basics.h b/libs/pbd/pbd/property_basics.h index c4e4549ecd..88f94fe211 100644 --- a/libs/pbd/pbd/property_basics.h +++ b/libs/pbd/pbd/property_basics.h @@ -32,7 +32,7 @@ class Command; namespace PBD { class LIBPBD_API PropertyList; -class LIBPBD_API StatefulDiffCommand; +class LIBPBD_API StatefulDiffCommand; /** A unique identifier for a property of a Stateful object */ typedef GQuark PropertyID; @@ -41,7 +41,7 @@ template<typename T> struct LIBPBD_TEMPLATE_API PropertyDescriptor { PropertyDescriptor () : property_id (0) {} PropertyDescriptor (PropertyID pid) : property_id (pid) {} - + PropertyID property_id; typedef T value_type; }; @@ -121,7 +121,7 @@ public: /** Invert the changes in this property */ virtual void invert () = 0; - + /* TRANSFERRING HISTORY TO / FROM A StatefulDiffCommand */ @@ -129,7 +129,7 @@ public: * StatefulDiffCommand node. */ virtual void get_changes_as_xml (XMLNode *) const = 0; - + /** If this Property has changed, clone it and add it to a given list. * Used for making StatefulDiffCommands. */ @@ -145,7 +145,7 @@ public: /* VARIOUS */ - + virtual PropertyBase* clone () const = 0; /** Set this property's current state from another */ @@ -158,12 +158,12 @@ public: return _property_id == pid; } -protected: +protected: /* copy construction only by subclasses */ PropertyBase (PropertyBase const & b) : _property_id (b._property_id) {} - + private: PropertyID _property_id; diff --git a/libs/pbd/pbd/property_list.h b/libs/pbd/pbd/property_list.h index 28b60b521e..9373d2c281 100644 --- a/libs/pbd/pbd/property_list.h +++ b/libs/pbd/pbd/property_list.h @@ -29,7 +29,7 @@ class XMLNode; namespace PBD { -/** A list of properties, mapped using their ID */ +/** A list of properties, mapped using their ID */ class LIBPBD_API PropertyList : public std::map<PropertyID, PropertyBase*> { public: diff --git a/libs/pbd/pbd/receiver.h b/libs/pbd/pbd/receiver.h index 2919063cbe..e7f3f25b0b 100644 --- a/libs/pbd/pbd/receiver.h +++ b/libs/pbd/pbd/receiver.h @@ -34,7 +34,7 @@ class LIBPBD_API Receiver : public sigc::trackable public: Receiver (); virtual ~Receiver (); - + void listen_to (Transmitter &); void hangup (); diff --git a/libs/pbd/pbd/ringbuffer.h b/libs/pbd/pbd/ringbuffer.h index 935beb0469..58c463ecbe 100644 --- a/libs/pbd/pbd/ringbuffer.h +++ b/libs/pbd/pbd/ringbuffer.h @@ -39,7 +39,7 @@ class /*LIBPBD_API*/ RingBuffer buf = new T[size]; reset (); } - + virtual ~RingBuffer() { delete [] buf; } @@ -55,7 +55,7 @@ class /*LIBPBD_API*/ RingBuffer g_atomic_int_set (&write_idx, w); g_atomic_int_set (&read_idx, r); } - + guint read (T *dest, guint cnt); guint write (T const * src, guint cnt); @@ -66,7 +66,7 @@ class /*LIBPBD_API*/ RingBuffer void get_read_vector (rw_vector *); void get_write_vector (rw_vector *); - + void decrement_read_idx (guint cnt) { g_atomic_int_set (&read_idx, (g_atomic_int_get(&read_idx) - cnt) & size_mask); } @@ -81,10 +81,10 @@ class /*LIBPBD_API*/ RingBuffer guint write_space () const { guint w, r; - + w = g_atomic_int_get (&write_idx); r = g_atomic_int_get (&read_idx); - + if (w > r) { return ((r - w + size) & size_mask) - 1; } else if (w < r) { @@ -93,13 +93,13 @@ class /*LIBPBD_API*/ RingBuffer return size - 1; } } - + guint read_space () const { guint w, r; - + w = g_atomic_int_get (&write_idx); r = g_atomic_int_get (&read_idx); - + if (w > r) { return w - r; } else { @@ -206,10 +206,10 @@ RingBuffer<T>::get_read_vector (typename RingBuffer<T>::rw_vector *vec) guint free_cnt; guint cnt2; guint w, r; - + w = g_atomic_int_get (&write_idx); r = g_atomic_int_get (&read_idx); - + if (w > r) { free_cnt = w - r; } else { @@ -230,9 +230,9 @@ RingBuffer<T>::get_read_vector (typename RingBuffer<T>::rw_vector *vec) vec->len[1] = cnt2 & size_mask; } else { - + /* Single part vector: just the rest of the buffer */ - + vec->buf[0] = &buf[r]; vec->len[0] = free_cnt; vec->buf[1] = 0; @@ -247,10 +247,10 @@ RingBuffer<T>::get_write_vector (typename RingBuffer<T>::rw_vector *vec) guint free_cnt; guint cnt2; guint w, r; - + w = g_atomic_int_get (&write_idx); r = g_atomic_int_get (&read_idx); - + if (w > r) { free_cnt = ((r - w + size) & size_mask) - 1; } else if (w < r) { @@ -258,11 +258,11 @@ RingBuffer<T>::get_write_vector (typename RingBuffer<T>::rw_vector *vec) } else { free_cnt = size - 1; } - + cnt2 = w + free_cnt; if (cnt2 > size) { - + /* Two part vector: the rest of the buffer after the 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 e700e89d2e..f01a6f3a16 100644 --- a/libs/pbd/pbd/ringbufferNPT.h +++ b/libs/pbd/pbd/ringbufferNPT.h @@ -40,7 +40,7 @@ class /*LIBPBD_API*/ RingBufferNPT buf = new T[size]; reset (); } - + virtual ~RingBufferNPT () { delete [] buf; } @@ -56,7 +56,7 @@ class /*LIBPBD_API*/ RingBufferNPT g_atomic_int_set (&write_ptr, w); g_atomic_int_set (&read_ptr, r); } - + size_t read (T *dest, size_t cnt); size_t write (const T *src, size_t cnt); @@ -67,7 +67,7 @@ class /*LIBPBD_API*/ RingBufferNPT void get_read_vector (rw_vector *); void get_write_vector (rw_vector *); - + void decrement_read_ptr (size_t cnt) { g_atomic_int_set (&read_ptr, (g_atomic_int_get(&read_ptr) - cnt) % size); } @@ -82,10 +82,10 @@ class /*LIBPBD_API*/ RingBufferNPT size_t write_space () { size_t w, r; - + w = g_atomic_int_get (&write_ptr); r = g_atomic_int_get (&read_ptr); - + if (w > r) { return ((r - w + size) % size) - 1; } else if (w < r) { @@ -94,13 +94,13 @@ class /*LIBPBD_API*/ RingBufferNPT return size - 1; } } - + size_t read_space () { size_t w, r; - + w = g_atomic_int_get (&write_ptr); r = g_atomic_int_get (&read_ptr); - + if (w > r) { return w - r; } else { @@ -204,10 +204,10 @@ RingBufferNPT<T>::get_read_vector (typename RingBufferNPT<T>::rw_vector *vec) size_t free_cnt; size_t cnt2; size_t w, r; - + w = g_atomic_int_get (&write_ptr); r = g_atomic_int_get (&read_ptr); - + if (w > r) { free_cnt = w - r; } else { @@ -228,9 +228,9 @@ RingBufferNPT<T>::get_read_vector (typename RingBufferNPT<T>::rw_vector *vec) vec->len[1] = cnt2 % size; } else { - + /* Single part vector: just the rest of the buffer */ - + vec->buf[0] = &buf[r]; vec->len[0] = free_cnt; vec->buf[1] = 0; @@ -244,10 +244,10 @@ RingBufferNPT<T>::get_write_vector (typename RingBufferNPT<T>::rw_vector *vec) size_t free_cnt; size_t cnt2; size_t w, r; - + w = g_atomic_int_get (&write_ptr); r = g_atomic_int_get (&read_ptr); - + if (w > r) { free_cnt = ((r - w + size) % size) - 1; } else if (w < r) { @@ -255,11 +255,11 @@ RingBufferNPT<T>::get_write_vector (typename RingBufferNPT<T>::rw_vector *vec) } else { free_cnt = size - 1; } - + cnt2 = w + free_cnt; if (cnt2 > size) { - + /* Two part vector: the rest of the buffer after the 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 9f0d407751..41b1ffee55 100644 --- a/libs/pbd/pbd/search_path.h +++ b/libs/pbd/pbd/search_path.h @@ -86,12 +86,12 @@ public: * Add another directory path to the search path. */ LIBPBD_TEMPLATE_MEMBER_API Searchpath& operator+= (const std::string& directory_path); - + /** * Concatenate another Searchpath onto this. */ LIBPBD_TEMPLATE_MEMBER_API const Searchpath operator+ (const Searchpath& other); - + /** * Add another path to the search path. */ diff --git a/libs/pbd/pbd/selectable.h b/libs/pbd/pbd/selectable.h index cb4677cba4..ac8f72aa0d 100644 --- a/libs/pbd/pbd/selectable.h +++ b/libs/pbd/pbd/selectable.h @@ -66,7 +66,7 @@ class LIBPBD_API Selectable : public sigc::trackable fromPath, fromFILE }; - + bool _ok; int _type; std::string path; @@ -89,7 +89,7 @@ class LIBPBD_API Selector { void multithreaded (bool yn) { use_list_lock = yn; } - + void add (int condition, Selectable *s); void remove (Selectable *); int select (unsigned long usecs); diff --git a/libs/pbd/pbd/sequence_property.h b/libs/pbd/pbd/sequence_property.h index 5ab938b257..4069340e42 100644 --- a/libs/pbd/pbd/sequence_property.h +++ b/libs/pbd/pbd/sequence_property.h @@ -132,7 +132,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase bool changed () const { return !_changes.added.empty() || !_changes.removed.empty(); } - + void clear_changes () { _changes.added.clear (); _changes.removed.clear (); @@ -158,12 +158,12 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase if (!changed ()) { return; } - + /* Create a property with just the changes and not the actual values */ SequenceProperty<Container>* a = create (); a->_changes = _changes; changes.add (a); - + if (cmd) { /* whenever one of the items emits DropReferences, make sure that the Destructible we've been told to notify hears about @@ -182,7 +182,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase XMLNodeList const children = node.children (); /* find the node for this property name */ - + std::string const c = capitalize (property_name ()); XMLNodeList::const_iterator i = children.begin(); while (i != children.end() && (*i)->name() != c) { @@ -194,7 +194,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase } /* create a property with the changes */ - + SequenceProperty<Container>* p = create (); XMLNodeList const & grandchildren = (*i)->children (); @@ -301,7 +301,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase } _val.clear (); } - + typename Container::size_type size() const { return _val.size(); } @@ -355,12 +355,12 @@ protected: , _changes (p._changes) , _update_callback (p._update_callback) {} - + Container _val; ///< our actual container of things ChangeRecord _changes; ///< changes to the container (adds/removes) that have happened since clear_changes() was last called boost::function<void(const ChangeRecord&)> _update_callback; -private: +private: virtual SequenceProperty<Container>* create () const = 0; }; diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h index cc70d07ca5..97cfa65300 100644 --- a/libs/pbd/pbd/signals.h +++ b/libs/pbd/pbd/signals.h @@ -115,9 +115,9 @@ public: return r; } }; - + typedef boost::shared_ptr<Connection> UnscopedConnection; - + class LIBPBD_API ScopedConnection { public: @@ -139,7 +139,7 @@ public: if (_c == o) { return *this; } - + disconnect (); _c = o; return *this; @@ -148,13 +148,13 @@ public: private: UnscopedConnection _c; }; - + class LIBPBD_API ScopedConnectionList : public boost::noncopyable { public: ScopedConnectionList(); virtual ~ScopedConnectionList (); - + void add_connection (const UnscopedConnection& c); void drop_connections (); @@ -168,7 +168,7 @@ class LIBPBD_API ScopedConnectionList : public boost::noncopyable (1) (unlikely) we make a connection involving a callback on the 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. */ @@ -179,8 +179,8 @@ class LIBPBD_API ScopedConnectionList : public boost::noncopyable ConnectionList _list; }; -#include "pbd/signals_generated.h" - +#include "pbd/signals_generated.h" + } /* namespace */ #endif /* __pbd_signals_h__ */ diff --git a/libs/pbd/pbd/stacktrace.h b/libs/pbd/pbd/stacktrace.h index 754501eea7..17a719e9ae 100644 --- a/libs/pbd/pbd/stacktrace.h +++ b/libs/pbd/pbd/stacktrace.h @@ -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 48f7f24d9a..0d0074210b 100644 --- a/libs/pbd/pbd/stateful.h +++ b/libs/pbd/pbd/stateful.h @@ -52,7 +52,7 @@ class LIBPBD_API Stateful { virtual bool apply_changes (PropertyBase const &); PropertyChange apply_changes (PropertyList const &); - + const OwnedPropertyList& properties() const { return *_properties; } void add_property (PropertyBase& s); @@ -101,7 +101,7 @@ class LIBPBD_API Stateful { void add_properties (XMLNode &); PropertyChange set_values (XMLNode const &); - + /* derived classes can implement this to do cross-checking of property values after either a PropertyList or XML driven property change. diff --git a/libs/pbd/pbd/stateful_diff_command.h b/libs/pbd/pbd/stateful_diff_command.h index 95ece8732a..ce82b5ee74 100644 --- a/libs/pbd/pbd/stateful_diff_command.h +++ b/libs/pbd/pbd/stateful_diff_command.h @@ -29,7 +29,7 @@ namespace PBD { -class StatefulDestructible; +class StatefulDestructible; class PropertyList; /** A Command which stores its action as the differences between the before and after diff --git a/libs/pbd/pbd/stl_delete.h b/libs/pbd/pbd/stl_delete.h index 3e9040bfad..492e9285f9 100644 --- a/libs/pbd/pbd/stl_delete.h +++ b/libs/pbd/pbd/stl_delete.h @@ -29,7 +29,7 @@ template<class T> /*LIBPBD_API*/ void vector_delete (std::vector<T *> *vec) { typename std::vector<T *>::iterator i; - + for (i = vec->begin(); i != vec->end(); i++) { delete *i; } @@ -79,7 +79,7 @@ template<class T> /*LIBPBD_API*/ void slist_delete (std::slist<T *> *l) template<class T> void /*LIBPBD_API*/ set_delete (std::set<T *> *sset) { typename std::set<T *>::iterator i; - + for (i = sset->begin(); i != sset->end(); i++) { delete *i; } diff --git a/libs/pbd/pbd/touchable.h b/libs/pbd/pbd/touchable.h index 797260882a..00c5896663 100644 --- a/libs/pbd/pbd/touchable.h +++ b/libs/pbd/pbd/touchable.h @@ -46,7 +46,7 @@ class /*LIBPBD_API*/ DynamicTouchable : public Touchable void touch () { (object.*method)(); } - + protected: T& object; void (T::*method)(void); @@ -62,7 +62,7 @@ class /*LIBPBD_API*/ DynamicTouchable1 : public Touchable void touch () { (object.*method)(arg); } - + protected: T1& object; void (T1::*method)(T2); @@ -79,12 +79,12 @@ class /*LIBPBD_API*/ DynamicTouchable2 : public Touchable void touch () { (object.*method)(arg1, arg2); } - + protected: T1& object; void (T1::*method)(T2,T3); T2 arg1; T3 arg2; }; - + #endif // __pbd_touchable_h__ diff --git a/libs/pbd/pbd/transmitter.h b/libs/pbd/pbd/transmitter.h index cf1e587dfd..a765f9e370 100644 --- a/libs/pbd/pbd/transmitter.h +++ b/libs/pbd/pbd/transmitter.h @@ -94,7 +94,7 @@ endmsg (std::ostream &ostr) /* hmm. not a Transmitter, so just put a newline on it and assume that that will be enough. */ - + ostr << std::endl; } diff --git a/libs/pbd/pbd/undo.h b/libs/pbd/pbd/undo.h index f248b8b657..01e1972e99 100644 --- a/libs/pbd/pbd/undo.h +++ b/libs/pbd/pbd/undo.h @@ -71,7 +71,7 @@ class LIBPBD_API UndoTransaction : public Command bool _clearing; friend void command_death (UndoTransaction*, Command *); - + void about_to_explicitly_delete (); }; @@ -80,14 +80,14 @@ class LIBPBD_API UndoHistory : public PBD::ScopedConnectionList public: UndoHistory(); ~UndoHistory() {} - + void add (UndoTransaction* ut); void undo (unsigned int n); void redo (unsigned int n); - + unsigned long undo_depth() const { return UndoList.size(); } unsigned long redo_depth() const { return RedoList.size(); } - + std::string next_undo() const { return (UndoList.empty() ? std::string() : UndoList.back()->name()); } std::string next_redo() const { return (RedoList.empty() ? std::string() : RedoList.back()->name()); } @@ -111,7 +111,7 @@ class LIBPBD_API UndoHistory : public PBD::ScopedConnectionList PBD::Signal0<void> Changed; PBD::Signal0<void> BeginUndoRedo; PBD::Signal0<void> EndUndoRedo; - + private: bool _clearing; uint32_t _depth; diff --git a/libs/pbd/pbd/unwind.h b/libs/pbd/pbd/unwind.h index 1e84d21b29..d4c43d05bd 100644 --- a/libs/pbd/pbd/unwind.h +++ b/libs/pbd/pbd/unwind.h @@ -29,7 +29,7 @@ class /*LIBPBD_API*/ Unwinder { public: Unwinder (T& var, T new_val) : _var (var), _old_val (var) { var = new_val; } ~Unwinder () { _var = _old_val; } - + private: T& _var; T _old_val; diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h index 396280921c..8e0e015870 100644 --- a/libs/pbd/pbd/xml++.h +++ b/libs/pbd/pbd/xml++.h @@ -85,7 +85,7 @@ public: private: bool read_internal(bool validate); - + std::string _filename; XMLNode* _root; xmlDocPtr _doc; @@ -121,7 +121,7 @@ public: XMLProperty* property(const std::string&); const XMLProperty* property(const char* n) const { return const_cast<XMLNode*>(this)->property(n); } const XMLProperty* property(const std::string& n) const { return const_cast<XMLNode*>(this)->property(n); } - + XMLProperty* add_property(const char* name, const std::string& value); XMLProperty* add_property(const char* name, const char* value = ""); XMLProperty* add_property(const char* name, const long value); diff --git a/libs/pbd/pool.cc b/libs/pbd/pool.cc index ef14cd0a75..249a31ddb3 100644 --- a/libs/pbd/pool.cc +++ b/libs/pbd/pool.cc @@ -91,7 +91,7 @@ Pool::alloc () } /** Release an item's memory by writing its location to the free list */ -void +void Pool::release (void *ptr) { free_list.write (&ptr, 1); @@ -228,7 +228,7 @@ void PerThreadPool::add_to_trash (CrossThreadPool* p) { Glib::Threads::Mutex::Lock lm (_trash_mutex); - + if (!_trash) { warning << "Pool " << p->name() << " has no trash collector; a memory leak has therefore occurred" << endmsg; return; @@ -237,7 +237,7 @@ PerThreadPool::add_to_trash (CrossThreadPool* p) /* we have a lock here so that multiple threads can safely call add_to_trash (even though there can only be one writer to the _trash RingBuffer) */ - + _trash->write (&p, 1); } @@ -246,7 +246,7 @@ CrossThreadPool::CrossThreadPool (string n, unsigned long isize, unsigned long , pending (nitems) , _parent (p) { - + } void @@ -261,10 +261,10 @@ CrossThreadPool::flush_pending () { void* ptr; bool did_release = false; - + 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); diff --git a/libs/pbd/property_list.cc b/libs/pbd/property_list.cc index c2cf4a0b86..ae8674c97b 100644 --- a/libs/pbd/property_list.cc +++ b/libs/pbd/property_list.cc @@ -27,7 +27,7 @@ using namespace PBD; PropertyList::PropertyList() : _property_owner (true) { - + } PropertyList::PropertyList (PropertyList const & other) diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc index 190a229fb8..1abe6a95fb 100644 --- a/libs/pbd/pthread_utils.cc +++ b/libs/pbd/pthread_utils.cc @@ -137,7 +137,7 @@ void pthread_set_name (const char *str) { /* copy string and delete it when exiting */ - + thread_name.set (strdup (str)); } @@ -154,7 +154,7 @@ pthread_name () void pthread_kill_all (int signum) -{ +{ pthread_mutex_lock (&thread_map_lock); for (ThreadMap::iterator i = all_threads.begin(); i != all_threads.end(); ++i) { if (!pthread_equal ((*i), pthread_self())) { @@ -167,7 +167,7 @@ pthread_kill_all (int signum) void pthread_cancel_all () -{ +{ pthread_mutex_lock (&thread_map_lock); for (ThreadMap::iterator i = all_threads.begin(); i != all_threads.end(); ) { @@ -187,7 +187,7 @@ pthread_cancel_all () void pthread_cancel_one (pthread_t thread) -{ +{ pthread_mutex_lock (&thread_map_lock); for (ThreadMap::iterator i = all_threads.begin(); i != all_threads.end(); ++i) { if (pthread_equal ((*i), thread)) { diff --git a/libs/pbd/search_path.cc b/libs/pbd/search_path.cc index 337be399e3..d1dc8c39f0 100644 --- a/libs/pbd/search_path.cc +++ b/libs/pbd/search_path.cc @@ -159,7 +159,7 @@ Searchpath::add_subdirectory_to_paths (const string& subdir) // the search path rather than replace? *i = Glib::build_filename (*i, subdir); } - + return *this; } diff --git a/libs/pbd/semutils.cc b/libs/pbd/semutils.cc index cf7b54d30e..5d3ef3d958 100644 --- a/libs/pbd/semutils.cc +++ b/libs/pbd/semutils.cc @@ -34,7 +34,7 @@ ProcessSemaphore::ProcessSemaphore (const char* name, int val) } /* this semaphore does not exist for IPC */ - + if (sem_unlink (name)) { throw failed_constructor (); } diff --git a/libs/pbd/shortpath.cc b/libs/pbd/shortpath.cc index d2d5addc94..3d33611b87 100644 --- a/libs/pbd/shortpath.cc +++ b/libs/pbd/shortpath.cc @@ -57,7 +57,7 @@ short_path (const Glib::ustring& path, ustring::size_type target_characters) return path; } } - + uint32_t so_far = (len - last_sep); uint32_t space_for = target_characters - so_far; @@ -71,6 +71,6 @@ short_path (const Glib::ustring& path, ustring::size_type target_characters) res += path.substr (last_sep - space_for, len - last_sep + space_for - 3); res += "..."; return res; - + } } diff --git a/libs/pbd/stacktrace.cc b/libs/pbd/stacktrace.cc index db27fd54df..176c5b8840 100644 --- a/libs/pbd/stacktrace.cc +++ b/libs/pbd/stacktrace.cc @@ -51,13 +51,13 @@ symbol_demangle (const std::string& l) int status; try { - + char* realname = abi::__cxa_demangle (l.c_str(), 0, 0, &status); std::string d (realname); free (realname); return d; } catch (std::exception) { - + } return l; @@ -80,7 +80,7 @@ PBD::demangle (std::string const & l) if ((p - b) <= 1) { return symbol_demangle (l); } - + std::string const fn = l.substr (b + 1, p - b - 1); return symbol_demangle (fn); @@ -100,11 +100,11 @@ PBD::stacktrace (std::ostream& out, int levels) strings = backtrace_symbols (array, size); if (strings) { - + for (i = 0; i < size && (levels == 0 || i < size_t(levels)); i++) { out << " " << demangle (strings[i]) << std::endl; } - + free (strings); } } else { diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc index 476fdcc28f..845d6ba42e 100644 --- a/libs/pbd/stateful.cc +++ b/libs/pbd/stateful.cc @@ -98,7 +98,7 @@ Stateful::save_extra_xml (const XMLNode& node) to by _extra_xml if a new Extra node is found, but not otherwise. */ - + const XMLNode* xtra = node.child ("Extra"); if (xtra) { @@ -125,7 +125,7 @@ Stateful::add_instant_xml (XMLNode& node, const std::string& directory_path) _instant_xml->add_child_copy (node); std::string instant_xml_path = Glib::build_filename (directory_path, "instant.xml"); - + XMLTree tree; tree.set_filename(instant_xml_path); @@ -192,7 +192,7 @@ PropertyList * Stateful::get_changes_as_properties (Command* cmd) const { PropertyList* pl = new PropertyList; - + for (OwnedPropertyList::const_iterator i = _properties->begin(); i != _properties->end(); ++i) { i->second->get_changes_as_properties (*pl, cmd); } @@ -209,7 +209,7 @@ PropertyChange Stateful::set_values (XMLNode const & node) { PropertyChange c; - + for (OwnedPropertyList::iterator i = _properties->begin(); i != _properties->end(); ++i) { if (i->second->set_value (node)) { c.add (i->first); @@ -232,7 +232,7 @@ Stateful::apply_changes (const PropertyList& property_list) for (PropertyList::const_iterator pp = property_list.begin(); pp != property_list.end(); ++pp) { DEBUG_TRACE (DEBUG::Stateful, string_compose ("in plist: %1\n", pp->second->property_name())); } - + for (PropertyList::const_iterator i = property_list.begin(); i != property_list.end(); ++i) { if ((p = _properties->find (i->first)) != _properties->end()) { @@ -240,7 +240,7 @@ Stateful::apply_changes (const PropertyList& property_list) DEBUG::Stateful, string_compose ("actually setting property %1 using %2\n", p->second->property_name(), i->second->property_name()) ); - + if (apply_changes (*i->second)) { c.add (i->first); } @@ -249,7 +249,7 @@ Stateful::apply_changes (const PropertyList& property_list) i->second->property_name())); } } - + post_set (c); send_change (c); diff --git a/libs/pbd/strsplit.cc b/libs/pbd/strsplit.cc index c99b55f0a4..85f0c5c310 100644 --- a/libs/pbd/strsplit.cc +++ b/libs/pbd/strsplit.cc @@ -24,7 +24,7 @@ using namespace Glib; void split (string str, vector<string>& result, char splitchar) -{ +{ string::size_type pos; string remaining; string::size_type len = str.length(); @@ -64,7 +64,7 @@ split (string str, vector<string>& result, char splitchar) void split (ustring str, vector<ustring>& result, char splitchar) -{ +{ ustring::size_type pos; ustring remaining; ustring::size_type len = str.length(); diff --git a/libs/pbd/system_exec.cc b/libs/pbd/system_exec.cc index f2007a71da..d92987bf21 100644 --- a/libs/pbd/system_exec.cc +++ b/libs/pbd/system_exec.cc @@ -648,7 +648,7 @@ SystemExec::terminate () /* if pid is non-zero, the child task is still executing (i.e. it did * not exit in response to stdin being closed). try to kill it. */ - + if (pid) { ::kill(pid, SIGTERM); ::usleep(250000); diff --git a/libs/pbd/test/scalar_properties.cc b/libs/pbd/test/scalar_properties.cc index 3586fc3a95..be8ef20655 100644 --- a/libs/pbd/test/scalar_properties.cc +++ b/libs/pbd/test/scalar_properties.cc @@ -31,7 +31,7 @@ ScalarPropertiesTest::testBasic () _fred.clear_changes (); CPPUNIT_ASSERT (_fred.changed() == false); - + _fred = 5; CPPUNIT_ASSERT (_fred == 5); CPPUNIT_ASSERT (_fred.changed() == true); diff --git a/libs/pbd/test/scalar_properties.h b/libs/pbd/test/scalar_properties.h index 6175aeacfe..d313477659 100644 --- a/libs/pbd/test/scalar_properties.h +++ b/libs/pbd/test/scalar_properties.h @@ -13,7 +13,7 @@ public: void testBasic (); static void make_property_quarks (); - + private: PBD::Property<int> _fred; }; diff --git a/libs/pbd/test/signals_test.cc b/libs/pbd/test/signals_test.cc index fd845c8be1..ab70388760 100644 --- a/libs/pbd/test/signals_test.cc +++ b/libs/pbd/test/signals_test.cc @@ -20,7 +20,7 @@ public: void emit () { Fred (); } - + PBD::Signal0<void> Fred; }; @@ -86,6 +86,6 @@ SignalsTest::testScopedConnectionList () e->emit (); delete r; e->emit (); - + CPPUNIT_ASSERT_EQUAL (1, N); } diff --git a/libs/pbd/test/testrunner.cc b/libs/pbd/test/testrunner.cc index 11f60f46a2..92757eb45d 100644 --- a/libs/pbd/test/testrunner.cc +++ b/libs/pbd/test/testrunner.cc @@ -24,19 +24,19 @@ main () text_receiver.listen_to (PBD::warning); ScalarPropertiesTest::make_property_quarks (); - + CppUnit::TestResult testresult; CppUnit::TestResultCollector collectedresults; testresult.addListener (&collectedresults); - + CppUnit::BriefTestProgressListener progress; testresult.addListener (&progress); - + CppUnit::TestRunner testrunner; testrunner.addTest (CppUnit::TestFactoryRegistry::getRegistry ().makeTest ()); testrunner.run (testresult); - + CppUnit::CompilerOutputter compileroutputter (&collectedresults, std::cerr); compileroutputter.write (); diff --git a/libs/pbd/test/xpath.cc b/libs/pbd/test/xpath.cc index 70240d3d69..2283c946e4 100644 --- a/libs/pbd/test/xpath.cc +++ b/libs/pbd/test/xpath.cc @@ -23,7 +23,7 @@ XPathTest::testMisc () XMLTree doc(testdata_path); // "//bank" gives as last element an empty element libxml bug???? boost::shared_ptr<XMLSharedNodeList> result = doc.find("//bank[@name]"); - + // cout << "Found " << result->size() << " banks" << endl; assert(result->size() == 8); // int counter = 1; @@ -36,19 +36,19 @@ XPathTest::testMisc () // " with name: " << (*j)->property("name")->value() << endl; } } - + // cout << endl << endl << "Test 2: RosegardenPatchFile.xml: Find all programs whose program name contains 'Latin'" << endl; - + result = doc.find("/rosegarden-data/studio/device/bank/program[contains(@name, 'Latin')]"); assert(result->size() == 5); - + for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { // cout << "\t found program " << (*i)->property("id")->value() << // " with name: " << (*i)->property("name")->value() << endl; } // cout << endl << endl << "Test 3: TestSession.ardour: find all Sources where captured-for contains the string 'Guitar'" << endl; - + // We have to allocate a new document here, or we get segfaults std::string testsession_path; CPPUNIT_ASSERT (find_file (test_search_path (), "TestSession.ardour", testsession_path)); @@ -56,16 +56,16 @@ XPathTest::testMisc () XMLTree doc2(testsession_path); result = doc2.find("/Session/Sources/Source[contains(@captured-for, 'Guitar')]"); assert(result->size() == 16); - + for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { // cout << "\t found source '" << (*i)->property("name")->value() << // "' with id: " << (*i)->property("id")->value() << endl; } - + // cout << endl << endl << "Test 4: TestSession.ardour: Find all elements with an 'id' and 'name' attribute" << endl; - + result = doc2.find("//*[@id and @name]"); - + for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { assert((*i)->property("id")); assert((*i)->property("name")); @@ -73,9 +73,9 @@ XPathTest::testMisc () // "' with id: " << (*i)->property("id")->value() << // "' and name: " << (*i)->property("name")->value() << endl; } - + // cout << endl << endl << "Test 5: ProtoolsPatchFile.midnam: Get Banks and Patches for 'Name Set 1'" << endl; - + std::string testmidnam_path; CPPUNIT_ASSERT (find_file (test_search_path (), "ProtoolsPatchFile.midnam", testmidnam_path)); @@ -83,7 +83,7 @@ XPathTest::testMisc () XMLTree doc3(testmidnam_path); result = doc3.find("/MIDINameDocument/MasterDeviceNames/ChannelNameSet[@Name='Name Set 1']/PatchBank"); assert(result->size() == 16); - + for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { // cout << "\t found Patchbank " << (*i)->property("Name")->value() << endl; boost::shared_ptr<XMLSharedNodeList> patches = doc3.find ("//Patch[@Name]", i->get()); @@ -95,22 +95,22 @@ XPathTest::testMisc () // cout << endl << endl << "Test 5: ProtoolsPatchFile.midnam: Find attribute nodes" << endl; result = doc3.find("//@Value"); - + for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { boost::shared_ptr<XMLNode> node = (*i); // cout << "\t found attribute node: " << node->name() // << " value: " << node->attribute_value() << endl; - } - + } + // cout << endl << endl << "Test 6: ProtoolsPatchFile.midnam: Find available channels on 'Name Set 1'" << endl; result = doc3.find( "//ChannelNameSet[@Name = 'Name Set 1']//AvailableChannel[@Available = 'true']/@Channel"); - + 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() // << " value: " << node->attribute_value() << endl; - } - + } + } diff --git a/libs/pbd/textreceiver.cc b/libs/pbd/textreceiver.cc index 6326a33934..3d9ce0f4a2 100644 --- a/libs/pbd/textreceiver.cc +++ b/libs/pbd/textreceiver.cc @@ -58,7 +58,7 @@ TextReceiver::receive (Transmitter::Channel chn, const char *str) /* note: iostreams are already thread-safe: no external lock required. */ - + cout << name << prefix << str << endl; if (chn == Transmitter::Fatal) { diff --git a/libs/pbd/transmitter.cc b/libs/pbd/transmitter.cc index 7df370e803..fccb667b48 100644 --- a/libs/pbd/transmitter.cc +++ b/libs/pbd/transmitter.cc @@ -52,7 +52,7 @@ Transmitter::Transmitter (Channel c) send = 0; break; } -} +} void Transmitter::deliver () @@ -82,12 +82,12 @@ Transmitter::deliver () seekg (0, ios::beg); /* do the right thing if this should not return */ - + if (does_not_return()) { #ifndef PLATFORM_WINDOWS // TODO !!!! Commented out temporarily (for Windows) sigset_t mask; - + sigemptyset (&mask); sigsuspend (&mask); /*NOTREACHED*/ diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc index ee5c56f3a5..a11edbda47 100644 --- a/libs/pbd/undo.cc +++ b/libs/pbd/undo.cc @@ -282,7 +282,7 @@ UndoHistory::redo (unsigned int n) { UndoRedoSignaller exception_safe_signaller (*this); - + while (n--) { if (RedoList.size() == 0) { return; diff --git a/libs/pbd/whitespace.cc b/libs/pbd/whitespace.cc index fa4a94b995..57c133db26 100644 --- a/libs/pbd/whitespace.cc +++ b/libs/pbd/whitespace.cc @@ -22,14 +22,14 @@ using namespace std; namespace PBD { - + void strip_whitespace_edges (string& str) { 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; @@ -60,7 +60,7 @@ strip_whitespace_edges (string& str) if (s == i) { return; } - + do { if (!isspace (str[i]) || i == 0) { break; @@ -69,7 +69,7 @@ strip_whitespace_edges (string& str) --i; } while (true); - + str = str.substr (s, (i - s) + 1); } else { diff --git a/libs/pbd/windows_special_dirs.cc b/libs/pbd/windows_special_dirs.cc index d5138050df..75ec322353 100644 --- a/libs/pbd/windows_special_dirs.cc +++ b/libs/pbd/windows_special_dirs.cc @@ -30,7 +30,7 @@ PBD::get_win_special_folder_path (int csidl) HRESULT hr; LPITEMIDLIST pidl = 0; char *utf8_folder_path = 0; - + if (S_OK == (hr = SHGetSpecialFolderLocation (0, csidl, &pidl))) { if (SHGetPathFromIDListW (pidl, path)) { diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index 5667e933a5..4e566a7800 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -42,7 +42,7 @@ XMLTree::XMLTree(const XMLTree* from) , _doc (xmlCopyDoc (from->_doc, 1)) , _compression(from->compression()) { - + } XMLTree::~XMLTree() @@ -96,7 +96,7 @@ XMLTree::read_internal(bool validate) } else { _doc = xmlParseFile(_filename.c_str()); } - + /* check if parsing suceeded */ if (_doc == NULL) { if (validate) { @@ -117,7 +117,7 @@ XMLTree::read_internal(bool validate) if (validate) { xmlFreeParserCtxt(ctxt); } - + return true; } @@ -271,17 +271,17 @@ XMLNode::operator= (const XMLNode& from) XMLPropertyIterator curprop; XMLNodeList nodes; XMLNodeIterator curnode; - + clear_lists (); _name = from.name(); set_content(from.content()); - + props = from.properties(); for (curprop = props.begin(); curprop != props.end(); ++curprop) { add_property((*curprop)->name().c_str(), (*curprop)->value()); } - + nodes = from.children(); for (curnode = nodes.begin(); curnode != nodes.end(); ++curnode) { add_child_copy(**curnode); @@ -380,10 +380,10 @@ XMLTree::find(const string xpath, XMLNode* node) const } else { ctxt = xmlXPathNewContext(_doc); } - + boost::shared_ptr<XMLSharedNodeList> result = boost::shared_ptr<XMLSharedNodeList>(find_impl(ctxt, xpath)); - + xmlXPathFreeContext(ctxt); if (doc) { xmlFreeDoc (doc); @@ -439,7 +439,7 @@ XMLNode::add_property(const char* n, const string& v) { string ns(n); map<string,XMLProperty*>::iterator iter; - + if ((iter = _propmap.find(ns)) != _propmap.end()) { iter->second->set_value (v); return iter->second; @@ -676,11 +676,11 @@ XMLNode::dump (ostream& s, string p) const s << " " << (*i)->name() << "=\"" << (*i)->value() << "\""; } s << ">\n"; - + for (XMLNodeList::const_iterator i = _children.begin(); i != _children.end(); ++i) { (*i)->dump (s, p + " "); } - + s << p << "</" << _name << ">\n"; } } |