diff --git a/src/VrmlData/VrmlData_ArrayVec3d.hxx b/src/VrmlData/VrmlData_ArrayVec3d.hxx index e8e2fc5883..5dd8d0e1e3 100755 --- a/src/VrmlData/VrmlData_ArrayVec3d.hxx +++ b/src/VrmlData/VrmlData_ArrayVec3d.hxx @@ -46,7 +46,7 @@ class VrmlData_ArrayVec3d : public VrmlData_Node */ inline VrmlData_ArrayVec3d (const VrmlData_Scene& theScene, const char * theName, - const size_t nVec, + const Standard_Size nVec, const gp_XYZ * arrVec) : VrmlData_Node (theScene, theName), myArray (arrVec), @@ -56,7 +56,7 @@ class VrmlData_ArrayVec3d : public VrmlData_Node /** * Query the number of vectors */ - inline size_t Length () const { return myLength; } + inline Standard_Size Length () const { return myLength; } /** * Query the array @@ -74,7 +74,7 @@ class VrmlData_ArrayVec3d : public VrmlData_Node /** * Set the array data */ - inline void SetValues (const size_t nValues, + inline void SetValues (const Standard_Size nValues, const gp_XYZ * arrValues) { myLength = nValues; myArray = arrValues; } @@ -116,7 +116,7 @@ class VrmlData_ArrayVec3d : public VrmlData_Node * @return * the vector for the index. If index irrelevant, returns (0., 0., 0.) */ - Standard_EXPORT const gp_XYZ& Value (const Standard_Integer i) const; + Standard_EXPORT const gp_XYZ& Value (const Standard_Size i) const; protected: // ---------- PROTECTED FIELDS ---------- diff --git a/src/VrmlData/VrmlData_Geometry.cxx b/src/VrmlData/VrmlData_Geometry.cxx index 5154d1a778..ca634a52ed 100755 --- a/src/VrmlData/VrmlData_Geometry.cxx +++ b/src/VrmlData/VrmlData_Geometry.cxx @@ -69,14 +69,10 @@ IMPLEMENT_STANDARD_RTTIEXT (VrmlData_TextureCoordinate, VrmlData_Node) //purpose : //======================================================================= -const gp_XYZ& VrmlData_ArrayVec3d::Value (const Standard_Integer i) const +const gp_XYZ& VrmlData_ArrayVec3d::Value (const Standard_Size i) const { - size_t anIndex = (size_t)i; - if (anIndex < 0 || anIndex >= myLength) { - static gp_XYZ anOrigin (0., 0., 0.); - return anOrigin; - } - return myArray[i]; + static gp_XYZ anOrigin (0., 0., 0.); + return i < myLength ? myArray[i] : anOrigin; } //=======================================================================