1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0023373: MSVC++ warnings issued during compilation for 64bits, 'Sparse Arrays'

Replaced 'Standard_Integer' with 'Standard_Size' to avoid compiler warning.
Removed redundant casting to 'Standard_Size'.
Removed code checking if a 'Standard_Size' variable is negative.
This commit is contained in:
Pawel
2012-08-24 14:18:55 +04:00
parent 6318e884de
commit d93f7683c9
5 changed files with 38 additions and 42 deletions

View File

@@ -82,7 +82,7 @@ Handle(TObj_TIntSparseArray) TObj_TIntSparseArray::Set
//purpose :
//=======================================================================
void TObj_TIntSparseArray::SetValue (const Standard_Integer theId,
void TObj_TIntSparseArray::SetValue (const Standard_Size theId,
const Standard_Integer theValue)
{
// check that modification is allowed
@@ -128,7 +128,7 @@ void TObj_TIntSparseArray::SetValue (const Standard_Integer theId,
//purpose :
//=======================================================================
void TObj_TIntSparseArray::UnsetValue (const Standard_Integer theId)
void TObj_TIntSparseArray::UnsetValue (const Standard_Size theId)
{
// check that modification is allowed
if ( !Label().Data()->IsModificationAllowed() )
@@ -182,7 +182,7 @@ void TObj_TIntSparseArray::Clear ()
TObj_TIntSparseArray_VecOfData::Iterator anIt (myVector);
for (; anIt.More(); anIt.Next())
{
Standard_Integer anId = anIt.Key();
Standard_Size anId = anIt.Key();
Standard_Integer aVal = anIt.Value();
backupValue(anId, aVal, AbsentValue);
}
@@ -196,7 +196,7 @@ void TObj_TIntSparseArray::Clear ()
//purpose :
//=======================================================================
void TObj_TIntSparseArray::backupValue (const Standard_Integer theId,
void TObj_TIntSparseArray::backupValue (const Standard_Size theId,
const Standard_Integer theCurrValue,
const Standard_Integer theNewValue)
{
@@ -257,7 +257,7 @@ void TObj_TIntSparseArray::Restore(const Handle(TDF_Attribute)& theDelta)
TObj_TIntSparseArray_MapOfData::Iterator anIt (aDelta->myOldMap);
for (; anIt.More(); anIt.Next())
{
Standard_Integer anId = anIt.Key();
Standard_Size anId = anIt.Key();
Standard_Integer anOld = anIt.Value();
if (anOld == AbsentValue)
UnsetValue (anId);

View File

@@ -62,7 +62,7 @@ class TObj_TIntSparseArray : public TDF_Attribute
//! Methods for access to data
//! Returns the number of stored values in the set
Standard_EXPORT Standard_Integer Size() const
Standard_EXPORT Standard_Size Size() const
{ return myVector.Size(); }
typedef TObj_TIntSparseArray_VecOfData::ConstIterator Iterator;
@@ -71,22 +71,22 @@ class TObj_TIntSparseArray : public TDF_Attribute
Iterator GetIterator() const { return Iterator(myVector); }
//! Returns true if the value with the given ID is present.
Standard_Boolean HasValue (const Standard_Integer theId) const
Standard_Boolean HasValue (const Standard_Size theId) const
{ return myVector.HasValue(theId); }
//! Returns the value by its ID.
//! Raises an exception if no value is stored with this ID
Standard_Integer Value (const Standard_Integer theId) const
Standard_Integer Value (const Standard_Size theId) const
{ return myVector.Value(theId); }
//! Sets the value with the given ID.
//! Raises an exception if theId is not positive
Standard_EXPORT void SetValue (const Standard_Integer theId,
Standard_EXPORT void SetValue (const Standard_Size theId,
const Standard_Integer theValue);
//! Unsets the value with the given ID.
//! Raises an exception if theId is not positive
Standard_EXPORT void UnsetValue(const Standard_Integer theId);
Standard_EXPORT void UnsetValue(const Standard_Size theId);
//! Clears the set
Standard_EXPORT void Clear ();
@@ -142,7 +142,7 @@ class TObj_TIntSparseArray : public TDF_Attribute
};
//! backup one value
void backupValue (const Standard_Integer theId,
void backupValue (const Standard_Size theId,
const Standard_Integer theCurrValue,
const Standard_Integer theNewValue);