summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-05-05 13:36:49 +0200
committerGitHub <noreply@github.com>2017-05-05 13:36:49 +0200
commit913b86690746327e0a84bba49c119e79b73d8724 (patch)
tree8f0d53f264ed6ed94aac4fdd5a725455ef810ca3
parentd5767ad5e56d37adfef230858e1935000f14f459 (diff)
parent03e6ceb166d95de462993d0df4086e317f28e030 (diff)
Merge pull request #2398 from yahoo/balder/register-is-not-allowed-in-iso-c++1z
Balder/register is not allowed in iso c++1z
-rw-r--r--config/src/vespa/config/print/fileconfigreader.hpp2
-rw-r--r--document/src/vespa/document/fieldvalue/numericfieldvalue.h2
-rw-r--r--eval/src/vespa/eval/eval/simple_tensor.h9
-rw-r--r--eval/src/vespa/eval/eval/tensor_engine.h7
-rw-r--r--fastos/src/tests/prefetchtest.cpp13
-rw-r--r--filedistribution/src/vespa/filedistribution/common/componentsdeleter.h4
-rw-r--r--searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp4
-rw-r--r--searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/fdispatch/search/query.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp1
-rw-r--r--searchlib/src/vespa/searchlib/bitcompression/pagedict4.h2
-rw-r--r--searchlib/src/vespa/searchlib/common/packets.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/datastore/unique_store.hpp9
-rw-r--r--searchlib/src/vespa/searchlib/features/dotproductfeature.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/features/dotproductfeature.h1
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/multisearch.cpp2
-rw-r--r--vespalib/src/tests/explore_modern_cpp/explore_modern_cpp_test.cpp1
-rw-r--r--vespalib/src/vespa/vespalib/util/bobhash.h8
-rw-r--r--vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp6
19 files changed, 42 insertions, 43 deletions
diff --git a/config/src/vespa/config/print/fileconfigreader.hpp b/config/src/vespa/config/print/fileconfigreader.hpp
index b05b7c99613..3f5af513f34 100644
--- a/config/src/vespa/config/print/fileconfigreader.hpp
+++ b/config/src/vespa/config/print/fileconfigreader.hpp
@@ -41,7 +41,7 @@ FileConfigReader<ConfigType>::read()
if (f.fail())
throw vespalib::IllegalArgumentException(std::string("Unable to open file ") + _fileName);
std::string line;
- while (getline(f, line)) {
+ for (std::getline(f, line); f; std::getline(f, line)) {
lines.push_back(line);
}
return std::unique_ptr<ConfigType>(new ConfigType(ConfigValue(lines, calculateContentMd5(lines))));
diff --git a/document/src/vespa/document/fieldvalue/numericfieldvalue.h b/document/src/vespa/document/fieldvalue/numericfieldvalue.h
index 38abb8c2d8b..027ff2a5521 100644
--- a/document/src/vespa/document/fieldvalue/numericfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/numericfieldvalue.h
@@ -31,7 +31,7 @@ protected:
public:
typedef Number value_type;
- NumericFieldValue(Number value=0) : NumericFieldValueBase(), _value(value) { }
+ NumericFieldValue(Number value=0) : NumericFieldValueBase(), _value(value), _altered(false) { }
value_type getValue() const { return _value; }
void setValue(Number newValue) { _value = newValue; }
diff --git a/eval/src/vespa/eval/eval/simple_tensor.h b/eval/src/vespa/eval/eval/simple_tensor.h
index a42413233af..a42e39d23a8 100644
--- a/eval/src/vespa/eval/eval/simple_tensor.h
+++ b/eval/src/vespa/eval/eval/simple_tensor.h
@@ -2,14 +2,15 @@
#pragma once
-#include <vespa/vespalib/stllike/string.h>
-#include <vespa/vespalib/util/stash.h>
-#include <memory>
-#include <map>
#include "value_type.h"
#include "tensor.h"
#include "tensor_spec.h"
#include "aggr.h"
+#include <vespa/vespalib/stllike/string.h>
+#include <vespa/vespalib/util/stash.h>
+#include <memory>
+#include <map>
+#include <functional>
namespace vespalib {
namespace eval {
diff --git a/eval/src/vespa/eval/eval/tensor_engine.h b/eval/src/vespa/eval/eval/tensor_engine.h
index a42bade2225..80e463e7989 100644
--- a/eval/src/vespa/eval/eval/tensor_engine.h
+++ b/eval/src/vespa/eval/eval/tensor_engine.h
@@ -2,12 +2,13 @@
#pragma once
-#include <memory>
-#include <vector>
-#include <vespa/vespalib/stllike/string.h>
#include "value_type.h"
#include "tensor_function.h"
#include "aggr.h"
+#include <vespa/vespalib/stllike/string.h>
+#include <memory>
+#include <vector>
+#include <functional>
namespace vespalib {
diff --git a/fastos/src/tests/prefetchtest.cpp b/fastos/src/tests/prefetchtest.cpp
index 5749ef2ae54..c5acc623874 100644
--- a/fastos/src/tests/prefetchtest.cpp
+++ b/fastos/src/tests/prefetchtest.cpp
@@ -12,25 +12,20 @@
* ALL RIGHTS RESERVED
*************************************************************************/
-
-
-#include <stdlib.h>
-#include <vespa/fastos/fastos.h>
#include "tests.h"
-
+#include <vespa/fastos/time.h>
+#include <vespa/fastos/prefetch.h>
class PrefetchTestApp : public BaseTest
{
-private:
-
public:
- virtual ~PrefetchTestApp() {};
+ virtual ~PrefetchTestApp() {}
bool PrefetchTest ()
{
bool rc = false;
int j, size, *a;
- register int or1, or2;
+ int or1, or2;
FastOS_Time start, stop;
double timeVal;
diff --git a/filedistribution/src/vespa/filedistribution/common/componentsdeleter.h b/filedistribution/src/vespa/filedistribution/common/componentsdeleter.h
index 46d79663536..6aed2641d37 100644
--- a/filedistribution/src/vespa/filedistribution/common/componentsdeleter.h
+++ b/filedistribution/src/vespa/filedistribution/common/componentsdeleter.h
@@ -1,13 +1,15 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
+#include "concurrentqueue.h"
+
#include <map>
#include <typeinfo>
#include <string>
#include <mutex>
#include <thread>
+#include <functional>
-#include "concurrentqueue.h"
namespace filedistribution {
/**
diff --git a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
index 315ec3f1a30..a03e24120ea 100644
--- a/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/maintenancecontroller/maintenancecontroller_test.cpp
@@ -175,7 +175,9 @@ struct MyBucketModifiedHandler : public IBucketModifiedHandler
BucketIdVector _modified;
virtual void notifyBucketModified(const BucketId &bucket) override {
BucketIdVector::const_iterator itr = std::find(_modified.begin(), _modified.end(), bucket);
- _modified.push_back(bucket);
+ if (itr == _modified.end()) {
+ _modified.push_back(bucket);
+ }
}
void reset() { _modified.clear(); }
};
diff --git a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp
index 35757cb43c7..b5f373efc9c 100644
--- a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp
+++ b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp
@@ -35,7 +35,7 @@ struct MockSearch : SearchIterator {
uint32_t last_seek = beginId();
uint32_t last_unpack = beginId();
MockSearch(const vespalib::string &term_in)
- : spec(0, 0, 0), term(term_in), _strict(vespalib::Trinary::True), tfmda(), postings_fetched(false) {}
+ : spec("", 0, 0), term(term_in), _strict(vespalib::Trinary::True), tfmda(), postings_fetched(false) {}
MockSearch(const FieldSpec &spec_in, const vespalib::string &term_in, bool strict_in,
const TermFieldMatchDataArray &tfmda_in, bool postings_fetched_in)
: spec(spec_in), term(term_in),
diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/query.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/query.cpp
index a7db4c21bd8..73057061391 100644
--- a/searchcore/src/vespa/searchcore/fdispatch/search/query.cpp
+++ b/searchcore/src/vespa/searchcore/fdispatch/search/query.cpp
@@ -17,9 +17,9 @@ FastS_query::FastS_query(void)
: _dataset(0),
_flags(0),
_stackDump(),
- _sortSpec(NULL),
+ _sortSpec(),
_groupSpec(),
- _location(NULL),
+ _location(),
_rankProperties(),
_featureOverrides()
{
@@ -29,9 +29,9 @@ FastS_query::FastS_query(const search::docsummary::GetDocsumArgs &docsumArgs)
: _dataset(0), // not known
_flags(docsumArgs.GetQueryFlags()),
_stackDump(docsumArgs.getStackDump()),
- _sortSpec(NULL), // not known
+ _sortSpec(), // not known
_groupSpec(), // not known
- _location(NULL),
+ _location(),
_rankProperties(docsumArgs.rankProperties()),
_featureOverrides(docsumArgs.featureOverrides())
{
diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp
index 698bdbf82d4..5b22809ab21 100644
--- a/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/singlenumericenumattribute.hpp
@@ -10,6 +10,7 @@
#include "attributeiterators.hpp"
#include <vespa/searchlib/queryeval/emptysearch.h>
#include <vespa/searchlib/query/queryterm.h>
+#include <vespa/searchlib/util/fileutil.hpp>
namespace search {
diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h
index 3bf7804e63f..f4012a2644b 100644
--- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h
+++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h
@@ -572,7 +572,7 @@ public:
uint32_t _l7Ref; // L7 entry before overflow, or self-ref if L6
L7Entry()
- : _l7Word(0),
+ : _l7Word(),
_l7StartOffset(),
_l7WordNum(0),
_l6Offset(0),
diff --git a/searchlib/src/vespa/searchlib/common/packets.cpp b/searchlib/src/vespa/searchlib/common/packets.cpp
index e2025f77e43..be5a9f5ef9d 100644
--- a/searchlib/src/vespa/searchlib/common/packets.cpp
+++ b/searchlib/src/vespa/searchlib/common/packets.cpp
@@ -213,7 +213,7 @@ FS4PersistentPacketStreamer::Encode(FNET_Packet *packet, uint32_t chid, FNET_Dat
FS4Properties::FS4Properties()
: _entries(),
- _name(0),
+ _name(),
_backing()
{ }
diff --git a/searchlib/src/vespa/searchlib/datastore/unique_store.hpp b/searchlib/src/vespa/searchlib/datastore/unique_store.hpp
index 388adf98105..56ec687e28d 100644
--- a/searchlib/src/vespa/searchlib/datastore/unique_store.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/unique_store.hpp
@@ -73,18 +73,11 @@ UniqueStore<EntryT, RefT>::find(const EntryType &value)
}
template <typename EntryT, typename RefT>
-EntryRef
-UniqueStore<EntryT, RefT>::move(EntryRef ref)
-{
- return _store.template allocator<EntryType>(_typeId).alloc(get(ref)).ref;
-}
-
-template <typename EntryT, typename RefT>
void
UniqueStore<EntryT, RefT>::remove(EntryRef ref)
{
assert(ref.valid());
- EntryType unused;
+ EntryType unused {};
Compare comp(_store, unused);
auto itr = _dict.lowerBound(ref, comp);
if (itr.valid() && itr.getKey() == ref) {
diff --git a/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp b/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp
index 3ff8dab9096..dfcd14fd247 100644
--- a/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp
+++ b/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp
@@ -58,6 +58,8 @@ DotProductExecutor<Vector, Buffer>::execute(uint32_t docId)
outputs().set_number(0, val);
}
+StringVector::StringVector() { }
+
StringVector::~StringVector() { }
}
diff --git a/searchlib/src/vespa/searchlib/features/dotproductfeature.h b/searchlib/src/vespa/searchlib/features/dotproductfeature.h
index 1aa7bd01b40..df57232bcfa 100644
--- a/searchlib/src/vespa/searchlib/features/dotproductfeature.h
+++ b/searchlib/src/vespa/searchlib/features/dotproductfeature.h
@@ -83,6 +83,7 @@ public:
**/
class StringVector : public VectorBase<vespalib::string, const char *, feature_t, ConstCharComparator> {
public:
+ StringVector();
~StringVector();
void insert(const vespalib::stringref & label, const vespalib::stringref & value) {
_vector.push_back(std::make_pair(label, util::strToNum<feature_t>(value)));
diff --git a/searchlib/src/vespa/searchlib/queryeval/multisearch.cpp b/searchlib/src/vespa/searchlib/queryeval/multisearch.cpp
index ff49efb4c01..3ba06875441 100644
--- a/searchlib/src/vespa/searchlib/queryeval/multisearch.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/multisearch.cpp
@@ -50,7 +50,7 @@ MultiSearch::deactivate(size_t idx)
assert(idx < _children.size());
delete _children[idx];
_children[idx] = _children.back();
- _children.resize(_children.size() - 1);
+ _children.pop_back();
return _children.size();
}
diff --git a/vespalib/src/tests/explore_modern_cpp/explore_modern_cpp_test.cpp b/vespalib/src/tests/explore_modern_cpp/explore_modern_cpp_test.cpp
index 05703b15641..172ec0acda5 100644
--- a/vespalib/src/tests/explore_modern_cpp/explore_modern_cpp_test.cpp
+++ b/vespalib/src/tests/explore_modern_cpp/explore_modern_cpp_test.cpp
@@ -1,5 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>
+#include <functional>
TEST("verify how std::function copies lambda closures") {
size_t count = 0;
diff --git a/vespalib/src/vespa/vespalib/util/bobhash.h b/vespalib/src/vespa/vespalib/util/bobhash.h
index bc4fc3876fc..c55f9086801 100644
--- a/vespalib/src/vespa/vespalib/util/bobhash.h
+++ b/vespalib/src/vespa/vespalib/util/bobhash.h
@@ -101,10 +101,10 @@ public:
*/
static uint32_t hash(const char *orig_k,
- register uint32_t length,
- register uint32_t initval) {
- register uint32_t a,b,c,len;
- register const unsigned char *k;
+ uint32_t length,
+ uint32_t initval) {
+ uint32_t a,b,c,len;
+ const unsigned char *k;
k = reinterpret_cast<const unsigned char *>(orig_k);
/* Set up the internal state */
diff --git a/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp b/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp
index 46a109c36e9..06f521ebab0 100644
--- a/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp
+++ b/vsm/src/vespa/vsm/searcher/futf8strchrfieldsearcher.cpp
@@ -84,7 +84,7 @@ FUTF8StrChrFieldSearcher::lfoldua(const char * toFold, size_t sz, char * folded,
namespace {
-inline const char * advance(const char * n, register const v16qi zero)
+inline const char * advance(const char * n, const v16qi zero)
{
uint32_t charMap = 0;
unsigned zeroCountSum = 0;
@@ -126,7 +126,7 @@ inline const char * advance(const char * n, register const v16qi zero)
size_t FUTF8StrChrFieldSearcher::match(const char *folded, size_t sz, QueryTerm & qt)
{
- register const v16qi _G_zero = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ const v16qi _G_zero = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
termcount_t words(0);
const char * term;
termsize_t tsz = qt.term(term);
@@ -170,7 +170,7 @@ size_t FUTF8StrChrFieldSearcher::match(const char *folded, size_t sz, QueryTerm
size_t FUTF8StrChrFieldSearcher::match(const char *folded, size_t sz, size_t mintsz, QueryTerm ** qtl, size_t qtlSize)
{
(void) mintsz;
- register const v16qi _G_zero = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ const v16qi _G_zero = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
termcount_t words(0);
const char * n = folded;
const char *e = n + sz;