X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOMEDSImpl%2FSALOMEDSImpl_AttributeSequenceOfReal.cxx;h=5d617b3841e1a84fc3607289ac40d512718cda45;hb=15a97ac169f8acd9cfcb6c4f9ef236d79c9d6a32;hp=05052ad749066932d2fc3ca1843722530eae0357;hpb=63414a08d9492c25c206579c1953ec6f390679fd;p=modules%2Fkernel.git diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx index 05052ad74..5d617b384 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -26,6 +26,7 @@ // #include "SALOMEDSImpl_AttributeSequenceOfReal.hxx" #include +#include //======================================================================= //function : GetID @@ -122,7 +123,7 @@ void SALOMEDSImpl_AttributeSequenceOfReal::ChangeValue(const int Index,const dou CheckLocked(); Backup(); - if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range"); + if(Index <= 0 || Index > (int)myValue.size()) throw DFexception("Out of range"); // TODO: mismatch signed/unsigned myValue[Index-1] = Value; @@ -143,7 +144,7 @@ void SALOMEDSImpl_AttributeSequenceOfReal::Remove(const int Index) CheckLocked(); Backup(); - if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range"); + if(Index <= 0 || Index > (int)myValue.size()) throw DFexception("Out of range"); // TODO: mismatch signed/unsigned typedef std::vector::iterator VI; int i = 1; @@ -159,12 +160,12 @@ void SALOMEDSImpl_AttributeSequenceOfReal::Remove(const int Index) int SALOMEDSImpl_AttributeSequenceOfReal::Length() { - return myValue.size(); + return (int)myValue.size(); //!< TODO: conversion from size_t to int, possible loss of data } double SALOMEDSImpl_AttributeSequenceOfReal::Value(const int Index) { - if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range"); + if(Index <= 0 || Index > (int)myValue.size()) throw DFexception("Out of range"); // TODO: mismatch signed/unsigned return myValue[Index-1]; } @@ -174,7 +175,7 @@ std::string SALOMEDSImpl_AttributeSequenceOfReal::Save() int aLength = Length(); char* aResult = new char[aLength * 127]; aResult[0] = 0; - int aPosition = 0; + size_t aPosition = 0; for (int i = 1; i <= aLength; i++) { sprintf(aResult + aPosition , "%.64e ", Value(i)); aPosition += strlen(aResult + aPosition);