From f2b36c2ed2d477607851ddca6c0b136791031669 Mon Sep 17 00:00:00 2001 From: Dean Moldovan Date: Wed, 1 Jun 2016 23:03:10 +0200 Subject: [PATCH] Fix a couple of warnings - Conversion warning on clang: 'long' to 'size_t' - Unused variable warning on MSVC --- example/issues.cpp | 2 +- include/pybind11/descr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/issues.cpp b/example/issues.cpp index dfe20fff8..d75da1cef 100644 --- a/example/issues.cpp +++ b/example/issues.cpp @@ -135,7 +135,7 @@ void init_issues(py::module &m) { try { py::class_(m2, "Placeholder"); throw std::logic_error("Expected an exception!"); - } catch (std::runtime_error &e) { + } catch (std::runtime_error &) { /* All good */ } } diff --git a/include/pybind11/descr.h b/include/pybind11/descr.h index 1b65f68c8..6c1d86432 100644 --- a/include/pybind11/descr.h +++ b/include/pybind11/descr.h @@ -139,7 +139,7 @@ protected: const T *it = ptr; while (*it++ != (T) 0) ; - return it - ptr; + return static_cast(it - ptr); } const std::type_info **m_types = nullptr;