From 31d7221c70e8cee0154db66e679abcccfd0be5a4 Mon Sep 17 00:00:00 2001 From: Alexander Batischev Date: Sun, 29 Jul 2018 18:57:26 +0300 Subject: [PATCH] Reformat code with clang-format 5.0.2 --- include/configcontainer.h | 6 ++++-- include/configparser.h | 3 ++- include/exceptions.h | 15 ++++++++++----- include/htmlrenderer.h | 9 ++++++--- include/remote_api.h | 3 ++- rss/exception.cpp | 3 ++- rss/parser.cpp | 6 ++++-- rss/rsspp.h | 6 ++++-- rss/rsspp_internal.h | 15 ++++++++++----- src/cache.cpp | 3 ++- src/colormanager.cpp | 3 ++- src/configcontainer.cpp | 3 ++- src/controller.cpp | 3 ++- src/dialogs_formaction.cpp | 3 ++- src/download.cpp | 3 ++- src/downloadthread.cpp | 3 ++- src/exception.cpp | 3 ++- src/feedhq_urlreader.cpp | 3 ++- src/help_formaction.cpp | 3 ++- src/history.cpp | 3 ++- src/inoreader_urlreader.cpp | 3 ++- src/list_formaction.cpp | 3 ++- src/logger.cpp | 3 ++- src/newsblur_urlreader.cpp | 3 ++- src/ocnews_urlreader.cpp | 3 ++- src/oldreader_urlreader.cpp | 3 ++- src/queueloader.cpp | 3 ++- src/rss.cpp | 6 ++++-- src/select_formaction.cpp | 3 ++- src/tagsouppullparser.cpp | 3 ++- src/ttrss_urlreader.cpp | 3 ++- src/urlreader.cpp | 6 ++++-- src/urlview_formaction.cpp | 3 ++- src/utils.cpp | 16 ++++++++-------- test/cache.cpp | 3 ++- test/remote_api.cpp | 3 ++- test/test-helpers.h | 6 ++++-- 37 files changed, 112 insertions(+), 60 deletions(-) diff --git a/include/configcontainer.h b/include/configcontainer.h index 6a1b3f360..a6d80e0a1 100644 --- a/include/configcontainer.h +++ b/include/configcontainer.h @@ -51,7 +51,8 @@ struct configdata { , type(t) , enum_values() , multi_option(m) - {} + { + } configdata(const std::string& v, const std::unordered_set& values) @@ -60,7 +61,8 @@ struct configdata { , type(configdata_t::ENUM) , enum_values(values) , multi_option(false) - {} + { + } std::string value; std::string default_value; diff --git a/include/configparser.h b/include/configparser.h index a74e2b970..af1b3e08d 100644 --- a/include/configparser.h +++ b/include/configparser.h @@ -54,7 +54,8 @@ class null_config_action_handler : public config_action_handler { ~null_config_action_handler() override {} void handle_action(const std::string&, const std::vector&) override - {} + { + } void dump_config(std::vector&) override {} }; diff --git a/include/exceptions.h b/include/exceptions.h index 41178b9a0..47491c78e 100644 --- a/include/exceptions.h +++ b/include/exceptions.h @@ -13,7 +13,8 @@ class xmlexception : public std::exception { public: explicit xmlexception(const std::string& errmsg) : msg(errmsg) - {} + { + } ~xmlexception() throw() override {} const char* what() const throw() override { @@ -28,7 +29,8 @@ class configexception : public std::exception { public: explicit configexception(const std::string& errmsg) : msg(errmsg) - {} + { + } ~configexception() throw() override {} const char* what() const throw() override { @@ -43,7 +45,8 @@ class confighandlerexception : public std::exception { public: explicit confighandlerexception(const std::string& emsg) : msg(emsg) - {} + { + } explicit confighandlerexception(action_handler_status e); ~confighandlerexception() throw() override {} const char* what() const throw() override @@ -64,7 +67,8 @@ class dbexception : public std::exception { public: explicit dbexception(sqlite3* h) : msg(sqlite3_errmsg(h)) - {} + { + } ~dbexception() throw() override {} const char* what() const throw() override { @@ -85,7 +89,8 @@ class matcherexception : public std::exception { : type_(et) , addinfo(info) , addinfo2(info2) - {} + { + } ~matcherexception() throw() override {} const char* what() const throw() override; diff --git a/include/htmlrenderer.h b/include/htmlrenderer.h index a714f54a7..491865030 100644 --- a/include/htmlrenderer.h +++ b/include/htmlrenderer.h @@ -66,7 +66,8 @@ class htmlrenderer { struct TableCell { explicit TableCell(size_t s) : span(s) - {} + { + } size_t span; std::vector text; // multiline cell text }; @@ -74,7 +75,8 @@ class htmlrenderer { struct TableRow { TableRow() : inside(false) - {} + { + } void add_text(const std::string& str); void start_cell(size_t span); @@ -88,7 +90,8 @@ class htmlrenderer { explicit Table(bool b) : inside(false) , has_border(b) - {} + { + } void add_text(const std::string& str); void start_row(); diff --git a/include/remote_api.h b/include/remote_api.h index 793c6b100..918e04f8e 100644 --- a/include/remote_api.h +++ b/include/remote_api.h @@ -21,7 +21,8 @@ class remote_api { public: explicit remote_api(configcontainer* c) : cfg(c) - {} + { + } virtual ~remote_api() {} virtual bool authenticate() = 0; virtual std::vector get_subscribed_urls() = 0; diff --git a/rss/exception.cpp b/rss/exception.cpp index 027906add..55e420a99 100644 --- a/rss/exception.cpp +++ b/rss/exception.cpp @@ -6,7 +6,8 @@ namespace rsspp { exception::exception(const std::string& errmsg) : emsg(errmsg) -{} +{ +} exception::~exception() throw() {} diff --git a/rss/parser.cpp b/rss/parser.cpp index 1d6989f25..2a517d952 100644 --- a/rss/parser.cpp +++ b/rss/parser.cpp @@ -38,7 +38,8 @@ parser::parser(unsigned int timeout, , verify_ssl(ssl_verify) , doc(0) , lm(0) -{} +{ +} parser::~parser() { @@ -52,7 +53,8 @@ struct header_values { header_values() : lastmodified(0) - {} + { + } }; static size_t handle_headers(void* ptr, size_t size, size_t nmemb, void* data) diff --git a/rss/rsspp.h b/rss/rsspp.h index c4c31bf68..6d8473eef 100644 --- a/rss/rsspp.h +++ b/rss/rsspp.h @@ -31,7 +31,8 @@ class item { item() : guid_isPermaLink(false) , pubDate_ts(0) - {} + { + } std::string title; std::string title_type; @@ -65,7 +66,8 @@ class feed { public: feed() : rss_version(UNKNOWN) - {} + { + } std::string encoding; diff --git a/rss/rsspp_internal.h b/rss/rsspp_internal.h index 584715eff..b54574eb7 100644 --- a/rss/rsspp_internal.h +++ b/rss/rsspp_internal.h @@ -21,7 +21,8 @@ struct rss_parser { virtual void parse_feed(feed& f, xmlNode* rootNode) = 0; explicit rss_parser(xmlDocPtr d) : doc(d) - {} + { + } virtual ~rss_parser() {} static std::string __w3cdtf_to_rfc822(const std::string& w3cdtf); @@ -44,7 +45,8 @@ struct rss_09x_parser : public rss_parser { explicit rss_09x_parser(xmlDocPtr doc) : rss_parser(doc) , ns(nullptr) - {} + { + } ~rss_09x_parser() override; protected: @@ -57,7 +59,8 @@ struct rss_09x_parser : public rss_parser { struct rss_20_parser : public rss_09x_parser { explicit rss_20_parser(xmlDocPtr doc) : rss_09x_parser(doc) - {} + { + } void parse_feed(feed& f, xmlNode* rootNode) override; ~rss_20_parser() override {} }; @@ -66,7 +69,8 @@ struct rss_10_parser : public rss_parser { void parse_feed(feed& f, xmlNode* rootNode) override; explicit rss_10_parser(xmlDocPtr doc) : rss_parser(doc) - {} + { + } ~rss_10_parser() override {} }; @@ -75,7 +79,8 @@ struct atom_parser : public rss_parser { explicit atom_parser(xmlDocPtr doc) : rss_parser(doc) , ns(0) - {} + { + } ~atom_parser() override {} private: diff --git a/src/cache.cpp b/src/cache.cpp index 7b7600039..47be112c3 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -54,7 +54,8 @@ void cache::run_sql_nothrow(const std::string& query, struct cb_handler { cb_handler() : c(-1) - {} + { + } void set_count(int i) { c = i; diff --git a/src/colormanager.cpp b/src/colormanager.cpp index d848c6ee0..c2b22c507 100644 --- a/src/colormanager.cpp +++ b/src/colormanager.cpp @@ -20,7 +20,8 @@ namespace newsboat { colormanager::colormanager() : colors_loaded_(false) -{} +{ +} colormanager::~colormanager() {} diff --git a/src/configcontainer.cpp b/src/configcontainer.cpp index b6ba62ccf..bea678dfd 100644 --- a/src/configcontainer.cpp +++ b/src/configcontainer.cpp @@ -241,7 +241,8 @@ configcontainer::configcontainer() configdata_t::STR)}, {"urlview-title-format", configdata(_("%N %V - URLs"), configdata_t::STR)}} -{} +{ +} configcontainer::~configcontainer() {} diff --git a/src/controller.cpp b/src/controller.cpp index 442db0e42..eeacaec76 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -91,7 +91,8 @@ controller::controller() , rsscache(0) , refresh_on_start(false) , api(0) -{} +{ +} controller::~controller() { diff --git a/src/dialogs_formaction.cpp b/src/dialogs_formaction.cpp index c1fa7e9cf..8ec3b770d 100644 --- a/src/dialogs_formaction.cpp +++ b/src/dialogs_formaction.cpp @@ -14,7 +14,8 @@ namespace newsboat { dialogs_formaction::dialogs_formaction(view* vv, std::string formstr) : formaction(vv, formstr) , update_list(true) -{} +{ +} dialogs_formaction::~dialogs_formaction() {} diff --git a/src/download.cpp b/src/download.cpp index df4d7f3d4..e8ad16794 100644 --- a/src/download.cpp +++ b/src/download.cpp @@ -19,7 +19,8 @@ download::download(pb_controller* c) , curkbps(0.0) , offs(0) , ctrl(c) -{} +{ +} download::~download() {} diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp index 52d82bc0e..a4572573a 100644 --- a/src/downloadthread.cpp +++ b/src/downloadthread.cpp @@ -43,7 +43,8 @@ reloadrangethread::reloadrangethread(controller* c, , e(end) , ss(size) , u(unattended) -{} +{ +} void reloadrangethread::operator()() { diff --git a/src/exception.cpp b/src/exception.cpp index f25eed182..ba4c27847 100644 --- a/src/exception.cpp +++ b/src/exception.cpp @@ -12,7 +12,8 @@ namespace newsboat { exception::exception(unsigned int error_code) : ecode(error_code) -{} +{ +} exception::~exception() throw() {} diff --git a/src/feedhq_urlreader.cpp b/src/feedhq_urlreader.cpp index f677b41e5..5944541a3 100644 --- a/src/feedhq_urlreader.cpp +++ b/src/feedhq_urlreader.cpp @@ -10,7 +10,8 @@ feedhq_urlreader::feedhq_urlreader(configcontainer* c, : cfg(c) , file(url_file) , api(a) -{} +{ +} feedhq_urlreader::~feedhq_urlreader() {} diff --git a/src/help_formaction.cpp b/src/help_formaction.cpp index 2a0197b60..004fde494 100644 --- a/src/help_formaction.cpp +++ b/src/help_formaction.cpp @@ -17,7 +17,8 @@ help_formaction::help_formaction(view* vv, std::string formstr) : formaction(vv, formstr) , quit(false) , apply_search(false) -{} +{ +} help_formaction::~help_formaction() {} diff --git a/src/history.cpp b/src/history.cpp index 92d936515..b9b304a0c 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -6,7 +6,8 @@ namespace newsboat { history::history() : idx(0) -{} +{ +} history::~history() {} diff --git a/src/inoreader_urlreader.cpp b/src/inoreader_urlreader.cpp index cf52a6758..1ac90382d 100644 --- a/src/inoreader_urlreader.cpp +++ b/src/inoreader_urlreader.cpp @@ -10,7 +10,8 @@ inoreader_urlreader::inoreader_urlreader(configcontainer* c, : cfg(c) , file(url_file) , api(a) -{} +{ +} inoreader_urlreader::~inoreader_urlreader() {} diff --git a/src/list_formaction.cpp b/src/list_formaction.cpp index 73a64ea10..d9bc9802a 100644 --- a/src/list_formaction.cpp +++ b/src/list_formaction.cpp @@ -6,7 +6,8 @@ namespace newsboat { list_formaction::list_formaction(view* v, std::string formstr) : formaction(v, formstr) -{} +{ +} void list_formaction::process_operation(operation op, bool, diff --git a/src/logger.cpp b/src/logger.cpp index 36ffd1c75..0678fe0f2 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -10,7 +10,8 @@ std::mutex logger::instanceMutex; logger::logger() : curlevel(level::NONE) -{} +{ +} void logger::set_logfile(const std::string& logfile) { diff --git a/src/newsblur_urlreader.cpp b/src/newsblur_urlreader.cpp index 2ef464f22..dadc1e0ec 100644 --- a/src/newsblur_urlreader.cpp +++ b/src/newsblur_urlreader.cpp @@ -8,7 +8,8 @@ newsblur_urlreader::newsblur_urlreader(const std::string& url_file, remote_api* a) : file(url_file) , api(a) -{} +{ +} newsblur_urlreader::~newsblur_urlreader() {} diff --git a/src/ocnews_urlreader.cpp b/src/ocnews_urlreader.cpp index 7dcd4274c..de0370809 100644 --- a/src/ocnews_urlreader.cpp +++ b/src/ocnews_urlreader.cpp @@ -7,7 +7,8 @@ namespace newsboat { ocnews_urlreader::ocnews_urlreader(const std::string& url_file, remote_api* a) : file(url_file) , api(a) -{} +{ +} ocnews_urlreader::~ocnews_urlreader() {} diff --git a/src/oldreader_urlreader.cpp b/src/oldreader_urlreader.cpp index 30afb40db..7ed999f11 100644 --- a/src/oldreader_urlreader.cpp +++ b/src/oldreader_urlreader.cpp @@ -10,7 +10,8 @@ oldreader_urlreader::oldreader_urlreader(configcontainer* c, : cfg(c) , file(url_file) , api(a) -{} +{ +} oldreader_urlreader::~oldreader_urlreader() {} diff --git a/src/queueloader.cpp b/src/queueloader.cpp index 211ac098a..2ce894162 100644 --- a/src/queueloader.cpp +++ b/src/queueloader.cpp @@ -19,7 +19,8 @@ namespace podboat { queueloader::queueloader(const std::string& file, pb_controller* c) : queuefile(file) , ctrl(c) -{} +{ +} void queueloader::reload(std::vector& downloads, bool remove_unplayed) { diff --git a/src/rss.cpp b/src/rss.cpp index 85919d54f..4f1da89eb 100644 --- a/src/rss.cpp +++ b/src/rss.cpp @@ -32,7 +32,8 @@ rss_item::rss_item(cache* c) , enqueued_(false) , deleted_(0) , override_unread_(false) -{} +{ +} rss_item::~rss_item() {} @@ -44,7 +45,8 @@ rss_feed::rss_feed(cache* c) , idx(0) , order(0) , status_(dl_status::SUCCESS) -{} +{ +} rss_feed::~rss_feed() { diff --git a/src/select_formaction.cpp b/src/select_formaction.cpp index 734ae126f..beb99baeb 100644 --- a/src/select_formaction.cpp +++ b/src/select_formaction.cpp @@ -23,7 +23,8 @@ select_formaction::select_formaction(view* vv, std::string formstr) : formaction(vv, formstr) , quit(false) , type(selection_type::TAG) -{} +{ +} select_formaction::~select_formaction() {} diff --git a/src/tagsouppullparser.cpp b/src/tagsouppullparser.cpp index 94041dd88..681f5bd43 100644 --- a/src/tagsouppullparser.cpp +++ b/src/tagsouppullparser.cpp @@ -24,7 +24,8 @@ tagsouppullparser::tagsouppullparser() : inputstream(0) , current_event(event::START_DOCUMENT) , c('\0') -{} +{ +} tagsouppullparser::~tagsouppullparser() {} diff --git a/src/ttrss_urlreader.cpp b/src/ttrss_urlreader.cpp index 312505d05..71b8982da 100644 --- a/src/ttrss_urlreader.cpp +++ b/src/ttrss_urlreader.cpp @@ -7,7 +7,8 @@ namespace newsboat { ttrss_urlreader::ttrss_urlreader(const std::string& url_file, remote_api* a) : file(url_file) , api(a) -{} +{ +} ttrss_urlreader::~ttrss_urlreader() {} diff --git a/src/urlreader.cpp b/src/urlreader.cpp index e1b379e43..1dd90300c 100644 --- a/src/urlreader.cpp +++ b/src/urlreader.cpp @@ -35,7 +35,8 @@ std::vector urlreader::get_alltags() file_urlreader::file_urlreader(const std::string& file) : filename(file) -{} +{ +} file_urlreader::~file_urlreader() {} std::string file_urlreader::get_source() @@ -100,7 +101,8 @@ void file_urlreader::write_config() opml_urlreader::opml_urlreader(configcontainer* c) : cfg(c) -{} +{ +} opml_urlreader::~opml_urlreader() {} void opml_urlreader::write_config() diff --git a/src/urlview_formaction.cpp b/src/urlview_formaction.cpp index d7e81a92b..93b08ac3f 100644 --- a/src/urlview_formaction.cpp +++ b/src/urlview_formaction.cpp @@ -23,7 +23,8 @@ urlview_formaction::urlview_formaction(view* vv, : formaction(vv, formstr) , quit(false) , feed(feed) -{} +{ +} urlview_formaction::~urlview_formaction() {} diff --git a/src/utils.cpp b/src/utils.cpp index 48c123224..0bbf28cce 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1397,14 +1397,14 @@ bool utils::is_valid_podcast_type(const std::string& mimetype) return found || matches; } -/* - * See - * http://curl.haxx.se/libcurl/c/libcurl-tutorial.html#Multi-threading - * for a reason why we do this. - * - * These callbacks are deprecated as of OpenSSL 1.1.0; see the - * changelog: https://www.openssl.org/news/changelog.html#x6 - */ + /* + * See + * http://curl.haxx.se/libcurl/c/libcurl-tutorial.html#Multi-threading + * for a reason why we do this. + * + * These callbacks are deprecated as of OpenSSL 1.1.0; see the + * changelog: https://www.openssl.org/news/changelog.html#x6 + */ #if HAVE_OPENSSL && OPENSSL_VERSION_NUMBER < 0x01010000fL static std::mutex* openssl_mutexes = nullptr; diff --git a/test/cache.cpp b/test/cache.cpp index abac21c64..e5201d7d0 100644 --- a/test/cache.cpp +++ b/test/cache.cpp @@ -751,7 +751,8 @@ TEST_CASE("externalize_rssfeed doesn't store more than `max-items` items", TEST_CASE("externalize_rssfeed does nothing if it's passed a query feed", "[cache]") -{} +{ +} TEST_CASE( "internalize_rssfeed doesn't return more than `max-items` items, " diff --git a/test/remote_api.cpp b/test/remote_api.cpp index dbc4a3f5a..366d9b36d 100644 --- a/test/remote_api.cpp +++ b/test/remote_api.cpp @@ -14,7 +14,8 @@ class test_api : public remote_api { public: test_api(configcontainer* c) : remote_api(c) - {} + { + } std::string get_user(const std::string& scope, const std::string& name) { return get_credentials(scope, name).user; diff --git a/test/test-helpers.h b/test/test-helpers.h index 41d27f06c..668660467 100644 --- a/test/test-helpers.h +++ b/test/test-helpers.h @@ -186,11 +186,13 @@ class ExceptionWithMsg : public Catch::MatcherBase { public: explicit ExceptionWithMsg(std::string&& msg) : expected_msg(std::move(msg)) - {} + { + } explicit ExceptionWithMsg(const std::string& msg) : expected_msg(msg) - {} + { + } bool match(const Exception& e) const override {