diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2019-02-25 15:47:20 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2019-02-25 15:47:20 +0100 |
commit | c8216d3820b04963ab7079a3bf74c540ab3632ad (patch) | |
tree | 53f77b234657538a215973da8488adabc805b1dc /staging_vespalib | |
parent | 3b12aa75bdce01b6303e521e401f87cc40a369e4 (diff) |
Eliminate some clang 7 warnings.
Diffstat (limited to 'staging_vespalib')
4 files changed, 7 insertions, 5 deletions
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); |