summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2019-02-25 15:47:20 +0100
committerTor Egge <Tor.Egge@broadpark.no>2019-02-25 15:47:20 +0100
commitc8216d3820b04963ab7079a3bf74c540ab3632ad (patch)
tree53f77b234657538a215973da8488adabc805b1dc
parent3b12aa75bdce01b6303e521e401f87cc40a369e4 (diff)
Eliminate some clang 7 warnings.
-rw-r--r--messagebus/src/vespa/messagebus/message.h4
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/handle.h5
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/identifiable.cpp3
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.h1
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/xmlstream.cpp3
-rw-r--r--vbench/src/tests/app_dumpurl/app_dumpurl_test.cpp1
-rw-r--r--vbench/src/tests/http_client/http_client_test.cpp2
-rw-r--r--vbench/src/tests/socket/socket_test.cpp1
-rw-r--r--vbench/src/vbench/core/handler.cpp2
-rw-r--r--vbench/src/vbench/core/line_reader.h3
-rw-r--r--vbench/src/vbench/core/provider.cpp2
-rw-r--r--vbench/src/vbench/core/socket.cpp4
-rw-r--r--vbench/src/vbench/core/socket.h17
-rw-r--r--vbench/src/vbench/http/http_client.h2
-rw-r--r--vbench/src/vbench/http/http_connection.h1
-rw-r--r--vbench/src/vbench/http/http_connection_pool.h1
-rw-r--r--vbench/src/vbench/test/simple_http_result_handler.h4
-rw-r--r--vbench/src/vbench/vbench/request_scheduler.cpp3
-rw-r--r--vbench/src/vbench/vbench/request_scheduler.h1
-rw-r--r--vbench/src/vbench/vbench/vbench.cpp2
-rw-r--r--vespalib/src/vespa/vespalib/test/time_tracer.h4
21 files changed, 42 insertions, 24 deletions
diff --git a/messagebus/src/vespa/messagebus/message.h b/messagebus/src/vespa/messagebus/message.h
index ebb2e7b6027..e7e7d74033e 100644
--- a/messagebus/src/vespa/messagebus/message.h
+++ b/messagebus/src/vespa/messagebus/message.h
@@ -29,8 +29,8 @@ public:
* Constructs a new instance of this class.
*/
Message();
- Message(Message &&) noexcept = default;
- Message & operator = (Message &&) noexcept = default;
+ Message(Message &&) = default;
+ Message & operator = (Message &&) = default;
/**
* If a message is deleted with elements on the callstack, this destructor
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/handle.h b/staging_vespalib/src/vespa/vespalib/metrics/handle.h
index 3e32945ceed..8ba2197a55b 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/handle.h
+++ b/staging_vespalib/src/vespa/vespalib/metrics/handle.h
@@ -20,10 +20,13 @@ public:
explicit Handle(size_t id) : _id(id) {}
size_t id() const { return _id; }
- static constexpr Handle empty_handle = Handle();
+ static const Handle empty_handle;
};
template <typename T>
+const Handle<T> Handle<T>::empty_handle;
+
+template <typename T>
bool
operator< (const Handle<T> &a, const Handle<T> &b) noexcept
{
diff --git a/staging_vespalib/src/vespa/vespalib/objects/identifiable.cpp b/staging_vespalib/src/vespa/vespalib/objects/identifiable.cpp
index 84bdc0a45d0..6cc2af1fc90 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/identifiable.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/identifiable.cpp
@@ -116,12 +116,13 @@ Identifiable::RuntimeClass::RuntimeClass(RuntimeInfo * info_) :
{
if (_rt->_factory) {
Identifiable::UP tmp(create());
+ Identifiable &tmpref = *tmp;
assert(id() == tmp->getClass().id());
//printf("Class %s has typeinfo %s\n", name(), typeid(*tmp).name());
for (const RuntimeInfo * curr = _rt; curr && curr != curr->_base; curr = curr->_base) {
//printf("\tinherits %s : typeinfo = %s\n", curr->_name, curr->_typeId().name());
if ( ! curr->_tryCast(tmp.get()) ) {
- throw std::runtime_error(make_string("(%s, %s) is not a baseclass of (%s, %s)", curr->_name, curr->_typeId().name(), name(), typeid(*tmp).name()));
+ throw std::runtime_error(make_string("(%s, %s) is not a baseclass of (%s, %s)", curr->_name, curr->_typeId().name(), name(), typeid(tmpref).name()));
}
}
}
diff --git a/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.h b/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.h
index beb7e93d343..d32afeeabee 100644
--- a/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.h
+++ b/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.h
@@ -88,7 +88,6 @@ private:
Alloc _buffer;
uint32_t _position;
- double _growFactor;
};
}
diff --git a/staging_vespalib/src/vespa/vespalib/util/xmlstream.cpp b/staging_vespalib/src/vespa/vespalib/util/xmlstream.cpp
index 6399faeefec..c4c18a762af 100644
--- a/staging_vespalib/src/vespa/vespalib/util/xmlstream.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/xmlstream.cpp
@@ -117,7 +117,7 @@ bool isLegalName(const std::string& name) {
void convertToLegalName(std::string& name) {
if (name.size() == 0) {
- name == "__no_name__";
+ name = "__no_name__";
} else {
if (!legalIdentifierFirstChar[static_cast<uint8_t>(name[0])]) {
name[0] = '_';
@@ -450,7 +450,6 @@ template XmlAttribute::XmlAttribute(const std::string &, std::string, unsigned i
template XmlAttribute::XmlAttribute(const std::string &, vespalib::string, unsigned int);
template XmlAttribute::XmlAttribute(const std::string &, vespalib::stringref, unsigned int);
template XmlAttribute::XmlAttribute(const std::string &, CharP, unsigned int);
-template XmlAttribute::XmlAttribute(const std::string &, ConstCharP, unsigned int);
template XmlAttribute::XmlAttribute(const std::string &, bool, unsigned int);
template XmlAttribute::XmlAttribute(const std::string &, int16_t, unsigned int);
template XmlAttribute::XmlAttribute(const std::string &, int32_t, unsigned int);
diff --git a/vbench/src/tests/app_dumpurl/app_dumpurl_test.cpp b/vbench/src/tests/app_dumpurl/app_dumpurl_test.cpp
index 15453078b35..0b4a83bf714 100644
--- a/vbench/src/tests/app_dumpurl/app_dumpurl_test.cpp
+++ b/vbench/src/tests/app_dumpurl/app_dumpurl_test.cpp
@@ -9,6 +9,7 @@ using vespalib::SlaveProc;
using InputReader = vespalib::InputReader;
using OutputWriter = vespalib::OutputWriter;
+using vespalib::SimpleBuffer;
auto null_crypto = std::make_shared<vespalib::NullCryptoEngine>();
diff --git a/vbench/src/tests/http_client/http_client_test.cpp b/vbench/src/tests/http_client/http_client_test.cpp
index 36e04e012a0..1398b1ebc74 100644
--- a/vbench/src/tests/http_client/http_client_test.cpp
+++ b/vbench/src/tests/http_client/http_client_test.cpp
@@ -8,6 +8,8 @@ using namespace vbench;
using InputReader = vespalib::InputReader;
using OutputWriter = vespalib::OutputWriter;
+using vespalib::SimpleBuffer;
+
auto null_crypto = std::make_shared<vespalib::NullCryptoEngine>();
void checkMemory(const string &expect, const Memory &mem) {
diff --git a/vbench/src/tests/socket/socket_test.cpp b/vbench/src/tests/socket/socket_test.cpp
index 8623c946c84..bcdaecdc7dc 100644
--- a/vbench/src/tests/socket/socket_test.cpp
+++ b/vbench/src/tests/socket/socket_test.cpp
@@ -11,6 +11,7 @@ auto null_crypto = std::make_shared<vespalib::NullCryptoEngine>();
auto tls_crypto = std::make_shared<vespalib::TlsCryptoEngine>(vespalib::test::make_tls_options_for_testing());
using OutputWriter = vespalib::OutputWriter;
+using vespalib::CryptoEngine;
const size_t numLines = 100;
diff --git a/vbench/src/vbench/core/handler.cpp b/vbench/src/vbench/core/handler.cpp
index 124bbf69841..5f6127f6a32 100644
--- a/vbench/src/vbench/core/handler.cpp
+++ b/vbench/src/vbench/core/handler.cpp
@@ -10,6 +10,6 @@ struct DummyItem {};
} // namespace vbench::<unnamed>
-template class Handler<DummyItem>;
+template struct Handler<DummyItem>;
} // namespace vbench
diff --git a/vbench/src/vbench/core/line_reader.h b/vbench/src/vbench/core/line_reader.h
index 348971626e6..0f4b0d40ede 100644
--- a/vbench/src/vbench/core/line_reader.h
+++ b/vbench/src/vbench/core/line_reader.h
@@ -8,7 +8,6 @@
namespace vbench {
using Input = vespalib::Input;
-using InputReader = vespalib::InputReader;
/**
* Concrete utility class used to read individual lines of text from
@@ -17,6 +16,8 @@ using InputReader = vespalib::InputReader;
**/
class LineReader
{
+public:
+ using InputReader = vespalib::InputReader;
private:
InputReader _input;
diff --git a/vbench/src/vbench/core/provider.cpp b/vbench/src/vbench/core/provider.cpp
index f547263cbb7..b5ad275ecd7 100644
--- a/vbench/src/vbench/core/provider.cpp
+++ b/vbench/src/vbench/core/provider.cpp
@@ -10,6 +10,6 @@ struct DummyItem {};
} // namespace vbench::<unnamed>
-template class Provider<DummyItem>;
+template struct Provider<DummyItem>;
} // namespace vbench
diff --git a/vbench/src/vbench/core/socket.cpp b/vbench/src/vbench/core/socket.cpp
index a11e03c5b22..822b96b2c07 100644
--- a/vbench/src/vbench/core/socket.cpp
+++ b/vbench/src/vbench/core/socket.cpp
@@ -48,7 +48,7 @@ Socket::~Socket()
}
}
-Memory
+Socket::Memory
Socket::obtain()
{
if ((_input.get().size == 0) && !_eof && !_taint) {
@@ -72,7 +72,7 @@ Socket::evict(size_t bytes)
return *this;
}
-WritableMemory
+Socket::WritableMemory
Socket::reserve(size_t bytes)
{
return _output.reserve(bytes);
diff --git a/vbench/src/vbench/core/socket.h b/vbench/src/vbench/core/socket.h
index 337384776c2..0e8848e8292 100644
--- a/vbench/src/vbench/core/socket.h
+++ b/vbench/src/vbench/core/socket.h
@@ -13,16 +13,17 @@
namespace vbench {
-using Input = vespalib::Input;
-using Memory = vespalib::Memory;
-using Output = vespalib::Output;
-using SimpleBuffer = vespalib::SimpleBuffer;
-using WritableMemory = vespalib::WritableMemory;
-using CryptoEngine = vespalib::CryptoEngine;
-using SyncCryptoSocket = vespalib::SyncCryptoSocket;
class Socket : public Stream
{
+public:
+ using Input = vespalib::Input;
+ using Memory = vespalib::Memory;
+ using Output = vespalib::Output;
+ using SimpleBuffer = vespalib::SimpleBuffer;
+ using WritableMemory = vespalib::WritableMemory;
+ using CryptoEngine = vespalib::CryptoEngine;
+ using SyncCryptoSocket = vespalib::SyncCryptoSocket;
private:
SyncCryptoSocket::UP _socket;
SimpleBuffer _input;
@@ -43,6 +44,8 @@ public:
};
struct ServerSocket {
+ using CryptoEngine = vespalib::CryptoEngine;
+ using SyncCryptoSocket = vespalib::SyncCryptoSocket;
vespalib::ServerSocket server_socket;
ServerSocket() : server_socket(0) {}
int port() const { return server_socket.address().port(); }
diff --git a/vbench/src/vbench/http/http_client.h b/vbench/src/vbench/http/http_client.h
index 77a53057740..9feb3167611 100644
--- a/vbench/src/vbench/http/http_client.h
+++ b/vbench/src/vbench/http/http_client.h
@@ -16,6 +16,8 @@ namespace vbench {
**/
class HttpClient
{
+public:
+ using CryptoEngine = vespalib::CryptoEngine;
private:
static const size_t WRITE_SIZE = 2000;
diff --git a/vbench/src/vbench/http/http_connection.h b/vbench/src/vbench/http/http_connection.h
index b2742c3e0fd..fe768b3dbfe 100644
--- a/vbench/src/vbench/http/http_connection.h
+++ b/vbench/src/vbench/http/http_connection.h
@@ -21,6 +21,7 @@ private:
double _lastUsed;
public:
+ using CryptoEngine = vespalib::CryptoEngine;
typedef std::unique_ptr<HttpConnection> UP;
HttpConnection(CryptoEngine &crypto, const ServerSpec &server);
diff --git a/vbench/src/vbench/http/http_connection_pool.h b/vbench/src/vbench/http/http_connection_pool.h
index 919eceb1fef..5dd9eb6361c 100644
--- a/vbench/src/vbench/http/http_connection_pool.h
+++ b/vbench/src/vbench/http/http_connection_pool.h
@@ -20,6 +20,7 @@ class HttpConnectionPool
private:
typedef vespalib::ArrayQueue<HttpConnection::UP> Queue;
typedef std::map<ServerSpec, size_t> Map;
+ using CryptoEngine = vespalib::CryptoEngine;
vespalib::Lock _lock;
Map _map;
diff --git a/vbench/src/vbench/test/simple_http_result_handler.h b/vbench/src/vbench/test/simple_http_result_handler.h
index a387ba29e95..d8185aae363 100644
--- a/vbench/src/vbench/test/simple_http_result_handler.h
+++ b/vbench/src/vbench/test/simple_http_result_handler.h
@@ -8,10 +8,10 @@
namespace vbench {
-using SimpleBuffer = vespalib::SimpleBuffer;
-
class SimpleHttpResultHandler : public HttpResultHandler
{
+public:
+ using SimpleBuffer = vespalib::SimpleBuffer;
private:
std::vector<std::pair<string, string> > _headers;
SimpleBuffer _content;
diff --git a/vbench/src/vbench/vbench/request_scheduler.cpp b/vbench/src/vbench/vbench/request_scheduler.cpp
index e12d89c1c04..9cd778789ec 100644
--- a/vbench/src/vbench/vbench/request_scheduler.cpp
+++ b/vbench/src/vbench/vbench/request_scheduler.cpp
@@ -49,7 +49,8 @@ RequestScheduler::abort()
void
RequestScheduler::handle(Request::UP request)
{
- _queue.insert(std::move(request), request->scheduledTime());
+ double scheduledTime = request->scheduledTime();
+ _queue.insert(std::move(request), scheduledTime);
}
void
diff --git a/vbench/src/vbench/vbench/request_scheduler.h b/vbench/src/vbench/vbench/request_scheduler.h
index f7f4a542d6f..2f9e9177c53 100644
--- a/vbench/src/vbench/vbench/request_scheduler.h
+++ b/vbench/src/vbench/vbench/request_scheduler.h
@@ -34,6 +34,7 @@ private:
void run() override;
public:
typedef std::unique_ptr<RequestScheduler> UP;
+ using CryptoEngine = vespalib::CryptoEngine;
RequestScheduler(CryptoEngine::SP crypto, Handler<Request> &next, size_t numWorkers);
void abort();
void handle(Request::UP request) override;
diff --git a/vbench/src/vbench/vbench/vbench.cpp b/vbench/src/vbench/vbench/vbench.cpp
index f04b3bcca7f..4f6efadfbdd 100644
--- a/vbench/src/vbench/vbench/vbench.cpp
+++ b/vbench/src/vbench/vbench/vbench.cpp
@@ -4,6 +4,8 @@
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/net/tls/tls_crypto_engine.h>
+using vespalib::CryptoEngine;
+
namespace vbench {
namespace {
diff --git a/vespalib/src/vespa/vespalib/test/time_tracer.h b/vespalib/src/vespa/vespalib/test/time_tracer.h
index c872ed84bbc..2e3a2d9e351 100644
--- a/vespalib/src/vespa/vespalib/test/time_tracer.h
+++ b/vespalib/src/vespa/vespalib/test/time_tracer.h
@@ -128,13 +128,13 @@ private:
class ThreadState {
private:
uint32_t _thread_id;
- mutable std::atomic_flag _lock;
+ mutable std::atomic_flag _lock = ATOMIC_FLAG_INIT;
vespalib::Stash _stash;
const LogEntry * _list;
public:
using UP = std::unique_ptr<ThreadState>;
ThreadState(uint32_t thread_id)
- : _thread_id(thread_id), _lock{ATOMIC_FLAG_INIT}, _stash(64 * 1024), _list(nullptr) {}
+ : _thread_id(thread_id), _stash(64 * 1024), _list(nullptr) {}
uint32_t thread_id() const { return _thread_id; }
const LogEntry *get_log_entries() const {
Guard guard(_lock);