X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXAO%2FXAO_Field.cxx;h=cc7087c7b0fac16e8e510fb7600471dd27bdae04;hb=52b0fdb3bbe3b4ca84519c9dd752f89a73bf6c05;hp=3fa7c8c1990d57bb2a9cdf12abf3bc9fdf87f785;hpb=5b6031b015602aa07f5a6fc668c13ac3faf7a8a9;p=modules%2Fshaper.git diff --git a/src/XAO/XAO_Field.cxx b/src/XAO/XAO_Field.cxx index 3fa7c8c19..cc7087c7b 100644 --- a/src/XAO/XAO_Field.cxx +++ b/src/XAO/XAO_Field.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2013-2020 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -34,18 +34,17 @@ using namespace XAO; // ------------------------------------------------------- Field::Field(const XAO::Dimension& dimension, - const int& nbElements, const int& nbComponents, const std::string& name) - : m_name(name), m_dimension(dimension), m_nbElements(nbElements), m_nbComponents(nbComponents) + const int& nbElements, const int& nbComponents, const std::string& name) + : m_name(name), m_dimension(dimension), + m_nbComponents(nbComponents), m_components(nbComponents, ""), + m_nbElements(nbElements) { - m_components.reserve(nbComponents); - for (int i = 0; i < nbComponents; ++i) - m_components.push_back(""); } Field::~Field() { - for (unsigned int i = 0; i < m_steps.size(); ++i) - delete m_steps[i]; + for (unsigned int i = 0; i < m_steps.size(); ++i) + delete m_steps[i]; } Field* Field::createField(const XAO::Type& type, const XAO::Dimension& dimension, @@ -83,7 +82,7 @@ throw (XAO_Exception) { for (unsigned int i = 0; i < names.size(); ++i) { - if (i < m_nbComponents) + if ((int)i < m_nbComponents) m_components[i] = names[i]; } } @@ -130,7 +129,7 @@ throw (XAO_Exception) void Field::checkStepIndex(const int& step) throw (XAO_Exception) { - if (step < m_steps.size() && step >= 0) + if (step < (int)m_steps.size() && step >= 0) return; throw XAO_Exception(MsgBuilder() << "Step index is out of range [0, "