-// Copyright (C) 2007-2012 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
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
#include <string.h>
+#include <stdlib.h>
//=======================================================================
//function : GetID
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;
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;
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];
}
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);