From c62a40b368c3f87f2af75038974961e83a48a779 Mon Sep 17 00:00:00 2001 From: Arne H Juul Date: Tue, 2 May 2017 11:05:57 +0200 Subject: misc cleanup from Baldersheim * include file cleanup * only do LOG_SETUP as needed * remove "virtual" where "override" is specified also * some minor reformatting and indentation changes --- slobrok/src/apps/check_slobrok/check_slobrok.cpp | 11 ++++------- slobrok/src/apps/sbcmd/sbcmd.cpp | 12 ++++-------- slobrok/src/tests/mirrorapi/match_test.cpp | 7 +++---- slobrok/src/tests/oldapi/mirror.h | 11 +---------- slobrok/src/tests/startsome/rpc_info.cpp | 5 ++--- slobrok/src/tests/startsome/tstdst.cpp | 10 +++------- 6 files changed, 17 insertions(+), 39 deletions(-) (limited to 'slobrok/src') diff --git a/slobrok/src/apps/check_slobrok/check_slobrok.cpp b/slobrok/src/apps/check_slobrok/check_slobrok.cpp index 8e2a91c100d..9d588eab39f 100644 --- a/slobrok/src/apps/check_slobrok/check_slobrok.cpp +++ b/slobrok/src/apps/check_slobrok/check_slobrok.cpp @@ -1,14 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include - -#include -LOG_SETUP("check_slobrok"); #include - +#include #include #include +#include +LOG_SETUP("check_slobrok"); class Slobrok_Checker : public FastOS_Application { @@ -25,10 +23,9 @@ public: int usage(); void initRPC(const char *spec); void finiRPC(); - virtual int Main() override; + int Main() override; }; - Slobrok_Checker::~Slobrok_Checker() { LOG_ASSERT(_supervisor == NULL); diff --git a/slobrok/src/apps/sbcmd/sbcmd.cpp b/slobrok/src/apps/sbcmd/sbcmd.cpp index 60a3dfc779b..a96c4609137 100644 --- a/slobrok/src/apps/sbcmd/sbcmd.cpp +++ b/slobrok/src/apps/sbcmd/sbcmd.cpp @@ -1,14 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include - -#include -LOG_SETUP("sb-cmd"); #include - +#include #include #include +#include +LOG_SETUP("sb-cmd"); class Slobrok_CMD : public FastOS_Application { @@ -25,17 +23,15 @@ public: int usage(); void initRPC(const char *spec); void finiRPC(); - virtual int Main() override; + int Main() override; }; - Slobrok_CMD::~Slobrok_CMD() { LOG_ASSERT(_supervisor == NULL); LOG_ASSERT(_target == NULL); } - int Slobrok_CMD::usage() { diff --git a/slobrok/src/tests/mirrorapi/match_test.cpp b/slobrok/src/tests/mirrorapi/match_test.cpp index d9ebcfd6f29..94900daa202 100644 --- a/slobrok/src/tests/mirrorapi/match_test.cpp +++ b/slobrok/src/tests/mirrorapi/match_test.cpp @@ -4,12 +4,11 @@ class MatchTester : public slobrok::api::IMirrorAPI { - virtual SpecList lookup(const std::string &) const override { + SpecList lookup(const std::string &) const override { return SpecList(); } - virtual uint32_t updates() const override { return 0; } - - virtual bool ready() const override { return true; } + uint32_t updates() const override { return 0; } + bool ready() const override { return true; } const std::string name; diff --git a/slobrok/src/tests/oldapi/mirror.h b/slobrok/src/tests/oldapi/mirror.h index 1f0db564cae..b83392dec5e 100644 --- a/slobrok/src/tests/oldapi/mirror.h +++ b/slobrok/src/tests/oldapi/mirror.h @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#ifndef Old_MIRROR_H -#define Old_MIRROR_H +#pragma once #include #include @@ -86,10 +85,7 @@ public: **/ ~MirrorOld(); - // Inherit doc from IMirrorOld. SpecList lookup(const std::string & pattern) const override; - - // Inherit doc from IMirrorOld. uint32_t updates() const override { return _updates.getAsInt(); } /** @@ -110,10 +106,7 @@ private: MirrorOld(const MirrorOld &); MirrorOld &operator=(const MirrorOld &); - /** from FNET_Task, polls slobrok **/ void PerformTask() override; - - /** from FRT_IRequestWait **/ void RequestDone(FRT_RPCRequest *req) override; FRT_Supervisor &_orb; @@ -131,5 +124,3 @@ private: } // namespace api } // namespace slobrok - -#endif diff --git a/slobrok/src/tests/startsome/rpc_info.cpp b/slobrok/src/tests/startsome/rpc_info.cpp index 76b578d4f88..be5418ff1a8 100644 --- a/slobrok/src/tests/startsome/rpc_info.cpp +++ b/slobrok/src/tests/startsome/rpc_info.cpp @@ -1,8 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include -#include -LOG_SETUP("rpc_info"); + #include +#include class RPCInfo : public FastOS_Application { diff --git a/slobrok/src/tests/startsome/tstdst.cpp b/slobrok/src/tests/startsome/tstdst.cpp index e2f6ae070b3..7d3fcef8695 100644 --- a/slobrok/src/tests/startsome/tstdst.cpp +++ b/slobrok/src/tests/startsome/tstdst.cpp @@ -1,15 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include -#include -LOG_SETUP("testrpcserver"); #include -#include #include +#include -#include -#include -#include +#include +LOG_SETUP("testrpcserver"); class FNET_Transport; class FNET_Scheduler; -- cgit v1.2.3