Skip to content
Snippets Groups Projects
Commit 8103ae63 authored by Adrien Béraud's avatar Adrien Béraud Committed by Adrien Béraud
Browse files

EnumClass: fix warning

Change-Id: I691a69db206103821187b8d8f76459e046ac9b9f
parent b5b95ad5
No related branches found
No related tags found
No related merge requests found
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef ENUM_CLASS_UTILS_H #pragma once
#define ENUM_CLASS_UTILS_H
#include <map>
#include "logger.h" #include "logger.h"
#include <map>
#include <type_traits> #include <type_traits>
#include <vector> #include <vector>
#include <cassert> #include <cassert>
...@@ -30,10 +30,9 @@ namespace jami { ...@@ -30,10 +30,9 @@ namespace jami {
/** /**
* This function adds a safe way to get an enum class size * This function adds a safe way to get an enum class size
* @note it cannot be unsigned to avoid some compiler warnings
*/ */
template<typename A> template<typename A>
constexpr inline int constexpr inline size_t
enum_class_size() enum_class_size()
{ {
return size_t(A::COUNT__); return size_t(A::COUNT__);
...@@ -65,7 +64,7 @@ struct Matrix1D ...@@ -65,7 +64,7 @@ struct Matrix1D
class EnumClassIter class EnumClassIter
{ {
public: public:
EnumClassIter(const Matrix1D<Row, Value, A>* p_vec, int pos) EnumClassIter(const Matrix1D<Row, Value, A>* p_vec, size_t pos)
: pos_(pos) : pos_(pos)
, p_vec_(p_vec) , p_vec_(p_vec)
{} {}
...@@ -75,7 +74,7 @@ struct Matrix1D ...@@ -75,7 +74,7 @@ struct Matrix1D
const EnumClassIter& operator++(); const EnumClassIter& operator++();
private: private:
int pos_; size_t pos_;
const Matrix1D<Row, Value, A>* p_vec_; const Matrix1D<Row, Value, A>* p_vec_;
}; };
...@@ -112,7 +111,7 @@ struct Matrix0D ...@@ -112,7 +111,7 @@ struct Matrix0D
class EnumClassIter class EnumClassIter
{ {
public: public:
EnumClassIter(const Matrix0D<EnumClass>* p_vec, int pos) EnumClassIter(const Matrix0D<EnumClass>* p_vec, size_t pos)
: pos_(pos) : pos_(pos)
, p_vec_(p_vec) , p_vec_(p_vec)
{} {}
...@@ -122,7 +121,7 @@ struct Matrix0D ...@@ -122,7 +121,7 @@ struct Matrix0D
const EnumClassIter& operator++(); const EnumClassIter& operator++();
private: private:
int pos_; size_t pos_;
const Matrix0D<EnumClass>* p_vec_; const Matrix0D<EnumClass>* p_vec_;
}; };
...@@ -308,5 +307,3 @@ Matrix1D<Row, Value, Accessor>::end() ...@@ -308,5 +307,3 @@ Matrix1D<Row, Value, Accessor>::end()
} }
} // namespace jami } // namespace jami
#endif // ENUM_CLASS_UTILS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment