From a88658989245cfd4fd695669e063827c14863d13 Mon Sep 17 00:00:00 2001 From: Justin Carpentier <justin.carpentier@inria.fr> Date: Fri, 13 Aug 2021 11:31:14 +0200 Subject: [PATCH] all: fix compilation warnings --- include/eigenpy/numpy-type.hpp | 2 +- include/eigenpy/numpy.hpp | 2 +- include/eigenpy/user-type.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/eigenpy/numpy-type.hpp b/include/eigenpy/numpy-type.hpp index bef0f187..805d1dd1 100644 --- a/include/eigenpy/numpy-type.hpp +++ b/include/eigenpy/numpy-type.hpp @@ -20,7 +20,7 @@ namespace eigenpy template<typename Scalar> bool np_type_is_convertible_into_scalar(const int np_type) { - if(NumpyEquivalentType<Scalar>::type_code >= NPY_USERDEF) + if(static_cast<NPY_TYPES>(NumpyEquivalentType<Scalar>::type_code) >= NPY_USERDEF) return np_type == Register::getTypeCode<Scalar>(); if(NumpyEquivalentType<Scalar>::type_code == np_type) diff --git a/include/eigenpy/numpy.hpp b/include/eigenpy/numpy.hpp index 8abb4c99..84c7575d 100644 --- a/include/eigenpy/numpy.hpp +++ b/include/eigenpy/numpy.hpp @@ -33,7 +33,7 @@ namespace eigenpy int EIGENPY_DLLAPI PyArray_TypeNum(PyTypeObject * type); // By default, the Scalar is considered as a Python object - template <typename Scalar> struct NumpyEquivalentType { enum { type_code = NPY_USERDEF };}; + template <typename Scalar> struct NumpyEquivalentType { enum { type_code = NPY_USERDEF };}; template <> struct NumpyEquivalentType<float> { enum { type_code = NPY_FLOAT };}; template <> struct NumpyEquivalentType< std::complex<float> > { enum { type_code = NPY_CFLOAT };}; diff --git a/include/eigenpy/user-type.hpp b/include/eigenpy/user-type.hpp index 9f2acc8a..a9b0ece5 100644 --- a/include/eigenpy/user-type.hpp +++ b/include/eigenpy/user-type.hpp @@ -17,7 +17,7 @@ namespace eigenpy { static To run(const From & from) { - return static_cast<To>(from); + return (To)from; } }; -- GitLab