For loop cleanup. NFC.
This commit is contained in:
parent
231dff6cd9
commit
15838dc5a1
@ -175,8 +175,8 @@ void TextWindow::DescribeSelection() {
|
|||||||
e->str.c_str(), &ScreenEditTtfText, e->h.request().v);
|
e->str.c_str(), &ScreenEditTtfText, e->h.request().v);
|
||||||
Printf(true, " select new font");
|
Printf(true, " select new font");
|
||||||
SS.fonts.LoadAll();
|
SS.fonts.LoadAll();
|
||||||
int i;
|
// Not using range-for here because we use i inside the output.
|
||||||
for(i = 0; i < SS.fonts.l.n; i++) {
|
for(int i = 0; i < SS.fonts.l.n; i++) {
|
||||||
TtfFont *tf = &(SS.fonts.l[i]);
|
TtfFont *tf = &(SS.fonts.l[i]);
|
||||||
if(e->font == tf->FontFileBaseName()) {
|
if(e->font == tf->FontFileBaseName()) {
|
||||||
Printf(false, "%Bp %s",
|
Printf(false, "%Bp %s",
|
||||||
|
@ -20,13 +20,12 @@ std::string Entity::DescriptionString() const {
|
|||||||
void Entity::GenerateEdges(SEdgeList *el) {
|
void Entity::GenerateEdges(SEdgeList *el) {
|
||||||
SBezierList *sbl = GetOrGenerateBezierCurves();
|
SBezierList *sbl = GetOrGenerateBezierCurves();
|
||||||
|
|
||||||
int i, j;
|
for(int i = 0; i < sbl->l.n; i++) {
|
||||||
for(i = 0; i < sbl->l.n; i++) {
|
|
||||||
SBezier *sb = &(sbl->l[i]);
|
SBezier *sb = &(sbl->l[i]);
|
||||||
|
|
||||||
List<Vector> lv = {};
|
List<Vector> lv = {};
|
||||||
sb->MakePwlInto(&lv);
|
sb->MakePwlInto(&lv);
|
||||||
for(j = 1; j < lv.n; j++) {
|
for(int j = 1; j < lv.n; j++) {
|
||||||
el->AddEdge(lv[j-1], lv[j], style.v, i);
|
el->AddEdge(lv[j-1], lv[j], style.v, i);
|
||||||
}
|
}
|
||||||
lv.Clear();
|
lv.Clear();
|
||||||
|
@ -759,8 +759,8 @@ void VectorFileWriter::OutputLinesAndMesh(SBezierLoopSetSet *sblss, SMesh *sm) {
|
|||||||
void VectorFileWriter::BezierAsPwl(SBezier *sb) {
|
void VectorFileWriter::BezierAsPwl(SBezier *sb) {
|
||||||
List<Vector> lv = {};
|
List<Vector> lv = {};
|
||||||
sb->MakePwlInto(&lv, SS.ExportChordTolMm());
|
sb->MakePwlInto(&lv, SS.ExportChordTolMm());
|
||||||
int i;
|
|
||||||
for(i = 1; i < lv.n; i++) {
|
for(int i = 1; i < lv.n; i++) {
|
||||||
SBezier sb = SBezier::From(lv[i-1], lv[i]);
|
SBezier sb = SBezier::From(lv[i-1], lv[i]);
|
||||||
Bezier(&sb);
|
Bezier(&sb);
|
||||||
}
|
}
|
||||||
|
@ -148,6 +148,7 @@ void SolveSpaceUI::GenerateAll(Generate type, bool andFindFree, bool genForBBox)
|
|||||||
|
|
||||||
// Start from the first dirty group, and solve until the active group,
|
// Start from the first dirty group, and solve until the active group,
|
||||||
// since all groups after the active group are hidden.
|
// since all groups after the active group are hidden.
|
||||||
|
// Not using range-for because we're tracking the indices.
|
||||||
for(i = 0; i < SK.groupOrder.n; i++) {
|
for(i = 0; i < SK.groupOrder.n; i++) {
|
||||||
Group *g = SK.GetGroup(SK.groupOrder[i]);
|
Group *g = SK.GetGroup(SK.groupOrder[i]);
|
||||||
if((!g->clean) || !g->IsSolvedOkay()) {
|
if((!g->clean) || !g->IsSolvedOkay()) {
|
||||||
@ -213,6 +214,7 @@ void SolveSpaceUI::GenerateAll(Generate type, bool andFindFree, bool genForBBox)
|
|||||||
SK.entity.Clear();
|
SK.entity.Clear();
|
||||||
SK.entity.ReserveMore(oldEntityCount);
|
SK.entity.ReserveMore(oldEntityCount);
|
||||||
|
|
||||||
|
// Not using range-for because we're using the index inside the loop.
|
||||||
for(i = 0; i < SK.groupOrder.n; i++) {
|
for(i = 0; i < SK.groupOrder.n; i++) {
|
||||||
Group *g = SK.GetGroup(SK.groupOrder[i]);
|
Group *g = SK.GetGroup(SK.groupOrder[i]);
|
||||||
|
|
||||||
|
@ -849,6 +849,7 @@ void GraphicsWindow::EnsureValidActives() {
|
|||||||
// The active group must exist, and not be the references.
|
// The active group must exist, and not be the references.
|
||||||
Group *g = SK.group.FindByIdNoOops(activeGroup);
|
Group *g = SK.group.FindByIdNoOops(activeGroup);
|
||||||
if((!g) || (g->h == Group::HGROUP_REFERENCES)) {
|
if((!g) || (g->h == Group::HGROUP_REFERENCES)) {
|
||||||
|
// Not using range-for because this is used to find an index.
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < SK.groupOrder.n; i++) {
|
for(i = 0; i < SK.groupOrder.n; i++) {
|
||||||
if(SK.groupOrder[i] != Group::HGROUP_REFERENCES) {
|
if(SK.groupOrder[i] != Group::HGROUP_REFERENCES) {
|
||||||
|
@ -96,8 +96,7 @@ void GraphicsWindow::FixConstraintsForPointBeingDeleted(hEntity hpt) {
|
|||||||
// those two points were implicitly coincident with each other. By
|
// those two points were implicitly coincident with each other. By
|
||||||
// deleting hpt (and all constraints that mention it), we will delete
|
// deleting hpt (and all constraints that mention it), we will delete
|
||||||
// that relationship. So put it back here now.
|
// that relationship. So put it back here now.
|
||||||
int i;
|
for(int i = 1; i < ld.n; i++) {
|
||||||
for(i = 1; i < ld.n; i++) {
|
|
||||||
Constraint::ConstrainCoincident(ld[i-1], ld[i]);
|
Constraint::ConstrainCoincident(ld[i-1], ld[i]);
|
||||||
}
|
}
|
||||||
ld.Clear();
|
ld.Clear();
|
||||||
|
@ -335,10 +335,9 @@ bool SEdgeList::ContainsEdge(const SEdge *set) const {
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void SEdgeList::CullExtraneousEdges(bool both) {
|
void SEdgeList::CullExtraneousEdges(bool both) {
|
||||||
l.ClearTags();
|
l.ClearTags();
|
||||||
int i, j;
|
for(int i = 0; i < l.n; i++) {
|
||||||
for(i = 0; i < l.n; i++) {
|
|
||||||
SEdge *se = &(l[i]);
|
SEdge *se = &(l[i]);
|
||||||
for(j = i+1; j < l.n; j++) {
|
for(int j = i + 1; j < l.n; j++) {
|
||||||
SEdge *set = &(l[j]);
|
SEdge *set = &(l[j]);
|
||||||
if((set->a).Equals(se->a) && (set->b).Equals(se->b)) {
|
if((set->a).Equals(se->a) && (set->b).Equals(se->b)) {
|
||||||
// Two parallel edges exist; so keep only the first one.
|
// Two parallel edges exist; so keep only the first one.
|
||||||
|
Loading…
Reference in New Issue
Block a user