From be621ff4d3124c54fe86577a672f73522fd3323c Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 18 Aug 2017 23:09:43 +0200 Subject: Include what you need. --- vespalib/src/tests/stllike/hash_test.cpp | 1 + vespalib/src/tests/stllike/string_test.cpp | 1 + vespalib/src/vespa/vespalib/util/alloc.h | 8 +++----- vespalib/src/vespa/vespalib/util/array.h | 7 +------ vespalib/src/vespa/vespalib/util/array.hpp | 5 +++-- vespalib/src/vespa/vespalib/util/compress.h | 11 +++-------- vespalib/src/vespa/vespalib/websocket/request.cpp | 7 +++---- 7 files changed, 15 insertions(+), 25 deletions(-) (limited to 'vespalib') diff --git a/vespalib/src/tests/stllike/hash_test.cpp b/vespalib/src/tests/stllike/hash_test.cpp index 0159a9c50ab..b405ac84797 100644 --- a/vespalib/src/tests/stllike/hash_test.cpp +++ b/vespalib/src/tests/stllike/hash_test.cpp @@ -5,6 +5,7 @@ #include #include #include +#include using namespace vespalib; using std::make_pair; diff --git a/vespalib/src/tests/stllike/string_test.cpp b/vespalib/src/tests/stllike/string_test.cpp index c3a0dc9cfd7..2973ffd1ef1 100644 --- a/vespalib/src/tests/stllike/string_test.cpp +++ b/vespalib/src/tests/stllike/string_test.cpp @@ -2,6 +2,7 @@ #include #include +#include using namespace vespalib; diff --git a/vespalib/src/vespa/vespalib/util/alloc.h b/vespalib/src/vespa/vespalib/util/alloc.h index 7b078025e82..2c3de92c58e 100644 --- a/vespalib/src/vespa/vespalib/util/alloc.h +++ b/vespalib/src/vespa/vespalib/util/alloc.h @@ -1,14 +1,10 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include -#include #include #include -namespace vespalib { - -namespace alloc { +namespace vespalib::alloc { class MemoryAllocator { public: @@ -116,6 +112,8 @@ private: } +namespace vespalib { + inline size_t roundUp2inN(size_t minimum) { return 2ul << Optimized::msbIdx(minimum - 1); } diff --git a/vespalib/src/vespa/vespalib/util/array.h b/vespalib/src/vespa/vespalib/util/array.h index b766ed56844..23ce250642b 100644 --- a/vespalib/src/vespa/vespalib/util/array.h +++ b/vespalib/src/vespa/vespalib/util/array.h @@ -1,12 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include -#include -#include -#include -#include -#include +#include "alloc.h" namespace vespalib { diff --git a/vespalib/src/vespa/vespalib/util/array.hpp b/vespalib/src/vespa/vespalib/util/array.hpp index 86626f15b7c..771251f1675 100644 --- a/vespalib/src/vespa/vespalib/util/array.hpp +++ b/vespalib/src/vespa/vespalib/util/array.hpp @@ -2,8 +2,9 @@ #pragma once #include "array.h" -#include -#include +#include +#include +#include namespace vespalib { diff --git a/vespalib/src/vespa/vespalib/util/compress.h b/vespalib/src/vespa/vespalib/util/compress.h index 7480d4a8f89..f4190c999c3 100644 --- a/vespalib/src/vespa/vespalib/util/compress.h +++ b/vespalib/src/vespa/vespalib/util/compress.h @@ -2,12 +2,10 @@ #pragma once -#include -#include +#include +#include -namespace vespalib { - -namespace compress { +namespace vespalib::compress { class Integer { public: @@ -87,6 +85,3 @@ public: }; } - -} // namespace vespalib - diff --git a/vespalib/src/vespa/vespalib/websocket/request.cpp b/vespalib/src/vespa/vespalib/websocket/request.cpp index 733a8978ba6..98a6631bfcb 100644 --- a/vespalib/src/vespa/vespalib/websocket/request.cpp +++ b/vespalib/src/vespa/vespalib/websocket/request.cpp @@ -2,9 +2,9 @@ #include "request.h" #include +#include -namespace vespalib { -namespace ws { +namespace vespalib::ws { namespace { @@ -139,5 +139,4 @@ Request::is_ws_upgrade() const has_connection_token("upgrade")); } -} // namespace vespalib::ws -} // namespace vespalib +} -- cgit v1.2.3