Salome HOME
launchConfigureParser.py: Setup gui log file via environment variable.
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeSequenceOfReal.cxx
index 6c7bc5568e8f19f6e94c01d8d0bbf831b866fc6b..ccda92cbb8bdab4a6b23716d3a3f392dcb9000f7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  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
@@ -123,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;
   
@@ -144,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<double>::iterator VI;
   int i = 1;    
@@ -160,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];
 }
 
@@ -175,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);