Skip to content

Commit 97d9588

Browse files
committed
NFC: Ramove all {0, 0, 0} comments. Everyone knows zero initialization.
1 parent a73ec21 commit 97d9588

23 files changed

Lines changed: 49 additions & 49 deletions

src/clipboard.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void GraphicsWindow::PasteClipboard(Vector trans, double theta, double scale) {
209209
// Likewise the scale, which could otherwise take us out of the
210210
// workplane.
211211
pt = pt.ScaledBy(fabs(scale));
212-
pt = pt.ScaleOutOfCsys(u, v, {} /*{0, 0, 0}*/);
212+
pt = pt.ScaleOutOfCsys(u, v, {});
213213
pt = pt.Plus(p);
214214
pt = pt.RotatedAbout(n, theta);
215215
pt = pt.Plus(trans);
@@ -338,7 +338,7 @@ void GraphicsWindow::MenuClipboard(Command id) {
338338
Entity *wrkpl = SK.GetEntity(SS.GW.ActiveWorkplane());
339339
Vector p = SK.GetEntity(wrkpl->point[0])->PointGetNum();
340340
SS.TW.shown.paste.times = 1;
341-
SS.TW.shown.paste.trans = {}; // {0, 0, 0}
341+
SS.TW.shown.paste.trans = {};
342342
SS.TW.shown.paste.theta = 0;
343343
SS.TW.shown.paste.origin = p;
344344
SS.TW.shown.paste.scale = 1;

src/constraint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void Constraint::MenuConstrain(Command id) {
320320
c.disp.offset = n.Cross(a.Minus(b));
321321
c.disp.offset = (c.disp.offset).WithMagnitude(50/SS.GW.scale);
322322
} else {
323-
c.disp.offset = {}; // {0, 0, 0}
323+
c.disp.offset = {};
324324
}
325325

326326
if(id == Command::REF_DISTANCE) {

src/drawconstraint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ void Constraint::DoLayout(DrawAs how, Canvas *canvas,
886886
}
887887

888888
case Type::PERPENDICULAR: {
889-
Vector u{}, v{}; // {0, 0, 0}
889+
Vector u{}, v{};
890890
Vector rn, ru;
891891
if(workplane == Entity::FREE_IN_3D) {
892892
rn = gn;

src/drawentity.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ void Entity::ComputeInterpolatingSpline(SBezierList *sbl, bool periodic) const {
263263

264264
// The starting and finishing control points that define our end tangents
265265
// (if the spline isn't periodic), and the on-curve points.
266-
Vector ctrl_s{}; // {0, 0, 0}
267-
Vector ctrl_f{}; // {0, 0, 0}
266+
Vector ctrl_s{};
267+
Vector ctrl_f{};
268268
Vector pt[MAX_N+4];
269269
if(periodic) {
270270
for(i = 0; i < ep + 3; i++) {
@@ -503,7 +503,7 @@ Vector Entity::ExplodeOffset() const {
503503
double offset = SS.explodeDistance * (requestIdx + 1);
504504
return SK.GetEntity(workplane)->Normal()->NormalN().ScaledBy(offset);
505505
} else {
506-
return {}; // {0, 0, 0}
506+
return {};
507507
}
508508
}
509509

src/export.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ void SolveSpaceUI::ExportViewOrWireframeTo(const Platform::Path &filename, bool
249249
Vector u{1.0, 0.0, 0.0},
250250
v{0.0, 1.0, 0.0},
251251
n{0.0, 0.0, 1.0},
252-
origin{}; // {0, 0, 0}
252+
origin{};
253253
double cameraTan = 0.0,
254254
scale = 1.0;
255255

src/generate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ void SolveSpaceUI::ForceReferences() {
421421
Entity *wrkpl = SK.GetEntity(hr.entity(0));
422422
// The origin for our coordinate system, always zero
423423
Entity *origin = SK.GetEntity(wrkpl->point[0]);
424-
origin->PointForceTo({} /*{0, 0, 0}*/);
424+
origin->PointForceTo({});
425425
origin->construction = true;
426426
SK.GetParam(origin->param[0])->known = true;
427427
SK.GetParam(origin->param[1])->known = true;

src/graphicswin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ void GraphicsWindow::MenuEdit(Command id) {
12161216
norm = norm.WithMagnitude(1);
12171217
Quaternion qaa = Quaternion::From(norm, PI/2);
12181218

1219-
g->TransformImportedBy({} /*{0, 0, 0}*/, qaa);
1219+
g->TransformImportedBy({}, qaa);
12201220

12211221
// and regenerate as necessary.
12221222
SS.MarkGroupDirty(hg);

src/group.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ void Group::MakeRevolveEndFaces(EntityList *el, hEntity pt, int ai, int af)
10021002

10031003
// When there is no loop normal (e.g. if the loop is broken), use normal of workplane
10041004
// as fallback, to avoid breaking constraints depending on the faces.
1005-
if(n.Equals({} /*{0.0, 0.0, 0.0}*/) && src->type == Group::Type::DRAWING_WORKPLANE) {
1005+
if(n.Equals({}) && src->type == Group::Type::DRAWING_WORKPLANE) {
10061006
n = SK.GetEntity(src->h.entity(0))->Normal()->NormalN();
10071007
}
10081008

@@ -1039,7 +1039,7 @@ void Group::MakeExtrusionTopBottomFaces(EntityList *el, hEntity pt)
10391039

10401040
// When there is no loop normal (e.g. if the loop is broken), use normal of workplane
10411041
// as fallback, to avoid breaking constraints depending on the faces.
1042-
if(n.Equals({} /*{0.0, 0.0, 0.0}*/) && src->type == Group::Type::DRAWING_WORKPLANE) {
1042+
if(n.Equals({}) && src->type == Group::Type::DRAWING_WORKPLANE) {
10431043
n = SK.GetEntity(src->h.entity(0))->Normal()->NormalN();
10441044
}
10451045

src/groupmesh.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void Group::GenerateShellAndMesh() {
251251

252252
Vector tbot, ttop;
253253
if(subtype == Subtype::ONE_SIDED || subtype == Subtype::ONE_SKEWED) {
254-
tbot = {} /*{0, 0, 0}*/; ttop = translate.ScaledBy(2);
254+
tbot = {}; ttop = translate.ScaledBy(2);
255255
} else {
256256
tbot = translate.ScaledBy(-1); ttop = translate.ScaledBy(1);
257257
}
@@ -779,7 +779,7 @@ void Group::DrawContourAreaLabels(Canvas *canvas) {
779779

780780
Vector min = sbls.l[0].l[0].ctrl[0];
781781
Vector max = min;
782-
Vector zero = {}; /*{0.0, 0.0, 0.0}*/
782+
Vector zero = {};
783783
sbls.GetBoundingProjd({1.0, 0.0, 0.0}, zero, &min.x, &max.x);
784784
sbls.GetBoundingProjd({0.0, 1.0, 0.0}, zero, &min.y, &max.y);
785785
sbls.GetBoundingProjd({0.0, 0.0, 1.0}, zero, &min.z, &max.z);

src/importidf.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ bool LinkIDF(const Platform::Path &filename, EntityList *el, SMesh *m, SShell *s
339339

340340
hEntity hprev;
341341
hEntity hprevTop;
342-
Vector pprev{}; // {0, 0, 0}
343-
Vector pprevTop{}; // {0, 0, 0}
342+
Vector pprev{};
343+
Vector pprevTop{};
344344

345345
double board_thickness = 10.0;
346346
double scale = 1.0; //mm
@@ -510,7 +510,7 @@ bool LinkIDF(const Platform::Path &filename, EntityList *el, SMesh *m, SShell *s
510510
SPolygon polyLoops = {};
511511
bool allClosed;
512512
bool allCoplanar;
513-
Vector errorPointAt{}; // {0, 0, 0}
513+
Vector errorPointAt{};
514514
SEdge errorAt = {};
515515

516516
SBezierLoopSetSet sblss = {};
@@ -522,7 +522,7 @@ bool LinkIDF(const Platform::Path &filename, EntityList *el, SMesh *m, SShell *s
522522
double ctc = SS.chordTolCalculated;
523523
if(ctc == 0.0) SS.chordTolCalculated = 0.1; //mm
524524
// there should only by one sbls in the sblss unless a board has disjointed parts...
525-
sh->MakeFromExtrusionOf(sblss.l.First(), {} /*{0.0, 0.0, 0.0}*/,
525+
sh->MakeFromExtrusionOf(sblss.l.First(), {},
526526
{0.0, 0.0, board_thickness},
527527
RgbaColor::From(0, 180, 0) );
528528
SS.chordTolCalculated = ctc;

0 commit comments

Comments
 (0)