From 76e6aaecb154c95637ed63ccb27d73006aa2ed0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Wed, 31 May 2017 07:52:45 +0200 Subject: [PATCH] use size_t to avoid int-narrowing --- libsrc/include/nginterface_v2.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libsrc/include/nginterface_v2.hpp b/libsrc/include/nginterface_v2.hpp index ca72a3f1..13d427f8 100644 --- a/libsrc/include/nginterface_v2.hpp +++ b/libsrc/include/nginterface_v2.hpp @@ -106,7 +106,7 @@ namespace netgen double * pt; public: Ng_Point (double * apt) : pt(apt) { ; } - double operator[] (int i) + double operator[] (size_t i) { return pt[i]; } operator const double * () { return pt; } }; @@ -122,11 +122,11 @@ namespace netgen class Ng_Elements { public: - int ne; + size_t ne; const int * ptr; - int Size() const { return ne; } - int operator[] (int i) const { return ptr[i]; } + size_t Size() const { return ne; } + int operator[] (size_t i) const { return ptr[i]; } }; @@ -146,8 +146,8 @@ namespace netgen public: const int * ptr; - int Size() const { return 2; } - int operator[] (int i) const { return ptr[i]-POINTINDEX_BASE; } + size_t Size() const { return 2; } + int operator[] (size_t i) const { return ptr[i]-POINTINDEX_BASE; } }; @@ -163,21 +163,21 @@ namespace netgen class Ng_Vertices { public: - int nv; + size_t nv; const int * ptr; - int Size() const { return nv; } - int operator[] (int i) const { return ptr[i]-POINTINDEX_BASE; } + size_t Size() const { return nv; } + int operator[] (size_t i) const { return ptr[i]-POINTINDEX_BASE; } }; class Ng_Edges { public: - int ned; + size_t ned; const int * ptr; - int Size() const { return ned; } - int operator[] (int i) const { return ptr[i]-1; } + size_t Size() const { return ned; } + int operator[] (size_t i) const { return ptr[i]-1; } };