summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-05-02 14:41:51 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-05-02 14:41:51 +0200
commitae440378fa719074c4bdfde612bd1169bbcc5586 (patch)
tree6343e7bf788fb2d29a31ffff486e33b959f6a110 /eval
parent0f646f10b377b90fc37e9911f9fe383d112ff157 (diff)
Fix warnings hidden earlier due to including application headers as system includes
Diffstat (limited to 'eval')
-rw-r--r--eval/src/tests/eval/function/function_test.cpp8
-rw-r--r--eval/src/tests/eval/value_cache/value_cache_test.cpp8
-rw-r--r--eval/src/tests/eval/value_type/value_type_test.cpp6
-rw-r--r--eval/src/tests/tensor/tensor_serialization/tensor_serialization_test.cpp2
-rw-r--r--eval/src/vespa/eval/eval/interpreted_function.cpp5
-rw-r--r--eval/src/vespa/eval/eval/interpreted_function.h2
-rw-r--r--eval/src/vespa/eval/tensor/dense/mutable_dense_tensor_view.cpp3
-rw-r--r--eval/src/vespa/eval/tensor/dense/mutable_dense_tensor_view.h2
-rw-r--r--eval/src/vespa/eval/tensor/sparse/direct_sparse_tensor_builder.h2
-rw-r--r--eval/src/vespa/eval/tensor/tensor_address.cpp5
-rw-r--r--eval/src/vespa/eval/tensor/tensor_address.h14
11 files changed, 40 insertions, 17 deletions
diff --git a/eval/src/tests/eval/function/function_test.cpp b/eval/src/tests/eval/function/function_test.cpp
index 773b3e17d2e..964c48b670b 100644
--- a/eval/src/tests/eval/function/function_test.cpp
+++ b/eval/src/tests/eval/function/function_test.cpp
@@ -374,7 +374,7 @@ TEST("require that Call children can be accessed") {
struct MyNodeHandler : public NodeHandler {
std::vector<nodes::Node_UP> nodes;
- virtual void handle(nodes::Node_UP node) override {
+ void handle(nodes::Node_UP node) override {
if (node.get() != nullptr) {
nodes.push_back(std::move(node));
}
@@ -657,9 +657,9 @@ struct MySymbolExtractor : SymbolExtractor {
}
MySymbolExtractor() : extra(), invoke_count() {}
explicit MySymbolExtractor(std::initializer_list<char> extra_in) : extra(extra_in), invoke_count() {}
- virtual void extract_symbol(const char *pos_in, const char *end_in,
- const char *&pos_out, vespalib::string &symbol_out)
- const override
+
+ void extract_symbol(const char *pos_in, const char *end_in,
+ const char *&pos_out, vespalib::string &symbol_out) const override
{
++invoke_count;
for (; pos_in < end_in; ++pos_in) {
diff --git a/eval/src/tests/eval/value_cache/value_cache_test.cpp b/eval/src/tests/eval/value_cache/value_cache_test.cpp
index 4a4b8e286e8..c766f3afc73 100644
--- a/eval/src/tests/eval/value_cache/value_cache_test.cpp
+++ b/eval/src/tests/eval/value_cache/value_cache_test.cpp
@@ -29,7 +29,7 @@ TEST_FF("require that values can be created", MyFactory(), ConstantValueCache(f1
EXPECT_EQUAL(1.0, res->value().as_double());
EXPECT_EQUAL(2.0, f2.create("2", "type")->value().as_double());
EXPECT_EQUAL(3.0, f2.create("3", "type")->value().as_double());
- EXPECT_EQUAL(3, f1.create_cnt);
+ EXPECT_EQUAL(3u, f1.create_cnt);
}
TEST_FF("require that underlying values can be shared", MyFactory(), ConstantValueCache(f1)) {
@@ -41,7 +41,7 @@ TEST_FF("require that underlying values can be shared", MyFactory(), ConstantVal
EXPECT_EQUAL(2.0, res2->value().as_double());
EXPECT_EQUAL(2.0, res2->value().as_double());
EXPECT_EQUAL(2.0, res2->value().as_double());
- EXPECT_EQUAL(2, f1.create_cnt);
+ EXPECT_EQUAL(2u, f1.create_cnt);
}
TEST_FF("require that unused values are evicted", MyFactory(), ConstantValueCache(f1)) {
@@ -49,7 +49,7 @@ TEST_FF("require that unused values are evicted", MyFactory(), ConstantValueCach
EXPECT_EQUAL(2.0, f2.create("2", "type")->value().as_double());
EXPECT_EQUAL(2.0, f2.create("2", "type")->value().as_double());
EXPECT_EQUAL(2.0, f2.create("2", "type")->value().as_double());
- EXPECT_EQUAL(4, f1.create_cnt);
+ EXPECT_EQUAL(4u, f1.create_cnt);
}
TEST_FF("require that type spec is part of cache key", MyFactory(), ConstantValueCache(f1)) {
@@ -61,7 +61,7 @@ TEST_FF("require that type spec is part of cache key", MyFactory(), ConstantValu
EXPECT_EQUAL(2.0, res2->value().as_double());
EXPECT_EQUAL(2.0, res2->value().as_double());
EXPECT_EQUAL(2.0, res2->value().as_double());
- EXPECT_EQUAL(3, f1.create_cnt);
+ EXPECT_EQUAL(3u, f1.create_cnt);
}
TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/eval/src/tests/eval/value_type/value_type_test.cpp b/eval/src/tests/eval/value_type/value_type_test.cpp
index b72b5a3a972..2c3a8ce6152 100644
--- a/eval/src/tests/eval/value_type/value_type_test.cpp
+++ b/eval/src/tests/eval/value_type/value_type_test.cpp
@@ -65,9 +65,9 @@ TEST("require that dimension index can be obtained") {
EXPECT_EQUAL(ValueType::double_type().dimension_index("x"), ValueType::Dimension::npos);
EXPECT_EQUAL(ValueType::tensor_type({}).dimension_index("x"), ValueType::Dimension::npos);
auto my_type = ValueType::tensor_type({{"y", 10}, {"x"}, {"z", 0}});
- EXPECT_EQUAL(my_type.dimension_index("x"), 0);
- EXPECT_EQUAL(my_type.dimension_index("y"), 1);
- EXPECT_EQUAL(my_type.dimension_index("z"), 2);
+ EXPECT_EQUAL(my_type.dimension_index("x"), 0u);
+ EXPECT_EQUAL(my_type.dimension_index("y"), 1u);
+ EXPECT_EQUAL(my_type.dimension_index("z"), 2u);
EXPECT_EQUAL(my_type.dimension_index("w"), ValueType::Dimension::npos);
}
diff --git a/eval/src/tests/tensor/tensor_serialization/tensor_serialization_test.cpp b/eval/src/tests/tensor/tensor_serialization/tensor_serialization_test.cpp
index b072b8ec3f8..b27221f6ba5 100644
--- a/eval/src/tests/tensor/tensor_serialization/tensor_serialization_test.cpp
+++ b/eval/src/tests/tensor/tensor_serialization/tensor_serialization_test.cpp
@@ -82,7 +82,7 @@ struct Fixture
BuilderType builder;
nbostream wrapStream(stream.peek(), stream.size());
auto formatId = wrapStream.getInt1_4Bytes();
- ASSERT_EQUAL(formatId, 1); // sparse format
+ ASSERT_EQUAL(formatId, 1u); // sparse format
SparseBinaryFormat::deserialize(wrapStream, builder);
EXPECT_TRUE(wrapStream.size() == 0);
auto ret = builder.build();
diff --git a/eval/src/vespa/eval/eval/interpreted_function.cpp b/eval/src/vespa/eval/eval/interpreted_function.cpp
index 82d34e1017d..cbc2bf69d8d 100644
--- a/eval/src/vespa/eval/eval/interpreted_function.cpp
+++ b/eval/src/vespa/eval/eval/interpreted_function.cpp
@@ -10,7 +10,6 @@
#include <vespa/vespalib/util/benchmark_timer.h>
#include <set>
-
namespace vespalib {
namespace eval {
@@ -523,6 +522,8 @@ InterpretedFunction::SimpleParams::SimpleParams(const std::vector<double> &param
InterpretedFunction::SimpleParams::~SimpleParams() { }
+InterpretedFunction::SimpleObjectParams::~SimpleObjectParams() {}
+
const Value &
InterpretedFunction::SimpleParams::resolve(size_t idx, Stash &stash) const
{
@@ -582,6 +583,8 @@ InterpretedFunction::InterpretedFunction(const TensorEngine &engine, const nodes
root.traverse(program_builder);
}
+InterpretedFunction::~InterpretedFunction() {}
+
const Value &
InterpretedFunction::eval(Context &ctx, const LazyParams &params) const
{
diff --git a/eval/src/vespa/eval/eval/interpreted_function.h b/eval/src/vespa/eval/eval/interpreted_function.h
index 540f8212256..cab3221131d 100644
--- a/eval/src/vespa/eval/eval/interpreted_function.h
+++ b/eval/src/vespa/eval/eval/interpreted_function.h
@@ -50,6 +50,7 @@ public:
struct SimpleObjectParams : LazyParams {
std::vector<Value::CREF> params;
explicit SimpleObjectParams(const std::vector<Value::CREF> &params_in) : params(params_in) {}
+ ~SimpleObjectParams();
const Value &resolve(size_t idx, Stash &stash) const override;
};
struct State {
@@ -104,6 +105,7 @@ public:
InterpretedFunction(const TensorEngine &engine, const Function &function, const NodeTypes &types)
: InterpretedFunction(engine, function.root(), function.num_params(), types) {}
InterpretedFunction(InterpretedFunction &&rhs) = default;
+ ~InterpretedFunction();
size_t program_size() const { return _program.size(); }
size_t num_params() const { return _num_params; }
const Value &eval(Context &ctx, const LazyParams &params) const;
diff --git a/eval/src/vespa/eval/tensor/dense/mutable_dense_tensor_view.cpp b/eval/src/vespa/eval/tensor/dense/mutable_dense_tensor_view.cpp
index 582bb25db53..98faab5e61b 100644
--- a/eval/src/vespa/eval/tensor/dense/mutable_dense_tensor_view.cpp
+++ b/eval/src/vespa/eval/tensor/dense/mutable_dense_tensor_view.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 <vespa/fastos/fastos.h>
#include "mutable_dense_tensor_view.h"
using vespalib::eval::ValueType;
@@ -20,6 +19,8 @@ MutableDenseTensorView::MutableValueType::MutableValueType(ValueType type_in)
}
}
+MutableDenseTensorView::MutableValueType::~MutableValueType() {}
+
MutableDenseTensorView::MutableDenseTensorView(ValueType type_in)
: DenseTensorView(_concreteType.type(), CellsRef()),
_concreteType(type_in)
diff --git a/eval/src/vespa/eval/tensor/dense/mutable_dense_tensor_view.h b/eval/src/vespa/eval/tensor/dense/mutable_dense_tensor_view.h
index f5580d45e77..453ef9b6bc5 100644
--- a/eval/src/vespa/eval/tensor/dense/mutable_dense_tensor_view.h
+++ b/eval/src/vespa/eval/tensor/dense/mutable_dense_tensor_view.h
@@ -3,6 +3,7 @@
#pragma once
#include "dense_tensor_view.h"
+#include <cassert>
namespace vespalib {
namespace tensor {
@@ -21,6 +22,7 @@ private:
public:
MutableValueType(eval::ValueType type_in);
+ ~MutableValueType();
const eval::ValueType &type() const { return _type; }
void setUnboundDimensions(const uint32_t *unboundDimSizeBegin, const uint32_t *unboundDimSizeEnd) {
const uint32_t *unboundDimSizePtr = unboundDimSizeBegin;
diff --git a/eval/src/vespa/eval/tensor/sparse/direct_sparse_tensor_builder.h b/eval/src/vespa/eval/tensor/sparse/direct_sparse_tensor_builder.h
index aeee5b63d42..270537c5ea7 100644
--- a/eval/src/vespa/eval/tensor/sparse/direct_sparse_tensor_builder.h
+++ b/eval/src/vespa/eval/tensor/sparse/direct_sparse_tensor_builder.h
@@ -88,6 +88,8 @@ public:
}
}
+ ~DirectTensorBuilder() {}
+
Tensor::UP build() {
return std::make_unique<SparseTensor>(std::move(_type),
std::move(_cells),
diff --git a/eval/src/vespa/eval/tensor/tensor_address.cpp b/eval/src/vespa/eval/tensor/tensor_address.cpp
index 10bd1bc082a..7e7c9bd1157 100644
--- a/eval/src/vespa/eval/tensor/tensor_address.cpp
+++ b/eval/src/vespa/eval/tensor/tensor_address.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 <vespa/fastos/fastos.h>
#include "tensor_address.h"
#include <algorithm>
#include <ostream>
@@ -10,11 +9,15 @@ namespace tensor {
const vespalib::string TensorAddress::Element::UNDEFINED_LABEL = "(undefined)";
+TensorAddress::Element::~Element() {}
+
TensorAddress::TensorAddress()
: _elements()
{
}
+TensorAddress::~TensorAddress() {}
+
TensorAddress::TensorAddress(const Elements &elements_in)
: _elements(elements_in)
{
diff --git a/eval/src/vespa/eval/tensor/tensor_address.h b/eval/src/vespa/eval/tensor/tensor_address.h
index 07f6d5b88ea..52c38256985 100644
--- a/eval/src/vespa/eval/tensor/tensor_address.h
+++ b/eval/src/vespa/eval/tensor/tensor_address.h
@@ -34,6 +34,11 @@ public:
Element(const vespalib::string &dimension_in, const vespalib::string &label_in)
: _dimension(dimension_in), _label(label_in)
{}
+ Element(const Element &) = default;
+ Element & operator = (const Element &) = default;
+ Element(Element &&) = default;
+ Element & operator = (Element &&) = default;
+ ~Element();
const vespalib::string &dimension() const { return _dimension; }
const vespalib::string &label() const { return _label; }
bool operator<(const Element &rhs) const {
@@ -65,8 +70,13 @@ public:
explicit TensorAddress(const Elements &elements_in);
explicit TensorAddress(Elements &&elements_in)
: _elements(std::move(elements_in))
- {
- }
+ {}
+ TensorAddress(const TensorAddress &) = default;
+ TensorAddress & operator = (const TensorAddress &) = default;
+ TensorAddress(TensorAddress &&) = default;
+ TensorAddress & operator = (TensorAddress &&) = default;
+
+ ~TensorAddress();
const Elements &elements() const { return _elements; }
bool hasDimension(const vespalib::string &dimension) const;
bool operator<(const TensorAddress &rhs) const;