summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-08-18 23:09:43 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-08-18 23:09:43 +0200
commitbe621ff4d3124c54fe86577a672f73522fd3323c (patch)
treea3bd524db43613518dd7ba840c233b8232a7a680 /vespalib
parented2c63f77550376ffcd062b429d0b180adfc8135 (diff)
Include what you need.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/stllike/hash_test.cpp1
-rw-r--r--vespalib/src/tests/stllike/string_test.cpp1
-rw-r--r--vespalib/src/vespa/vespalib/util/alloc.h8
-rw-r--r--vespalib/src/vespa/vespalib/util/array.h7
-rw-r--r--vespalib/src/vespa/vespalib/util/array.hpp5
-rw-r--r--vespalib/src/vespa/vespalib/util/compress.h11
-rw-r--r--vespalib/src/vespa/vespalib/websocket/request.cpp7
7 files changed, 15 insertions, 25 deletions
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 <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/vespalib/stllike/hash_map_equal.hpp>
#include <cstddef>
+#include <algorithm>
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 <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/stllike/string.h>
+#include <algorithm>
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 <sys/types.h>
-#include <algorithm>
#include <vespa/vespalib/util/optimized.h>
#include <memory>
-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 <cstdint>
-#include <sys/types.h>
-#include <algorithm>
-#include <vespa/vespalib/util/alloc.h>
-#include <vespa/vespalib/util/optimized.h>
-#include <tr1/type_traits>
+#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 <stdlib.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstring>
+#include <tr1/type_traits>
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 <stdint.h>
-#include <sys/types.h>
+#include <cstdint>
+#include <cstddef>
-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 <cassert>
+#include <algorithm>
-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
+}