X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXAO%2FXAO_Field.cxx;h=0ef35b169edc08f13262ec80dceff3b923e6a741;hb=ca41e707752199349b9fc79864d4c17b7271660d;hp=770bd3305f51278ff2d93951137f6901ac56dcdb;hpb=8a586f4d9d7eb6830c3fa8952c099a79349cf623;p=modules%2Fshaper.git diff --git a/src/XAO/XAO_Field.cxx b/src/XAO/XAO_Field.cxx index 770bd3305..0ef35b169 100644 --- a/src/XAO/XAO_Field.cxx +++ b/src/XAO/XAO_Field.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // 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, "