Skip to content

Commit 5a471b5

Browse files
committed
NFC: Raplace all aggregate initializations {0, 0, 0} with {}
1 parent ad540f0 commit 5a471b5

19 files changed

Lines changed: 38 additions & 38 deletions

src/clipboard.cpp

Lines changed: 1 addition & 1 deletion
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, {} /*{0, 0, 0}*/);
213213
pt = pt.Plus(p);
214214
pt = pt.RotatedAbout(n, theta);
215215
pt = pt.Plus(trans);

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({} /*{0, 0, 0}*/);
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({} /*{0, 0, 0}*/, 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({} /*{0.0, 0.0, 0.0}*/) && 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({} /*{0.0, 0.0, 0.0}*/) && 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 = {} /*{0, 0, 0}*/; 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 = {}; /*{0.0, 0.0, 0.0}*/
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ 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}
342+
Vector pprev{}; // {0, 0, 0}
343343
Vector pprevTop{}; // {0, 0, 0}
344344

345345
double board_thickness = 10.0;
@@ -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(), {} /*{0.0, 0.0, 0.0}*/,
526526
{0.0, 0.0, board_thickness},
527527
RgbaColor::From(0, 180, 0) );
528528
SS.chordTolCalculated = ctc;

src/importmesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ bool LinkStl(const Platform::Path &filename, EntityList *el, SMesh *m, SShell *s
205205
int id = 1;
206206

207207
//add the STL origin and normals
208-
hEntity origin = newPoint(el, &id, {0.0, 0.0, 0.0});
208+
hEntity origin = newPoint(el, &id, {} /*{0.0, 0.0, 0.0}*/);
209209
newNormal(el, &id, Quaternion::From({1, 0, 0},{0, 1, 0}), origin);
210210
newNormal(el, &id, Quaternion::From({0, 1, 0},{0, 0, 1}), origin);
211211
newNormal(el, &id, Quaternion::From({0, 0, 1},{1, 0, 0}), origin);

src/mesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void SMesh::Simplify(int start) {
115115
STriangle *tout = new STriangle[maxTriangles];
116116
int toutc = 0;
117117

118-
Vector n = {0, 0, 0};
118+
Vector n = {} /*{0, 0, 0}*/;
119119
Vector *conv = new Vector[maxTriangles * 3];
120120
int convc = 0;
121121

src/modify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ void GraphicsWindow::SplitLinesOrCurves() {
644644

645645
Entity *ea = SK.GetEntity(ha),
646646
*eb = SK.GetEntity(hb);
647-
Vector pi = {0, 0, 0};
647+
Vector pi = {} /*{0, 0, 0}*/;
648648

649649
// First, decide the point where we're going to make the split.
650650
bool foundInters = false;

src/polygon.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ bool SEdgeList::AssemblePolygon(SPolygon *dest, SEdge *errorAt, bool keepDir) co
271271
dest->Clear();
272272

273273
bool allClosed = true;
274-
Vector first = {0, 0, 0};
275-
Vector last = {0, 0, 0};
274+
Vector first = {} /*{0, 0, 0}*/;
275+
Vector last = {} /*{0, 0, 0}*/;
276276
int i;
277277
for(i = 0; i < l.n; i++) {
278278
if(!l[i].tag) {
@@ -380,7 +380,7 @@ SKdNodeEdges *SKdNodeEdges::From(SEdgeLl *sell) {
380380

381381
// Compute the midpoints (just mean, though median would be better) of
382382
// each component.
383-
Vector ptAve = {0, 0, 0};
383+
Vector ptAve = {} /*{0, 0, 0}*/;
384384
SEdgeLl *flip;
385385
int totaln = 0;
386386
for(flip = sell; flip; flip = flip->next) {
@@ -582,7 +582,7 @@ void SContour::FindPointWithMinX() {
582582
}
583583

584584
Vector SContour::ComputeNormal() const {
585-
Vector n = {0, 0, 0};
585+
Vector n = {} /*{0, 0, 0}*/;
586586

587587
for(int i = 0; i < l.n - 2; i++) {
588588
Vector u = (l[i+1].p).Minus(l[i+0].p).WithMagnitude(1);
@@ -678,7 +678,7 @@ void SPolygon::MakeEdgesInto(SEdgeList *el) const {
678678

679679
Vector SPolygon::ComputeNormal() const {
680680
if(l.IsEmpty())
681-
return {0, 0, 0};
681+
return {} /*{0, 0, 0}*/;
682682
return (l[0]).ComputeNormal();
683683
}
684684

0 commit comments

Comments
 (0)