From 2da18e49aa2c0c5f1395877967da0d95ecb49db6 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 14 Nov 2017 21:47:56 +0100 Subject: [PATCH] fix warning --- src/3rdParty/libkdtree/kdtree++/kdtree.hpp | 8 ++++---- src/Base/QuantityPyImp.cpp | 2 +- src/Base/Tools.cpp | 3 +-- src/Base/UnitsApiPy.cpp | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/3rdParty/libkdtree/kdtree++/kdtree.hpp b/src/3rdParty/libkdtree/kdtree++/kdtree.hpp index 501bfd518a..7da719334c 100644 --- a/src/3rdParty/libkdtree/kdtree++/kdtree.hpp +++ b/src/3rdParty/libkdtree/kdtree++/kdtree.hpp @@ -473,10 +473,10 @@ namespace KDTree } const_iterator - find_within_range_iterative(const_reference __a, const_reference __b) - { - return const_iterator(begin()); - } + find_within_range_iterative(const_reference /*__a*/, const_reference /*__b*/) + { + return const_iterator(begin()); + } template _OutputIterator diff --git a/src/Base/QuantityPyImp.cpp b/src/Base/QuantityPyImp.cpp index 81a7bbc0ec..fb53ee7dcf 100644 --- a/src/Base/QuantityPyImp.cpp +++ b/src/Base/QuantityPyImp.cpp @@ -633,7 +633,7 @@ void QuantityPy::setFormat(Py::Tuple arg) throw Py::ValueError("Invalid format character"); bool ok; - fmt.format = Base::QuantityFormat::toFormat(fmtstr.front(), &ok); + fmt.format = Base::QuantityFormat::toFormat(fmtstr[0], &ok); if (!ok) throw Py::ValueError("Invalid format character"); diff --git a/src/Base/Tools.cpp b/src/Base/Tools.cpp index edbf8416d0..2a45de076c 100644 --- a/src/Base/Tools.cpp +++ b/src/Base/Tools.cpp @@ -153,7 +153,6 @@ std::string Base::Tools::escapedUnicodeFromUtf8(const char *s) return escapedstr; PyObject* escaped = PyUnicode_AsUnicodeEscapeString(unicode); - if (escaped) { #if PY_MAJOR_VERSION >= 3 escapedstr = std::string(PyBytes_AsString(escaped)); @@ -162,8 +161,8 @@ std::string Base::Tools::escapedUnicodeFromUtf8(const char *s) #endif Py_DECREF(escaped); } - Py_DECREF(unicode); + Py_DECREF(unicode); return escapedstr; } diff --git a/src/Base/UnitsApiPy.cpp b/src/Base/UnitsApiPy.cpp index 159e387ff1..a0659efba4 100644 --- a/src/Base/UnitsApiPy.cpp +++ b/src/Base/UnitsApiPy.cpp @@ -209,7 +209,7 @@ PyObject* UnitsApi::sSchemaTranslate(PyObject * /*self*/, PyObject *args,PyObjec quant = *static_cast(q)->getQuantityPtr(); std::unique_ptr schema(createSchema(static_cast(index))); - if (!schema) { + if (!schema.get()) { PyErr_SetString(PyExc_ValueError, "invalid schema value"); return 0; }