From: Arvin Schnell Date: Wed, 23 Mar 2022 11:52:19 +0000 (+0100) Subject: - cleanup and coding style X-Git-Tag: v0.10.0~5^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd7bb8f4db9fe469f3f1f8881bc86c0244220e42;p=thirdparty%2Fsnapper.git - cleanup and coding style --- diff --git a/client/commands.cc b/client/commands.cc index dda9d3c6..357f23f3 100644 --- a/client/commands.cc +++ b/client/commands.cc @@ -581,7 +581,7 @@ command_prepare_quota(DBus::Connection& conn, const string& config_name) DBus::Hoho hoho(call); hoho << config_name; - conn.send_with_reply_and_block(call); + conn.send_with_reply_and_block(call); } catch (const DBus::ErrorException& e) { diff --git a/server/Client.cc b/server/Client.cc index 1fe24f14..79e0cc5e 100644 --- a/server/Client.cc +++ b/server/Client.cc @@ -47,13 +47,13 @@ Client::Client(const string& name, uid_t uid, const Clients& clients) Client::~Client() { method_call_thread.interrupt(); - file_transfer_thread.interrupt(); + files_transfer_thread.interrupt(); if (method_call_thread.joinable()) method_call_thread.join(); - if (file_transfer_thread.joinable()) - file_transfer_thread.join(); + if (files_transfer_thread.joinable()) + files_transfer_thread.join(); for (list::iterator it = comparisons.begin(); it != comparisons.end(); ++it) { @@ -1478,14 +1478,14 @@ Client::get_files_by_pipe(DBus::Connection& conn, DBus::Message& msg) DBus::Hoho hoho(reply); - shared_ptr file_transfer_task = make_shared(files); + shared_ptr files_transfer_task = make_shared(files); - hoho << file_transfer_task->get_read_end(); + hoho << files_transfer_task->get_read_end(); conn.send(reply); - file_transfer_task->get_read_end().close(); + files_transfer_task->get_read_end().close(); - add_file_transfer_task(file_transfer_task); + add_files_transfer_task(files_transfer_task); } @@ -1970,16 +1970,16 @@ Client::add_method_call_task(DBus::Connection& conn, DBus::Message& msg) void -Client::add_file_transfer_task(shared_ptr file_transfer_task) +Client::add_files_transfer_task(shared_ptr files_transfer_task) { - if (file_transfer_thread.get_id() == boost::thread::id()) - file_transfer_thread = boost::thread(boost::bind(&Client::files_transfer_worker, this)); + if (files_transfer_thread.get_id() == boost::thread::id()) + files_transfer_thread = boost::thread(boost::bind(&Client::files_transfer_worker, this)); - boost::unique_lock lock(file_transfer_mutex); - file_transfer_tasks.push(file_transfer_task); + boost::unique_lock lock(files_transfer_mutex); + files_transfer_tasks.push(files_transfer_task); lock.unlock(); - file_transfer_condition.notify_one(); + files_transfer_condition.notify_one(); } @@ -2073,12 +2073,12 @@ Client::files_transfer_worker() { while (true) { - boost::unique_lock lock(file_transfer_mutex); - while (file_transfer_tasks.empty()) - file_transfer_condition.wait(lock); + boost::unique_lock lock(files_transfer_mutex); + while (files_transfer_tasks.empty()) + files_transfer_condition.wait(lock); - shared_ptr ptr(file_transfer_tasks.front()); - file_transfer_tasks.pop(); + shared_ptr ptr(files_transfer_tasks.front()); + files_transfer_tasks.pop(); lock.unlock(); try diff --git a/server/Client.h b/server/Client.h index 996360aa..398756ae 100644 --- a/server/Client.h +++ b/server/Client.h @@ -164,11 +164,11 @@ public: queue method_call_tasks; void add_method_call_task(DBus::Connection& conn, DBus::Message& msg); - boost::condition_variable file_transfer_condition; - boost::mutex file_transfer_mutex; - boost::thread file_transfer_thread; - queue> file_transfer_tasks; - void add_file_transfer_task(shared_ptr file_transfer_task); + boost::condition_variable files_transfer_condition; + boost::mutex files_transfer_mutex; + boost::thread files_transfer_thread; + queue> files_transfer_tasks; + void add_files_transfer_task(shared_ptr files_transfer_task); bool zombie = false; diff --git a/server/snapperd.cc b/server/snapperd.cc index daa99e02..a0277c21 100644 --- a/server/snapperd.cc +++ b/server/snapperd.cc @@ -132,7 +132,7 @@ MyMainLoop::client_disconnected(const string& name) { client->zombie = true; client->method_call_thread.interrupt(); - client->file_transfer_thread.interrupt(); + client->files_transfer_thread.interrupt(); } reset_idle_count(); diff --git a/snapper/Comparison.h b/snapper/Comparison.h index 9b341399..33a5640e 100644 --- a/snapper/Comparison.h +++ b/snapper/Comparison.h @@ -83,8 +83,6 @@ namespace snapper Files files; - struct AppendHelper; - }; } diff --git a/testsuite-real/Makefile.am b/testsuite-real/Makefile.am index f72080f5..ceb08626 100644 --- a/testsuite-real/Makefile.am +++ b/testsuite-real/Makefile.am @@ -2,7 +2,7 @@ # Makefile.am for snapper/testsuite-real # -CXXFLAGS += -std=gnu++0x +CXXFLAGS += -std=gnu++11 AM_CPPFLAGS = -I$(top_srcdir) diff --git a/testsuite/limit.cc b/testsuite/limit.cc index 5c95f4fb..47a55f4a 100644 --- a/testsuite/limit.cc +++ b/testsuite/limit.cc @@ -24,7 +24,7 @@ test(const char* loc, const string& s) limit.parse(s); locale::global(locale::classic()); - + ostringstream tmp; tmp << limit; return tmp.str();