diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-29 00:53:10 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-29 00:53:10 +0200 |
commit | 1ebf4beb3c6f0c1646a46983ef85964c5e165c3b (patch) | |
tree | 422dd054fa151c3c7eb16ca6cb45738c19ed02f5 | |
parent | 97aaf8fb695c5f010b789b85f68c5ec4982ed45f (diff) |
Add override
20 files changed, 51 insertions, 144 deletions
diff --git a/config/src/apps/configproxy-cmd/main.cpp b/config/src/apps/configproxy-cmd/main.cpp index fcf2a0ca5d7..1d5934f2817 100644 --- a/config/src/apps/configproxy-cmd/main.cpp +++ b/config/src/apps/configproxy-cmd/main.cpp @@ -10,8 +10,8 @@ class Application : public FastOS_Application Flags _flags; bool parseOpts(); public: - void usage(void); - int Main(void) override; + void usage(); + int Main() override; Application() : _flags() {} }; diff --git a/config/src/apps/getvespaconfig/getconfig.cpp b/config/src/apps/getvespaconfig/getconfig.cpp index 23127b79333..df7bbba48b0 100644 --- a/config/src/apps/getvespaconfig/getconfig.cpp +++ b/config/src/apps/getvespaconfig/getconfig.cpp @@ -32,7 +32,7 @@ public: int usage(); void initRPC(const char *spec); void finiRPC(); - virtual int Main() override; + int Main() override; }; diff --git a/config/src/apps/pingproxy/pingproxy.cpp b/config/src/apps/pingproxy/pingproxy.cpp index 667d5689691..ba35892c03c 100644 --- a/config/src/apps/pingproxy/pingproxy.cpp +++ b/config/src/apps/pingproxy/pingproxy.cpp @@ -24,7 +24,7 @@ public: int usage(); void initRPC(const char *spec); void finiRPC(); - virtual int Main() override; + int Main() override; }; diff --git a/config/src/tests/configagent/configagent.cpp b/config/src/tests/configagent/configagent.cpp index 91b657b42f2..0693c33467d 100644 --- a/config/src/tests/configagent/configagent.cpp +++ b/config/src/tests/configagent/configagent.cpp @@ -1,5 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/config/config.h> #include <vespa/config/raw/rawsource.h> @@ -19,25 +18,10 @@ public: : _key(key) { } - const ConfigKey & getKey() const override - { - return _key; - } - - bool abort() override - { - return false; - } - - bool isAborted() const override - { - return false; - } - - void setError(int errorCode) override - { - (void) errorCode; - } + const ConfigKey & getKey() const override { return _key; } + bool abort() override { return false; } + bool isAborted() const override { return false; } + void setError(int errorCode) override { (void) errorCode; } const ConfigKey _key; }; @@ -57,51 +41,15 @@ public: _isError(iserror) { } - const ConfigKey& getKey() const override - { - return _key; - } - - const ConfigValue & getValue() const override - { - return _value; - } - - const ConfigState & getConfigState() const override - { - return _state; - } - - bool hasValidResponse() const override - { - return _valid; - } - - bool validateResponse() override - { - return _valid; - } - - void fill() override - { - _fillCalled = true; - } - - vespalib::string errorMessage() const override - { - return _errorMessage; - } - - int errorCode() const override - { - return _errorCode; - } - - bool isError() const override - { - return _isError; - } - + const ConfigKey& getKey() const override { return _key; } + const ConfigValue & getValue() const override { return _value; } + const ConfigState & getConfigState() const override { return _state; } + bool hasValidResponse() const override { return _valid; } + bool validateResponse() override { return _valid; } + void fill() override { _fillCalled = true; } + vespalib::string errorMessage() const override { return _errorMessage; } + int errorCode() const override { return _errorCode; } + bool isError() const override { return _isError; } const Trace & getTrace() const override { return _trace; } const ConfigKey _key; diff --git a/config/src/tests/configretriever/configretriever.cpp b/config/src/tests/configretriever/configretriever.cpp index bb4dda0e10e..8273eee2c73 100644 --- a/config/src/tests/configretriever/configretriever.cpp +++ b/config/src/tests/configretriever/configretriever.cpp @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("configretriever"); + #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/data/slime/slime.h> #include <vespa/config/config.h> diff --git a/config/src/tests/frt/frt.cpp b/config/src/tests/frt/frt.cpp index 26f95df8f42..0de1908858f 100644 --- a/config/src/tests/frt/frt.cpp +++ b/config/src/tests/frt/frt.cpp @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("frt"); + #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/config/common/iconfigholder.h> #include <vespa/config/common/trace.h> diff --git a/config/src/tests/frtconnectionpool/frtconnectionpool.cpp b/config/src/tests/frtconnectionpool/frtconnectionpool.cpp index 96dad86a54d..b563ea1929b 100644 --- a/config/src/tests/frtconnectionpool/frtconnectionpool.cpp +++ b/config/src/tests/frtconnectionpool/frtconnectionpool.cpp @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("frtconnectionpool_test"); + #include <vespa/vespalib/testkit/testapp.h> #include <vespa/config/frt/frtconnectionpool.h> #include <vespa/fnet/frt/error.h> diff --git a/config/src/tests/subscription/subscription.cpp b/config/src/tests/subscription/subscription.cpp index e47f8b11e60..5974279518a 100644 --- a/config/src/tests/subscription/subscription.cpp +++ b/config/src/tests/subscription/subscription.cpp @@ -1,5 +1,4 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/config/common/misc.h> #include <vespa/config/common/configholder.h> diff --git a/config/src/tests/trace/trace.cpp b/config/src/tests/trace/trace.cpp index 566077d47e1..195f7d659a9 100644 --- a/config/src/tests/trace/trace.cpp +++ b/config/src/tests/trace/trace.cpp @@ -1,7 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/log/log.h> -LOG_SETUP("frt"); + #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/config/common/trace.h> #include <vespa/vespalib/trace/tracenode.h> diff --git a/config/src/vespa/config/helper/ifetchercallback.h b/config/src/vespa/config/helper/ifetchercallback.h index 9bc6e848827..50c26f2d3fc 100644 --- a/config/src/vespa/config/helper/ifetchercallback.h +++ b/config/src/vespa/config/helper/ifetchercallback.h @@ -26,14 +26,11 @@ public: template <typename ConfigType> class IFetcherCallback : public ICallback { -public: - virtual ~IFetcherCallback() { } protected: - virtual void configure(std::unique_ptr<const ConfigInstance> config) override { + void configure(std::unique_ptr<const ConfigInstance> config) override { configure(std::unique_ptr<ConfigType>(static_cast<const ConfigType *>(config.release()))); } virtual void configure(std::unique_ptr<ConfigType> config) = 0; }; } // namespace config - diff --git a/configutil/src/apps/configstatus/main.cpp b/configutil/src/apps/configstatus/main.cpp index f774afa355d..4583af033c2 100644 --- a/configutil/src/apps/configstatus/main.cpp +++ b/configutil/src/apps/configstatus/main.cpp @@ -17,8 +17,8 @@ class Application : public FastOS_Application { vespalib::string getSources(); HostFilter parse_host_set(vespalib::stringref raw_arg) const; public: - void usage(void); - int Main(void) override; + void usage(); + int Main() override; Application(); ~Application(); diff --git a/configutil/src/lib/configstatus.cpp b/configutil/src/lib/configstatus.cpp index 174350c5eca..5a876a30ab5 100644 --- a/configutil/src/lib/configstatus.cpp +++ b/configutil/src/lib/configstatus.cpp @@ -9,9 +9,6 @@ #include <vbench/http/http_client.h> #include <iostream> -#include <vespa/log/log.h> -LOG_SETUP("vespa-config-status"); - using configdefinitions::tagsContain; struct ComponentTraverser : public vespalib::slime::ObjectTraverser @@ -41,8 +38,7 @@ struct ComponentTraverser : public vespalib::slime::ObjectTraverser slime.get()["config"].traverse(traverser); } - virtual void - field(const vespalib::Memory &symbol_name, const vespalib::slime::Inspector &inspector) override { + void field(const vespalib::Memory &symbol_name, const vespalib::slime::Inspector &inspector) override { switch (_state) { case ROOT: _component = symbol_name.make_string(); @@ -87,16 +83,16 @@ public: {} ~MyHttpHandler(); - virtual void handleHeader(const vbench::string &name, const vbench::string &value) override { + void handleHeader(const vbench::string &name, const vbench::string &value) override { (void) name; (void) value; } - virtual void handleContent(const vbench::Memory &data) override { + void handleContent(const vbench::Memory &data) override { _json += std::string(data.data, data.size); } - virtual void handleFailure(const vbench::string &reason) override { + void handleFailure(const vbench::string &reason) override { std::cerr << _configId << ": Failed to fetch json: " << reason << std::endl; _error = reason; } diff --git a/configutil/src/tests/config_status/config_status_test.cpp b/configutil/src/tests/config_status/config_status_test.cpp index 77fcf1b8da8..39442068330 100644 --- a/configutil/src/tests/config_status/config_status_test.cpp +++ b/configutil/src/tests/config_status/config_status_test.cpp @@ -1,14 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/vespalib/testkit/testapp.h> #include <lib/configstatus.h> -#include <iostream> #include <vespa/fastlib/net/httpserver.h> #include <vespa/config-model.h> #include <vespa/config/config.h> #include <vespa/config/subscription/sourcespec.h> -#include <vector> -#include <string> using namespace config; @@ -17,8 +13,7 @@ private: std::string _reply; bool _fail; - virtual void onGetRequest(const string &, const string &, - Fast_HTTPConnection &conn) override { + void onGetRequest(const string &, const string &, Fast_HTTPConnection &conn) override { if (_fail) { conn.Output(conn.GetHTTPVersion().c_str()); conn.Output(" 500 Error\r\n"); diff --git a/configutil/src/tests/model_inspect/model_inspect_test.cpp b/configutil/src/tests/model_inspect/model_inspect_test.cpp index be45d4d0d46..fe818e8e4e4 100644 --- a/configutil/src/tests/model_inspect/model_inspect_test.cpp +++ b/configutil/src/tests/model_inspect/model_inspect_test.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 <vespa/fastos/fastos.h> #include <vespa/vespalib/testkit/test_kit.h> #include <lib/modelinspect.h> -#include <iostream> +#include <sstream> class Model { public: @@ -89,11 +88,11 @@ public: void listServices() override { _listServices = true; }; void listClusters() override { _listClusters = true; }; void listConfigIds() override { _listConfigIds = true; }; - int listHost(const vespalib::string) override { _listHost = true; return 0; }; + int listHost(const vespalib::string) override { _listHost = true; return 0; }; int listAllPorts() override { _listAllPorts = true; return 0; }; - int listCluster(const vespalib::string) override { _listCluster = true; return 0; }; - int listService(const vespalib::string) override { _listService = true; return 0; }; - int listService(const vespalib::string, const vespalib::string) override { _listService2 = true; return 0; }; + int listCluster(const vespalib::string) override { _listCluster = true; return 0; }; + int listService(const vespalib::string) override { _listService = true; return 0; }; + int listService(const vespalib::string, const vespalib::string) override { _listService2 = true; return 0; }; int listConfigId(const vespalib::string) override { _listConfigId = true; return 0; }; int getIndexOf(const vespalib::string, const vespalib::string) override { _getIndexOf = true; return 0; }; diff --git a/vespamalloc/src/tests/allocfree/allocfree.cpp b/vespamalloc/src/tests/allocfree/allocfree.cpp index cdb471e35d2..0806d3a8453 100644 --- a/vespamalloc/src/tests/allocfree/allocfree.cpp +++ b/vespamalloc/src/tests/allocfree/allocfree.cpp @@ -19,7 +19,7 @@ public: FreeWorker(uint32_t maxQueue, bool inverse) : Consumer (maxQueue, inverse) {} private: - virtual void consume(void * p) override { free(p); } + void consume(void * p) override { free(p); } }; //----------------------------------------------------------------------------- @@ -30,7 +30,7 @@ public: : Producer(cnt, target), _size(size) {} private: uint32_t _size; - virtual void * produce() override { return malloc(_size); } + void * produce() override { return malloc(_size); } }; //----------------------------------------------------------------------------- @@ -41,8 +41,9 @@ public: : ProducerConsumer(cnt, inverse), _size(size) { } private: uint32_t _size; - virtual void * produce() override { return malloc(_size); } - virtual void consume(void * p) override { free(p); } + + void * produce() override { return malloc(_size); } + void consume(void * p) override { free(p); } }; //----------------------------------------------------------------------------- diff --git a/vespamalloc/src/tests/allocfree/linklist.cpp b/vespamalloc/src/tests/allocfree/linklist.cpp index 06acfa8df8a..ff33fca4661 100644 --- a/vespamalloc/src/tests/allocfree/linklist.cpp +++ b/vespamalloc/src/tests/allocfree/linklist.cpp @@ -61,7 +61,7 @@ public: LinkIn(List::AtomicHeadPtr & list, uint32_t maxQueue, bool inverse); private: List::AtomicHeadPtr & _head; - virtual void consume(void * p) override { + void consume(void * p) override { List * l((List *) p); if ( ! ((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } List::linkIn(_head, l, l); @@ -82,7 +82,7 @@ public: : Producer(cnt, target), _head(list) {} private: List::AtomicHeadPtr & _head; - virtual void * produce() override { + void * produce() override { void *p = List::linkOut(_head); List *l((List *)p); if ( ! ((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } @@ -98,13 +98,13 @@ public: : ProducerConsumer(cnt, inverse), _head(list) { } private: List::AtomicHeadPtr & _head; - virtual void * produce() override { + void * produce() override { void *p = List::linkOut(_head); List *l((List *)p); if ( !((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } return p; } - virtual void consume(void * p) override { + void consume(void * p) override { List * l((List *) p); if ( !((l >= &globalList[0]) && (l < &globalList[NumBlocks]))) { abort(); } List::linkIn(_head, l, l); diff --git a/vespamalloc/src/tests/doubledelete/expectsignal.cpp b/vespamalloc/src/tests/doubledelete/expectsignal.cpp index 3237339fb97..2811da01c09 100644 --- a/vespamalloc/src/tests/doubledelete/expectsignal.cpp +++ b/vespamalloc/src/tests/doubledelete/expectsignal.cpp @@ -9,7 +9,8 @@ class Test : public TestApp public: int Main() override; private: - virtual bool useProcessStarter() const override { return true; } + bool useProcessStarter() const override { return true; } + }; int Test::Main() diff --git a/vespamalloc/src/tests/test.cpp b/vespamalloc/src/tests/test.cpp index 9f5bd826a6b..960114b1bc1 100644 --- a/vespamalloc/src/tests/test.cpp +++ b/vespamalloc/src/tests/test.cpp @@ -1,6 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <stdio.h> -#include <stdlib.h> + #include <vespa/fastos/thread.h> namespace vespamalloc { diff --git a/vespamalloc/src/tests/thread/racemanythreads.cpp b/vespamalloc/src/tests/thread/racemanythreads.cpp index 8f366acea3a..acfefceee15 100644 --- a/vespamalloc/src/tests/thread/racemanythreads.cpp +++ b/vespamalloc/src/tests/thread/racemanythreads.cpp @@ -1,17 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <pthread.h> -#include <stdint.h> -#include <errno.h> -#include <vespa/vespalib/util/atomic.h> -#include <sys/resource.h> -#include <vespa/vespalib/testkit/testapp.h> -#include <vespa/log/log.h> -LOG_SETUP("thread_test"); +#include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/util/atomic.h> using namespace vespalib; diff --git a/vespamalloc/src/tests/thread/thread.cpp b/vespamalloc/src/tests/thread/thread.cpp index 6261a0f8eb6..9053a435d11 100644 --- a/vespamalloc/src/tests/thread/thread.cpp +++ b/vespamalloc/src/tests/thread/thread.cpp @@ -1,17 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <pthread.h> -#include <stdint.h> -#include <errno.h> -#include <vespa/vespalib/util/atomic.h> -#include <sys/resource.h> -#include <vespa/vespalib/testkit/testapp.h> -#include <vespa/log/log.h> -LOG_SETUP("thread_test"); +#include <vespa/vespalib/testkit/testapp.h> +#include <vespa/vespalib/util/atomic.h> using namespace vespalib; @@ -21,7 +11,7 @@ public: ~Test(); int Main() override; private: - virtual bool useIPCHelper() const override { return true; } + bool useIPCHelper() const override { return true; } }; Test::~Test() |