Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/DataExchange/TKDESTL/RWStl/RWStl_Reader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ bool RWStl_Reader::ReadAscii(Standard_IStream& theStream,

gp_XYZ aVertex[3];
bool isEOF = false;
for (int i = 0; i < 3; i++)
for (auto& i : aVertex)
{
aLine = theBuffer.ReadLine(theStream, aLineLen);
if (aLine == nullptr)
Expand All @@ -370,7 +370,7 @@ bool RWStl_Reader::ReadAscii(Standard_IStream& theStream,
+ aNbLine);
return false;
}
aVertex[i] = aReadVertex;
i = aReadVertex;
}

// stop reading if end of file is reached;
Expand Down
12 changes: 6 additions & 6 deletions src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -731,20 +731,20 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadXYZ(VrmlData_InBuffer& theBuffer,
{
double aVal[3] = {0., 0., 0.};
VrmlData_ErrorStatus aStatus = VrmlData_StatusOK;
for (int i = 0; i < 3; i++)
for (double& i : aVal)
{
if (!VrmlData_Node::OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
break;
char* endptr;
aVal[i] = Strtod(theBuffer.LinePtr, &endptr);
i = Strtod(theBuffer.LinePtr, &endptr);
if (endptr == theBuffer.LinePtr)
{
aStatus = VrmlData_NumericInputError;
break;
}
else
{
if (isOnlyPos && aVal[i] < 0.001 * Precision::Confusion())
if (isOnlyPos && i < 0.001 * Precision::Confusion())
{
aStatus = VrmlData_IrrelevantNumber;
break;
Expand Down Expand Up @@ -775,20 +775,20 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadXY(VrmlData_InBuffer& theBuffer,
{
double aVal[2] = {0., 0.};
VrmlData_ErrorStatus aStatus = VrmlData_StatusOK;
for (int i = 0; i < 2; i++)
for (double& i : aVal)
{
if (!VrmlData_Node::OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
break;
char* endptr;
aVal[i] = Strtod(theBuffer.LinePtr, &endptr);
i = Strtod(theBuffer.LinePtr, &endptr);
if (endptr == theBuffer.LinePtr)
{
aStatus = VrmlData_NumericInputError;
break;
}
else
{
if (isOnlyPos && aVal[i] < 0.001 * Precision::Confusion())
if (isOnlyPos && i < 0.001 * Precision::Confusion())
{
aStatus = VrmlData_IrrelevantNumber;
break;
Expand Down
6 changes: 3 additions & 3 deletions src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_Editor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,15 @@ void XCAFDoc_Editor::CloneMetaData(
occ::handle<XCAFDoc_ColorTool> aSrcColorTool = XCAFDoc_DocumentTool::ColorTool(theSrcLabel);
occ::handle<XCAFDoc_ColorTool> aDstColorTool = XCAFDoc_DocumentTool::ColorTool(theDstLabel);
const XCAFDoc_ColorType aTypes[] = {XCAFDoc_ColorGen, XCAFDoc_ColorSurf, XCAFDoc_ColorCurv};
for (int anInd = 0; anInd < 3; anInd++)
for (auto aType : aTypes)
{
TDF_Label aColorL;
aSrcColorTool->GetColor(theSrcLabel, aTypes[anInd], aColorL);
aSrcColorTool->GetColor(theSrcLabel, aType, aColorL);
if (!aColorL.IsNull())
{
Quantity_ColorRGBA aColor;
aSrcColorTool->GetColor(aColorL, aColor);
aDstColorTool->SetColor(theDstLabel, aColor, aTypes[anInd]);
aDstColorTool->SetColor(theDstLabel, aColor, aType);
}
}
aDstColorTool->SetVisibility(theDstLabel, aSrcColorTool->IsVisible(theSrcLabel));
Expand Down
4 changes: 2 additions & 2 deletions src/DataExchange/TKXSBase/Interface/Interface_FloatWriter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ int Interface_FloatWriter::Convert(const double val,
char lxp[anMasSize], *pText;
int i0 = 0, j0 = 0;

for (int i = 0; i < anMasSize; ++i)
lxp[i] = '\0';
for (char& i : lxp)
i = '\0';

pText = (char*)text;
//
Expand Down
4 changes: 2 additions & 2 deletions src/FoundationClasses/TKMath/BSplCLib/BSplCLib.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4657,8 +4657,8 @@ struct UnitWeightsArray
constexpr UnitWeightsArray()
: Data{}
{
for (int i = 0; i < 2049; ++i)
Data[i] = 1.0;
for (double& i : Data)
i = 1.0;
}
};

Expand Down
6 changes: 3 additions & 3 deletions src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,10 @@ Bnd_Box Bnd_Box::Transformed(const gp_Trsf& T) const
gp_Pnt(Xmin, Ymax, Zmax),
gp_Pnt(Xmax, Ymax, Zmax),
};
for (int aCornerIter = 0; aCornerIter < 8; ++aCornerIter)
for (auto& aCorner : aCorners)
{
aCorners[aCornerIter].Transform(T);
aNewBox.Add(aCorners[aCornerIter]);
aCorner.Transform(T);
aNewBox.Add(aCorner);
}
}
aNewBox.Gap = Gap;
Expand Down
18 changes: 9 additions & 9 deletions src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ class OBBTool
Project(theAxis, theMin, theMax);
else
{
for (int i = 0; i < myNbExtremalPoints; ++i)
for (const auto& myLExtremalPoint : myLExtremalPoints)
{
double aPrm = theAxis.Dot(myLExtremalPoints[i]);
double aPrm = theAxis.Dot(myLExtremalPoint);
if (aPrm < theMin)
theMin = aPrm;
if (aPrm > theMax)
Expand Down Expand Up @@ -475,8 +475,8 @@ void OBBTool::ComputeExtremePoints()
// created by the maximally distant extreme points
if (!myOptimal)
{
for (int i = 0; i < 5; i++)
myTriIdx[i] = INT_MAX;
for (int& i : myTriIdx)
i = INT_MAX;

// Compute myTriIdx[0] and myTriIdx[1].
double aMaxSqDist = -1.0;
Expand Down Expand Up @@ -895,12 +895,12 @@ bool Bnd_OBB::IsOut(const Bnd_OBB& theOther) const
const double aTolNull = Epsilon(1.0);

// Check the axes produced by the cross products
for (int i = 0; i < 3; ++i)
for (const auto& myAxe : myAxes)
{
for (int j = 0; j < 3; ++j)
for (const auto& j : theOther.myAxes)
{
// Separating axis
gp_XYZ aLAxe = myAxes[i].Crossed(theOther.myAxes[j]);
gp_XYZ aLAxe = myAxe.Crossed(j);

const double aNorm = aLAxe.Modulus();
if (aNorm < aTolNull)
Expand Down Expand Up @@ -955,9 +955,9 @@ bool Bnd_OBB::IsCompletelyInside(const Bnd_OBB& theOther) const

gp_Pnt aVert[8];
theOther.GetVertex(aVert);
for (int i = 0; i < 8; i++)
for (const auto& i : aVert)
{
if (IsOut(aVert[i]))
if (IsOut(i))
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/FoundationClasses/TKMath/MathSys/MathSys_Newton4D.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ NewtonResultN<4> Solve4D(const Function& theFunc,
if (aStepNorm > aMaxStep)
{
const double aScale = aMaxStep / aStepNorm;
for (int i = 0; i < 4; ++i)
for (double& i : aDelta)
{
aDelta[i] *= aScale;
i *= aScale;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/FoundationClasses/TKMath/Poly/Poly_MergeNodesTool.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ inline bool Poly_MergeNodesTool::MergedNodesMap::Bind(int&
CellVec3i(-1, 1, -1), CellVec3i(1, 1, -1), CellVec3i(-1, -1, 1), CellVec3i(1, -1, 1),
CellVec3i(-1, 1, 1), CellVec3i(1, 1, 1)};
const CellVec3i anIndexCnt = vec3ToCell(thePos);
for (int aNeigIter = 0; aNeigIter < 26; ++aNeigIter)
for (const auto& aNeigIter : THE_NEIGHBRS)
{
const CellVec3i anIndex = anIndexCnt + THE_NEIGHBRS[aNeigIter];
const CellVec3i anIndex = anIndexCnt + aNeigIter;
const size_t aHashEx = vec3iHashCode(anIndex, NbBuckets());
for (DataMapNode* aNodeIter = aData[aHashEx]; aNodeIter != nullptr;
aNodeIter = (DataMapNode*)aNodeIter->Next())
Expand Down
4 changes: 2 additions & 2 deletions src/FoundationClasses/TKMath/Poly/Poly_Triangulation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ void Poly_Triangulation::ComputeNormals()
const gp_XYZ aTriNorm = aVec01 ^ aVec02;
const NCollection_Vec3<float> aNorm3f =
NCollection_Vec3<float>(float(aTriNorm.X()), float(aTriNorm.Y()), float(aTriNorm.Z()));
for (int aNodeIter = 0; aNodeIter < 3; ++aNodeIter)
for (int aNodeIter : anElem)
{
myNormals.ChangeValue(anElem[aNodeIter] - 1) += aNorm3f;
myNormals.ChangeValue(aNodeIter - 1) += aNorm3f;
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/FoundationClasses/TKernel/GTests/Handle_Advanced_Test.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -324,17 +324,17 @@ TEST_F(HandleAdvancedTest, HandleArrayOperations)
EXPECT_EQ(5, aHandleVector.size());

// Test that all handles are valid and point to correct types
for (size_t i = 0; i < aHandleVector.size(); ++i)
for (const auto& i : aHandleVector)
{
EXPECT_FALSE(aHandleVector[i].IsNull());
EXPECT_FALSE(i.IsNull());

// Test polymorphic behavior
EXPECT_TRUE(aHandleVector[i]->IsKind("QaClass00_50"));
EXPECT_TRUE(i->IsKind("QaClass00_50"));

// Test dynamic casting
occ::handle<QaClass00_50> aCast = aHandleVector[i];
occ::handle<QaClass00_50> aCast = i;
EXPECT_FALSE(aCast.IsNull());
EXPECT_EQ(aHandleVector[i].get(), aCast.get());
EXPECT_EQ(i.get(), aCast.get());
}

// Test specific type casting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,9 @@ TEST(NCollection_IndexedMapTest, BeginEndIterator)

// Test begin/end iteration
std::set<int> aFoundKeys;
for (auto it = aMap.begin(); it != aMap.end(); ++it)
for (int it : aMap)
{
aFoundKeys.insert(*it);
aFoundKeys.insert(it);
}

EXPECT_EQ(3u, aFoundKeys.size());
Expand Down
Loading
Loading