Skip to content

Commit 3d21820

Browse files
committed
Coding - Apply Clang-Tidy automatic fixes
Flags: aChecks="modernize-deprecated-headers,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nullptr,modernize-use-override,performance-avoid-endl,performance-move-constructor-init,readability-braces-around-statements,readability-delete-null-pointer,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-string-init,readability-static-accessed-through-instance" clang-tidy version: 22.1.3
1 parent 2cafd4f commit 3d21820

3,436 files changed

Lines changed: 95764 additions & 2933 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/ApplicationFramework/TKBin/BinDrivers/BinDrivers_DocumentRetrievalDriver.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,22 @@ void BinDrivers_DocumentRetrievalDriver::EnableQuickPartReading(
100100
bool theValue)
101101
{
102102
if (myDrivers.IsNull())
103+
{
103104
myDrivers = AttributeDrivers(theMessageDriver);
105+
}
104106
if (myDrivers.IsNull())
107+
{
105108
return;
109+
}
106110

107111
occ::handle<BinMDF_ADriver> aDriver;
108112
myDrivers->GetDriver(STANDARD_TYPE(TNaming_NamedShape), aDriver);
109113
occ::handle<BinMNaming_NamedShapeDriver> aShapesDriver =
110114
occ::down_cast<BinMNaming_NamedShapeDriver>(aDriver);
111115
if (aShapesDriver.IsNull())
116+
{
112117
throw Standard_NotImplemented("Internal Error - TNaming_NamedShape is not found!");
118+
}
113119

114120
aShapesDriver->EnableQuickPart(theValue);
115121
}

src/ApplicationFramework/TKBin/BinMDataXtd/BinMDataXtd_ConstraintDriver.cxx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,16 @@ bool BinMDataXtd_ConstraintDriver::Paste(const BinObjMgt_Persistent& theSo
5353

5454
// value
5555
if (!(theSource >> aNb))
56+
{
5657
return false;
58+
}
5759
if (aNb > 0)
5860
{
5961
occ::handle<TDataStd_Real> aTValue;
6062
if (theRelocTable.IsBound(aNb))
63+
{
6164
aTValue = occ::down_cast<TDataStd_Real>(theRelocTable.Find(aNb));
65+
}
6266
else
6367
{
6468
aTValue = new TDataStd_Real;
@@ -70,17 +74,23 @@ bool BinMDataXtd_ConstraintDriver::Paste(const BinObjMgt_Persistent& theSo
7074
// geometries
7175
int NbGeom;
7276
if (!(theSource >> NbGeom))
77+
{
7378
return false;
79+
}
7480
int iG = 1;
7581
while (iG <= NbGeom)
7682
{
7783
if (!(theSource >> aNb))
84+
{
7885
return false;
86+
}
7987
if (aNb > 0)
8088
{
8189
occ::handle<TNaming_NamedShape> aG;
8290
if (theRelocTable.IsBound(aNb))
91+
{
8392
aG = occ::down_cast<TNaming_NamedShape>(theRelocTable.Find(aNb));
93+
}
8494
else
8595
{
8696
aG = new TNaming_NamedShape;
@@ -92,12 +102,16 @@ bool BinMDataXtd_ConstraintDriver::Paste(const BinObjMgt_Persistent& theSo
92102

93103
// plane
94104
if (!(theSource >> aNb))
105+
{
95106
return false;
107+
}
96108
if (aNb > 0)
97109
{
98110
occ::handle<TNaming_NamedShape> aTPlane;
99111
if (theRelocTable.IsBound(aNb))
112+
{
100113
aTPlane = occ::down_cast<TNaming_NamedShape>(theRelocTable.Find(aNb));
114+
}
101115
else
102116
{
103117
aTPlane = new TNaming_NamedShape;
@@ -109,13 +123,17 @@ bool BinMDataXtd_ConstraintDriver::Paste(const BinObjMgt_Persistent& theSo
109123
// constraint type
110124
int aType;
111125
if (!(theSource >> aType))
126+
{
112127
return false;
128+
}
113129
aC->SetType((TDataXtd_ConstraintEnum)aType);
114130

115131
// flags
116132
int flags;
117133
if (!(theSource >> flags))
134+
{
118135
return false;
136+
}
119137
aC->Verified((flags & 1) != 0);
120138
aC->Inverted((flags & 2) != 0);
121139
aC->Reversed((flags & 4) != 0);
@@ -137,9 +155,13 @@ void BinMDataXtd_ConstraintDriver::Paste(
137155
// value
138156
occ::handle<TDataStd_Real> aValue = aC->GetValue();
139157
if (!aValue.IsNull())
158+
{
140159
aNb = theRelocTable.Add(aValue); // create and/or get index
160+
}
141161
else
162+
{
142163
aNb = -1;
164+
}
143165
theTarget << aNb;
144166

145167
// geometries
@@ -150,18 +172,26 @@ void BinMDataXtd_ConstraintDriver::Paste(
150172
{
151173
occ::handle<TNaming_NamedShape> aG = aC->GetGeometry(iG);
152174
if (!aG.IsNull())
175+
{
153176
aNb = theRelocTable.Add(aG);
177+
}
154178
else
179+
{
155180
aNb = -1;
181+
}
156182
theTarget << aNb;
157183
}
158184

159185
// plane
160186
occ::handle<TNaming_NamedShape> aTPlane = aC->GetPlane();
161187
if (!aTPlane.IsNull())
188+
{
162189
aNb = theRelocTable.Add(aTPlane);
190+
}
163191
else
192+
{
164193
aNb = -1;
194+
}
165195
theTarget << aNb;
166196

167197
// constraint type
@@ -170,10 +200,16 @@ void BinMDataXtd_ConstraintDriver::Paste(
170200
// flags
171201
int flags = 0;
172202
if (aC->Verified())
203+
{
173204
flags |= 1;
205+
}
174206
if (aC->Inverted())
207+
{
175208
flags |= 2;
209+
}
176210
if (aC->Reversed())
211+
{
177212
flags |= 4;
213+
}
178214
theTarget << flags;
179215
}

src/ApplicationFramework/TKBin/BinMDataXtd/BinMDataXtd_GeometryDriver.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ bool BinMDataXtd_GeometryDriver::Paste(const BinObjMgt_Persistent& theSour
5050
int aType;
5151
bool ok = theSource >> aType;
5252
if (ok)
53+
{
5354
aT->SetType((TDataXtd_GeometryEnum)aType);
55+
}
5456

5557
return ok;
5658
}

src/ApplicationFramework/TKBin/BinMDataXtd/BinMDataXtd_PatternStdDriver.cxx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,21 @@ bool BinMDataXtd_PatternStdDriver::Paste(const BinObjMgt_Persistent& theSo
5353
// signature
5454
int signature;
5555
if (!(theSource >> signature))
56+
{
5657
return false;
58+
}
5759
if (signature == 0)
60+
{
5861
return true;
62+
}
5963
aP->Signature(signature);
6064

6165
// reversed flags
6266
int revFlags;
6367
if (!(theSource >> revFlags))
68+
{
6469
return false;
70+
}
6571
aP->Axis1Reversed((revFlags & 1) != 0);
6672
aP->Axis2Reversed((revFlags & 2) != 0);
6773

@@ -71,9 +77,13 @@ bool BinMDataXtd_PatternStdDriver::Paste(const BinObjMgt_Persistent& theSo
7177
if (signature == 5) // mirror
7278
{
7379
if (!(theSource >> aNb))
80+
{
7481
return false;
82+
}
7583
if (theRelocTable.IsBound(aNb))
84+
{
7685
TNS = occ::down_cast<TNaming_NamedShape>(theRelocTable.Find(aNb));
86+
}
7787
else
7888
{
7989
TNS = new TNaming_NamedShape;
@@ -88,9 +98,13 @@ bool BinMDataXtd_PatternStdDriver::Paste(const BinObjMgt_Persistent& theSo
8898

8999
// axis 1
90100
if (!(theSource >> aNb))
101+
{
91102
return false;
103+
}
92104
if (theRelocTable.IsBound(aNb))
105+
{
93106
TNS = occ::down_cast<TNaming_NamedShape>(theRelocTable.Find(aNb));
107+
}
94108
else
95109
{
96110
TNS = new TNaming_NamedShape;
@@ -100,9 +114,13 @@ bool BinMDataXtd_PatternStdDriver::Paste(const BinObjMgt_Persistent& theSo
100114

101115
// value 1
102116
if (!(theSource >> aNb))
117+
{
103118
return false;
119+
}
104120
if (theRelocTable.IsBound(aNb))
121+
{
105122
TReal = occ::down_cast<TDataStd_Real>(theRelocTable.Find(aNb));
123+
}
106124
else
107125
{
108126
TReal = new TDataStd_Real;
@@ -112,9 +130,13 @@ bool BinMDataXtd_PatternStdDriver::Paste(const BinObjMgt_Persistent& theSo
112130

113131
// number of instances 1
114132
if (!(theSource >> aNb))
133+
{
115134
return false;
135+
}
116136
if (theRelocTable.IsBound(aNb))
137+
{
117138
TInt = occ::down_cast<TDataStd_Integer>(theRelocTable.Find(aNb));
139+
}
118140
else
119141
{
120142
TInt = new TDataStd_Integer;
@@ -126,9 +148,13 @@ bool BinMDataXtd_PatternStdDriver::Paste(const BinObjMgt_Persistent& theSo
126148
{
127149
// axis 2
128150
if (!(theSource >> aNb))
151+
{
129152
return false;
153+
}
130154
if (theRelocTable.IsBound(aNb))
155+
{
131156
TNS = occ::down_cast<TNaming_NamedShape>(theRelocTable.Find(aNb));
157+
}
132158
else
133159
{
134160
TNS = new TNaming_NamedShape;
@@ -138,9 +164,13 @@ bool BinMDataXtd_PatternStdDriver::Paste(const BinObjMgt_Persistent& theSo
138164

139165
// real value 2
140166
if (!(theSource >> aNb))
167+
{
141168
return false;
169+
}
142170
if (theRelocTable.IsBound(aNb))
171+
{
143172
TReal = occ::down_cast<TDataStd_Real>(theRelocTable.Find(aNb));
173+
}
144174
else
145175
{
146176
TReal = new TDataStd_Real;
@@ -150,9 +180,13 @@ bool BinMDataXtd_PatternStdDriver::Paste(const BinObjMgt_Persistent& theSo
150180

151181
// number of instances 2
152182
if (!(theSource >> aNb))
183+
{
153184
return false;
185+
}
154186
if (theRelocTable.IsBound(aNb))
187+
{
155188
TInt = occ::down_cast<TDataStd_Integer>(theRelocTable.Find(aNb));
189+
}
156190
else
157191
{
158192
TInt = new TDataStd_Integer;
@@ -177,17 +211,25 @@ void BinMDataXtd_PatternStdDriver::Paste(
177211
// signature
178212
int signature = aP->Signature();
179213
if (signature < 1 || signature > 5)
214+
{
180215
signature = 0;
216+
}
181217
theTarget << signature;
182218
if (signature == 0)
219+
{
183220
return;
221+
}
184222

185223
// reversed flags
186224
int revFlags = 0;
187225
if (aP->Axis1Reversed())
226+
{
188227
revFlags |= 1;
228+
}
189229
if (aP->Axis2Reversed())
230+
{
190231
revFlags |= 2;
232+
}
191233
theTarget << revFlags;
192234

193235
int aNb;

src/ApplicationFramework/TKBin/BinMDataXtd/BinMDataXtd_PositionDriver.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,24 @@ bool BinMDataXtd_PositionDriver::Paste(const BinObjMgt_Persistent& theSour
4949
double aValue;
5050
bool ok = theSource >> aValue;
5151
if (!ok)
52+
{
5253
return ok;
54+
}
5355
gp_Pnt aPosition(0., 0., 0.);
5456
aPosition.SetX(aValue);
5557

5658
ok = theSource >> aValue;
5759
if (!ok)
60+
{
5861
return ok;
62+
}
5963
aPosition.SetY(aValue);
6064

6165
ok = theSource >> aValue;
6266
if (!ok)
67+
{
6368
return ok;
69+
}
6470
aPosition.SetZ(aValue);
6571

6672
anAtt->SetPosition(aPosition);

0 commit comments

Comments
 (0)