diff --git a/exposed/CDemo.c b/exposed/CDemo.c index 574f1002..85931f20 100644 --- a/exposed/CDemo.c +++ b/exposed/CDemo.c @@ -36,7 +36,7 @@ static void *CheckMalloc(size_t n) * An example of a constraint in 3d. We create a single group, with some * entities and constraints. *---------------------------------------------------------------------------*/ -void Example3d(void) +void Example3d() { /* This will contain a single group, which will arbitrarily number 1. */ Slvs_hGroup g = 1; @@ -88,7 +88,7 @@ void Example3d(void) * along the reference frame's xy plane. In a second group, we create some * entities in that group and dimension them. *---------------------------------------------------------------------------*/ -void Example2d(void) +void Example2d() { Slvs_hGroup g; double qw, qx, qy, qz; @@ -254,7 +254,7 @@ void Example2d(void) } } -int main(void) +int main() { sys.param = CheckMalloc(50*sizeof(sys.param[0])); sys.entity = CheckMalloc(50*sizeof(sys.entity[0])); diff --git a/src/bsp.cpp b/src/bsp.cpp index 485902be..527c47c8 100644 --- a/src/bsp.cpp +++ b/src/bsp.cpp @@ -8,8 +8,8 @@ //----------------------------------------------------------------------------- #include "solvespace.h" -SBsp2 *SBsp2::Alloc(void) { return (SBsp2 *)AllocTemporary(sizeof(SBsp2)); } -SBsp3 *SBsp3::Alloc(void) { return (SBsp3 *)AllocTemporary(sizeof(SBsp3)); } +SBsp2 *SBsp2::Alloc() { return (SBsp2 *)AllocTemporary(sizeof(SBsp2)); } +SBsp3 *SBsp3::Alloc() { return (SBsp3 *)AllocTemporary(sizeof(SBsp3)); } SBsp3 *SBsp3::FromMesh(SMesh *m) { SBsp3 *bsp3 = NULL; @@ -424,7 +424,7 @@ void SBsp3::GenerateInPaintOrder(SMesh *m) { } } -void SBsp3::DebugDraw(void) { +void SBsp3::DebugDraw() { if(pos) pos->DebugDraw(); Vector norm = tri.Normal(); diff --git a/src/clipboard.cpp b/src/clipboard.cpp index 90551281..91ea0f8d 100644 --- a/src/clipboard.cpp +++ b/src/clipboard.cpp @@ -6,7 +6,7 @@ //----------------------------------------------------------------------------- #include "solvespace.h" -void SolveSpaceUI::Clipboard::Clear(void) { +void SolveSpaceUI::Clipboard::Clear() { c.Clear(); r.Clear(); } @@ -46,7 +46,7 @@ hEntity SolveSpaceUI::Clipboard::NewEntityFor(hEntity he) { ssassert(false, "Expected to find entity in some clipboard request"); } -void GraphicsWindow::DeleteSelection(void) { +void GraphicsWindow::DeleteSelection() { SK.request.ClearTags(); SK.constraint.ClearTags(); List *ls = &(selection); @@ -69,7 +69,7 @@ void GraphicsWindow::DeleteSelection(void) { DeleteTaggedRequests(); } -void GraphicsWindow::CopySelection(void) { +void GraphicsWindow::CopySelection() { SS.clipboard.Clear(); Entity *wrkpl = SK.GetEntity(ActiveWorkplane()); @@ -386,7 +386,7 @@ void TextWindow::ScreenPasteTransformed(int link, uint32_t v) { } } -void TextWindow::ShowPasteTransformed(void) { +void TextWindow::ShowPasteTransformed() { Printf(true, "%FtPASTE TRANSFORMED%E"); Printf(true, "%Ba %Ftrepeat%E %d time%s %Fl%Lt%f[change]%E", shown.paste.times, (shown.paste.times == 1) ? "" : "s", diff --git a/src/confscreen.cpp b/src/confscreen.cpp index e518e1bd..6fd80fb3 100644 --- a/src/confscreen.cpp +++ b/src/confscreen.cpp @@ -160,7 +160,7 @@ void TextWindow::ScreenChangeAutosaveInterval(int link, uint32_t v) { SS.TW.edit.meaning = EDIT_AUTOSAVE_INTERVAL; } -void TextWindow::ShowConfiguration(void) { +void TextWindow::ShowConfiguration() { int i; Printf(true, "%Ft user color (r, g, b)"); diff --git a/src/constraint.cpp b/src/constraint.cpp index 5b70ddbf..23bb126e 100644 --- a/src/constraint.cpp +++ b/src/constraint.cpp @@ -6,7 +6,7 @@ //----------------------------------------------------------------------------- #include "solvespace.h" -std::string Constraint::DescriptionString(void) { +std::string Constraint::DescriptionString() { const char *s; switch(type) { case POINTS_COINCIDENT: s = "pts-coincident"; break; diff --git a/src/constrainteq.cpp b/src/constrainteq.cpp index 69c9f0ba..db5facbb 100644 --- a/src/constrainteq.cpp +++ b/src/constrainteq.cpp @@ -9,7 +9,7 @@ const hConstraint ConstraintBase::NO_CONSTRAINT = { 0 }; -bool ConstraintBase::HasLabel(void) { +bool ConstraintBase::HasLabel() { switch(type) { case PT_LINE_DISTANCE: case PT_PLANE_DISTANCE: @@ -166,7 +166,7 @@ ExprVector ConstraintBase::PointInThreeSpace(hEntity workplane, return (ub.ScaledBy(u)).Plus(vb.ScaledBy(v)).Plus(ob); } -void ConstraintBase::ModifyToSatisfy(void) { +void ConstraintBase::ModifyToSatisfy() { if(type == ANGLE) { Vector a = SK.GetEntity(entityA)->VectorGetNum(); Vector b = SK.GetEntity(entityB)->VectorGetNum(); diff --git a/src/describescreen.cpp b/src/describescreen.cpp index 759142d4..8eedc794 100644 --- a/src/describescreen.cpp +++ b/src/describescreen.cpp @@ -51,7 +51,7 @@ void TextWindow::ScreenConstraintShowAsRadius(int link, uint32_t v) { SS.ScheduleShowTW(); } -void TextWindow::DescribeSelection(void) { +void TextWindow::DescribeSelection() { Entity *e; Vector p; int i; diff --git a/src/draw.cpp b/src/draw.cpp index 597f9d81..60d071df 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -13,24 +13,24 @@ bool GraphicsWindow::Selection::Equals(Selection *b) { return true; } -bool GraphicsWindow::Selection::IsEmpty(void) { +bool GraphicsWindow::Selection::IsEmpty() { if(entity.v) return false; if(constraint.v) return false; return true; } -bool GraphicsWindow::Selection::HasEndpoints(void) { +bool GraphicsWindow::Selection::HasEndpoints() { if(!entity.v) return false; Entity *e = SK.GetEntity(entity); return e->HasEndpoints(); } -void GraphicsWindow::Selection::Clear(void) { +void GraphicsWindow::Selection::Clear() { entity.v = constraint.v = 0; emphasized = false; } -void GraphicsWindow::Selection::Draw(void) { +void GraphicsWindow::Selection::Draw() { Vector refp = Vector::From(0, 0, 0); if(entity.v) { Entity *e = SK.GetEntity(entity); @@ -62,13 +62,13 @@ void GraphicsWindow::Selection::Draw(void) { } } -void GraphicsWindow::ClearSelection(void) { +void GraphicsWindow::ClearSelection() { selection.Clear(); SS.ScheduleShowTW(); InvalidateGraphics(); } -void GraphicsWindow::ClearNonexistentSelectionItems(void) { +void GraphicsWindow::ClearNonexistentSelectionItems() { bool change = false; Selection *s; selection.ClearTags(); @@ -184,7 +184,7 @@ void GraphicsWindow::MakeSelected(Selection *stog) { // points, we test by the point location. For normals, we test by the normal's // associated point. For anything else, we test by any piecewise linear edge. //----------------------------------------------------------------------------- -void GraphicsWindow::SelectByMarquee(void) { +void GraphicsWindow::SelectByMarquee() { Point2d begin = ProjectPoint(orig.marqueePoint); double xmin = min(orig.mouse.x, begin.x), xmax = max(orig.mouse.x, begin.x), @@ -239,7 +239,7 @@ void GraphicsWindow::SelectByMarquee(void) { // constraints separately, counts of certain types of entities (circles, // lines, etc.), and so on. //----------------------------------------------------------------------------- -void GraphicsWindow::GroupSelection(void) { +void GraphicsWindow::GroupSelection() { gs = {}; int i; for(i = 0; i < selection.n && i < MAX_SELECTED; i++) { @@ -442,7 +442,7 @@ Vector GraphicsWindow::UnProjectPoint3(Vector p) { return orig; } -void GraphicsWindow::NormalizeProjectionVectors(void) { +void GraphicsWindow::NormalizeProjectionVectors() { if(projRight.Magnitude() < LENGTH_EPS) { projRight = Vector::From(1, 0, 0); } @@ -468,7 +468,7 @@ Vector GraphicsWindow::VectorFromProjs(Vector rightUpForward) { return r; } -void GraphicsWindow::Paint(void) { +void GraphicsWindow::Paint() { int i; havePainted = true; diff --git a/src/drawconstraint.cpp b/src/drawconstraint.cpp index ecec403c..df795bc3 100644 --- a/src/drawconstraint.cpp +++ b/src/drawconstraint.cpp @@ -40,7 +40,7 @@ static void LineCallback(void *fndata, Vector a, Vector b) c->LineDrawOrGetDistance(a, b); } -std::string Constraint::Label(void) { +std::string Constraint::Label() { std::string result; if(type == ANGLE) { if(valA == floor(valA)) { @@ -1170,7 +1170,7 @@ s: } } -void Constraint::Draw(void) { +void Constraint::Draw() { dogd.drawing = true; dogd.sel = NULL; hStyle hs = GetStyle(); @@ -1192,7 +1192,7 @@ double Constraint::GetDistance(Point2d mp) { return dogd.dmin; } -Vector Constraint::GetLabelPos(void) { +Vector Constraint::GetLabelPos() { dogd.drawing = false; dogd.sel = NULL; dogd.mp.x = 0; dogd.mp.y = 0; @@ -1203,7 +1203,7 @@ Vector Constraint::GetLabelPos(void) { return p; } -Vector Constraint::GetReferencePos(void) { +Vector Constraint::GetReferencePos() { dogd.drawing = false; dogd.sel = NULL; diff --git a/src/drawentity.cpp b/src/drawentity.cpp index bfc71167..875d45b5 100644 --- a/src/drawentity.cpp +++ b/src/drawentity.cpp @@ -7,7 +7,7 @@ //----------------------------------------------------------------------------- #include "solvespace.h" -std::string Entity::DescriptionString(void) { +std::string Entity::DescriptionString() { if(h.isFromRequest()) { Request *r = SK.GetRequest(h.request()); return r->DescriptionString(); @@ -202,7 +202,7 @@ double Entity::GetDistance(Point2d mp) { return dogd.dmin; } -Vector Entity::GetReferencePos(void) { +Vector Entity::GetReferencePos() { dogd.drawing = false; dogd.refp = SS.GW.offset.ScaledBy(-1); @@ -218,7 +218,7 @@ bool Entity::IsStylable() { return true; } -bool Entity::IsVisible(void) { +bool Entity::IsVisible() { Group *g = SK.GetGroup(group); if(g->h.v == Group::HGROUP_REFERENCES.v && IsNormal()) { @@ -271,7 +271,7 @@ void Entity::CalculateNumerical(bool forExport) { } } -bool Entity::PointIsFromReferences(void) { +bool Entity::PointIsFromReferences() { return h.request().IsFromReferences(); } @@ -519,7 +519,7 @@ void Entity::GenerateBezierCurves(SBezierList *sbl) { } } -void Entity::DrawOrGetDistance(void) { +void Entity::DrawOrGetDistance() { // If we're about to perform hit testing on an entity, consider // whether the pointer is inside its bounding box first. if(!dogd.drawing) { diff --git a/src/dsc.h b/src/dsc.h index 9336967c..91ecf4b5 100644 --- a/src/dsc.h +++ b/src/dsc.h @@ -30,20 +30,20 @@ public: Quaternion Plus(Quaternion b); Quaternion Minus(Quaternion b); Quaternion ScaledBy(double s); - double Magnitude(void); + double Magnitude(); Quaternion WithMagnitude(double s); // Call a rotation matrix [ u' v' n' ]'; this returns the first and // second rows, where that matrix is generated by this quaternion - Vector RotationU(void); - Vector RotationV(void); - Vector RotationN(void); + Vector RotationU(); + Vector RotationV(); + Vector RotationN(); Vector Rotate(Vector p); Quaternion ToThe(double p); - Quaternion Inverse(void); + Quaternion Inverse(); Quaternion Times(Quaternion b); - Quaternion Mirror(void); + Quaternion Mirror(); }; class Vector { @@ -73,7 +73,7 @@ public: bool EqualsExactly(Vector v); Vector Plus(Vector b); Vector Minus(Vector b); - Vector Negated(void); + Vector Negated(); Vector Cross(Vector b); double DirectionCosineWith(Vector b); double Dot(Vector b); @@ -85,14 +85,14 @@ public: double DistanceToLine(Vector p0, Vector dp); bool OnLineSegment(Vector a, Vector b, double tol=LENGTH_EPS); Vector ClosestPointOnLine(Vector p0, Vector dp); - double Magnitude(void); - double MagSquared(void); + double Magnitude(); + double MagSquared(); Vector WithMagnitude(double s); Vector ScaledBy(double s); Vector ProjectInto(hEntity wrkpl); Vector ProjectVectorInto(hEntity wrkpl); double DivPivoting(Vector delta); - Vector ClosestOrtho(void); + Vector ClosestOrtho(); void MakeMaxMin(Vector *maxv, Vector *minv); Vector ClampWithin(double minv, double maxv); static bool BoundingBoxesDisjoint(Vector amax, Vector amin, @@ -103,8 +103,8 @@ public: Vector InPerspective(Vector u, Vector v, Vector n, Vector origin, double cameraTan); Point2d Project2d(Vector u, Vector v); - Point2d ProjectXy(void); - Vector4 Project4d(void); + Point2d ProjectXy(); + Vector4 Project4d(); }; class Vector4 { @@ -118,7 +118,7 @@ public: Vector4 Plus(Vector4 b); Vector4 Minus(Vector4 b); Vector4 ScaledBy(double s); - Vector PerspectiveProject(void); + Vector PerspectiveProject(); }; class Point2d { @@ -137,10 +137,10 @@ public: double DistanceToLine(const Point2d &p0, const Point2d &dp, bool segment) const; double Angle() const; double AngleTo(const Point2d &p) const; - double Magnitude(void) const; - double MagSquared(void) const; + double Magnitude() const; + double MagSquared() const; Point2d WithMagnitude(double v) const; - Point2d Normal(void) const; + Point2d Normal() const; bool Equals(Point2d v, double tol=LENGTH_EPS) const; }; @@ -152,7 +152,7 @@ public: int n; int elemsAllocated; - void AllocForOneMore(void) { + void AllocForOneMore() { if(n >= elemsAllocated) { elemsAllocated = (elemsAllocated + 32)*2; T *newElem = (T *)MemAlloc((size_t)elemsAllocated*sizeof(elem[0])); @@ -178,7 +178,7 @@ public: n++; } - T *First(void) { + T *First() { return (n == 0) ? NULL : &(elem[0]); } T *NextAfter(T *prev) { @@ -187,14 +187,14 @@ public: return prev + 1; } - void ClearTags(void) { + void ClearTags() { int i; for(i = 0; i < n; i++) { elem[i].tag = 0; } } - void Clear(void) { + void Clear() { for(int i = 0; i < n; i++) elem[i].~T(); if(elem) MemFree(elem); @@ -202,7 +202,7 @@ public: n = elemsAllocated = 0; } - void RemoveTagged(void) { + void RemoveTagged() { int src, dest; dest = 0; for(src = 0; src < n; src++) { @@ -229,7 +229,7 @@ public: // and elemsAllocated is untouched, same as in RemoveTagged } - void Reverse(void) { + void Reverse() { int i; for(i = 0; i < (n/2); i++) { swap(elem[i], elem[(n-1)-i]); @@ -247,7 +247,7 @@ public: int n; int elemsAllocated; - uint32_t MaximumId(void) { + uint32_t MaximumId() { uint32_t id = 0; int i; @@ -334,7 +334,7 @@ public: return NULL; } - T *First(void) { + T *First() { return (n == 0) ? NULL : &(elem[0]); } T *NextAfter(T *prev) { @@ -343,7 +343,7 @@ public: return prev + 1; } - void ClearTags(void) { + void ClearTags() { int i; for(i = 0; i < n; i++) { elem[i].tag = 0; @@ -359,7 +359,7 @@ public: } } - void RemoveTagged(void) { + void RemoveTagged() { int src, dest; dest = 0; for(src = 0; src < n; src++) { @@ -399,7 +399,7 @@ public: l->n = n; } - void Clear(void) { + void Clear() { for(int i = 0; i < n; i++) { elem[i].Clear(); elem[i].~T(); @@ -424,7 +424,7 @@ public: double X[MAX_UNKNOWNS]; int n; - void Solve(void); + void Solve(); }; #define RGBi(r, g, b) RgbaColor::From((r), (g), (b)) @@ -436,10 +436,10 @@ class RgbaColor { public: uint8_t red, green, blue, alpha; - float redF(void) const { return (float)red / 255.0f; } - float greenF(void) const { return (float)green / 255.0f; } - float blueF(void) const { return (float)blue / 255.0f; } - float alphaF(void) const { return (float)alpha / 255.0f; } + float redF() const { return (float)red / 255.0f; } + float greenF() const { return (float)green / 255.0f; } + float blueF() const { return (float)blue / 255.0f; } + float alphaF() const { return (float)alpha / 255.0f; } bool Equals(RgbaColor c) const { return @@ -449,7 +449,7 @@ public: c.alpha == alpha; } - uint32_t ToPackedIntBGRA(void) const { + uint32_t ToPackedIntBGRA() const { return blue | (uint32_t)(green << 8) | @@ -457,7 +457,7 @@ public: (uint32_t)((255 - alpha) << 24); } - uint32_t ToPackedInt(void) const { + uint32_t ToPackedInt() const { return red | (uint32_t)(green << 8) | @@ -465,7 +465,7 @@ public: (uint32_t)((255 - alpha) << 24); } - uint32_t ToARGB32(void) const { + uint32_t ToARGB32() const { return blue | (uint32_t)(green << 8) | diff --git a/src/entity.cpp b/src/entity.cpp index 3c335227..660628f1 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -10,7 +10,7 @@ const hEntity EntityBase::FREE_IN_3D = { 0 }; const hEntity EntityBase::NO_ENTITY = { 0 }; -bool EntityBase::HasVector(void) { +bool EntityBase::HasVector() { switch(type) { case LINE_SEGMENT: case NORMAL_IN_3D: @@ -25,7 +25,7 @@ bool EntityBase::HasVector(void) { } } -ExprVector EntityBase::VectorGetExprs(void) { +ExprVector EntityBase::VectorGetExprs() { switch(type) { case LINE_SEGMENT: return (SK.GetEntity(point[0])->PointGetExprs()).Minus( @@ -42,7 +42,7 @@ ExprVector EntityBase::VectorGetExprs(void) { } } -Vector EntityBase::VectorGetNum(void) { +Vector EntityBase::VectorGetNum() { switch(type) { case LINE_SEGMENT: return (SK.GetEntity(point[0])->PointGetNum()).Minus( @@ -59,7 +59,7 @@ Vector EntityBase::VectorGetNum(void) { } } -Vector EntityBase::VectorGetRefPoint(void) { +Vector EntityBase::VectorGetRefPoint() { switch(type) { case LINE_SEGMENT: return ((SK.GetEntity(point[0])->PointGetNum()).Plus( @@ -76,7 +76,7 @@ Vector EntityBase::VectorGetRefPoint(void) { } } -Vector EntityBase::VectorGetStartPoint(void) { +Vector EntityBase::VectorGetStartPoint() { switch(type) { case LINE_SEGMENT: return SK.GetEntity(point[1])->PointGetNum(); @@ -92,11 +92,11 @@ Vector EntityBase::VectorGetStartPoint(void) { } } -bool EntityBase::IsCircle(void) { +bool EntityBase::IsCircle() { return (type == CIRCLE) || (type == ARC_OF_CIRCLE); } -Expr *EntityBase::CircleGetRadiusExpr(void) { +Expr *EntityBase::CircleGetRadiusExpr() { if(type == CIRCLE) { return SK.GetEntity(distance)->DistanceGetExpr(); } else if(type == ARC_OF_CIRCLE) { @@ -104,7 +104,7 @@ Expr *EntityBase::CircleGetRadiusExpr(void) { } else ssassert(false, "Unexpected entity type"); } -double EntityBase::CircleGetRadiusNum(void) { +double EntityBase::CircleGetRadiusNum() { if(type == CIRCLE) { return SK.GetEntity(distance)->DistanceGetNum(); } else if(type == ARC_OF_CIRCLE) { @@ -137,42 +137,42 @@ void EntityBase::ArcGetAngles(double *thetaa, double *thetab, double *dtheta) { while(*dtheta > (2*PI)) *dtheta -= 2*PI; } -Vector EntityBase::CubicGetStartNum(void) { +Vector EntityBase::CubicGetStartNum() { return SK.GetEntity(point[0])->PointGetNum(); } -Vector EntityBase::CubicGetFinishNum(void) { +Vector EntityBase::CubicGetFinishNum() { return SK.GetEntity(point[3+extraPoints])->PointGetNum(); } -ExprVector EntityBase::CubicGetStartTangentExprs(void) { +ExprVector EntityBase::CubicGetStartTangentExprs() { ExprVector pon = SK.GetEntity(point[0])->PointGetExprs(), poff = SK.GetEntity(point[1])->PointGetExprs(); return (pon.Minus(poff)); } -ExprVector EntityBase::CubicGetFinishTangentExprs(void) { +ExprVector EntityBase::CubicGetFinishTangentExprs() { ExprVector pon = SK.GetEntity(point[3+extraPoints])->PointGetExprs(), poff = SK.GetEntity(point[2+extraPoints])->PointGetExprs(); return (pon.Minus(poff)); } -Vector EntityBase::CubicGetStartTangentNum(void) { +Vector EntityBase::CubicGetStartTangentNum() { Vector pon = SK.GetEntity(point[0])->PointGetNum(), poff = SK.GetEntity(point[1])->PointGetNum(); return (pon.Minus(poff)); } -Vector EntityBase::CubicGetFinishTangentNum(void) { +Vector EntityBase::CubicGetFinishTangentNum() { Vector pon = SK.GetEntity(point[3+extraPoints])->PointGetNum(), poff = SK.GetEntity(point[2+extraPoints])->PointGetNum(); return (pon.Minus(poff)); } -bool EntityBase::IsWorkplane(void) { +bool EntityBase::IsWorkplane() { return (type == WORKPLANE); } -ExprVector EntityBase::WorkplaneGetOffsetExprs(void) { +ExprVector EntityBase::WorkplaneGetOffsetExprs() { return SK.GetEntity(point[0])->PointGetExprs(); } -Vector EntityBase::WorkplaneGetOffset(void) { +Vector EntityBase::WorkplaneGetOffset() { return SK.GetEntity(point[0])->PointGetNum(); } @@ -188,18 +188,18 @@ void EntityBase::WorkplaneGetPlaneExprs(ExprVector *n, Expr **dn) { } else ssassert(false, "Unexpected entity type"); } -bool EntityBase::IsDistance(void) { +bool EntityBase::IsDistance() { return (type == DISTANCE) || (type == DISTANCE_N_COPY); } -double EntityBase::DistanceGetNum(void) { +double EntityBase::DistanceGetNum() { if(type == DISTANCE) { return SK.GetParam(param[0])->val; } else if(type == DISTANCE_N_COPY) { return numDistance; } else ssassert(false, "Unexpected entity type"); } -Expr *EntityBase::DistanceGetExpr(void) { +Expr *EntityBase::DistanceGetExpr() { if(type == DISTANCE) { return Expr::From(param[0]); } else if(type == DISTANCE_N_COPY) { @@ -214,11 +214,11 @@ void EntityBase::DistanceForceTo(double v) { } else ssassert(false, "Unexpected entity type"); } -EntityBase *EntityBase::Normal(void) { +EntityBase *EntityBase::Normal() { return SK.GetEntity(normal); } -bool EntityBase::IsPoint(void) { +bool EntityBase::IsPoint() { switch(type) { case POINT_IN_3D: case POINT_IN_2D: @@ -233,7 +233,7 @@ bool EntityBase::IsPoint(void) { } } -bool EntityBase::IsNormal(void) { +bool EntityBase::IsNormal() { switch(type) { case NORMAL_IN_3D: case NORMAL_IN_2D: @@ -246,7 +246,7 @@ bool EntityBase::IsNormal(void) { } } -Quaternion EntityBase::NormalGetNum(void) { +Quaternion EntityBase::NormalGetNum() { Quaternion q; switch(type) { case NORMAL_IN_3D: @@ -310,27 +310,27 @@ void EntityBase::NormalForceTo(Quaternion q) { } } -Vector EntityBase::NormalU(void) { +Vector EntityBase::NormalU() { return NormalGetNum().RotationU(); } -Vector EntityBase::NormalV(void) { +Vector EntityBase::NormalV() { return NormalGetNum().RotationV(); } -Vector EntityBase::NormalN(void) { +Vector EntityBase::NormalN() { return NormalGetNum().RotationN(); } -ExprVector EntityBase::NormalExprsU(void) { +ExprVector EntityBase::NormalExprsU() { return NormalGetExprs().RotationU(); } -ExprVector EntityBase::NormalExprsV(void) { +ExprVector EntityBase::NormalExprsV() { return NormalGetExprs().RotationV(); } -ExprVector EntityBase::NormalExprsN(void) { +ExprVector EntityBase::NormalExprsN() { return NormalGetExprs().RotationN(); } -ExprQuaternion EntityBase::NormalGetExprs(void) { +ExprQuaternion EntityBase::NormalGetExprs() { ExprQuaternion q; switch(type) { case NORMAL_IN_3D: @@ -430,7 +430,7 @@ void EntityBase::PointForceTo(Vector p) { } } -Vector EntityBase::PointGetNum(void) { +Vector EntityBase::PointGetNum() { Vector p; switch(type) { case POINT_IN_3D: @@ -479,7 +479,7 @@ Vector EntityBase::PointGetNum(void) { return p; } -ExprVector EntityBase::PointGetExprs(void) { +ExprVector EntityBase::PointGetExprs() { ExprVector r; switch(type) { case POINT_IN_3D: @@ -583,7 +583,7 @@ ExprQuaternion EntityBase::GetAxisAngleQuaternionExprs(int param0) { return q; } -Quaternion EntityBase::PointGetQuaternion(void) { +Quaternion EntityBase::PointGetQuaternion() { Quaternion q; if(type == POINT_N_ROT_AA) { @@ -595,7 +595,7 @@ Quaternion EntityBase::PointGetQuaternion(void) { return q; } -bool EntityBase::IsFace(void) { +bool EntityBase::IsFace() { switch(type) { case FACE_NORMAL_PT: case FACE_XPROD: @@ -608,7 +608,7 @@ bool EntityBase::IsFace(void) { } } -ExprVector EntityBase::FaceGetNormalExprs(void) { +ExprVector EntityBase::FaceGetNormalExprs() { ExprVector r; if(type == FACE_NORMAL_PT) { Vector v = Vector::From(numNormal.vx, numNormal.vy, numNormal.vz); @@ -637,7 +637,7 @@ ExprVector EntityBase::FaceGetNormalExprs(void) { return r; } -Vector EntityBase::FaceGetNormalNum(void) { +Vector EntityBase::FaceGetNormalNum() { Vector r; if(type == FACE_NORMAL_PT) { r = Vector::From(numNormal.vx, numNormal.vy, numNormal.vz); @@ -660,7 +660,7 @@ Vector EntityBase::FaceGetNormalNum(void) { return r.WithMagnitude(1); } -ExprVector EntityBase::FaceGetPointExprs(void) { +ExprVector EntityBase::FaceGetPointExprs() { ExprVector r; if(type == FACE_NORMAL_PT) { r = SK.GetEntity(point[0])->PointGetExprs(); @@ -689,7 +689,7 @@ ExprVector EntityBase::FaceGetPointExprs(void) { return r; } -Vector EntityBase::FaceGetPointNum(void) { +Vector EntityBase::FaceGetPointNum() { Vector r; if(type == FACE_NORMAL_PT) { r = SK.GetEntity(point[0])->PointGetNum(); @@ -714,7 +714,7 @@ Vector EntityBase::FaceGetPointNum(void) { return r; } -bool EntityBase::HasEndpoints(void) { +bool EntityBase::HasEndpoints() { return (type == LINE_SEGMENT) || (type == CUBIC) || (type == ARC_OF_CIRCLE); diff --git a/src/exportstep.cpp b/src/exportstep.cpp index 5f6378c6..0edb960f 100644 --- a/src/exportstep.cpp +++ b/src/exportstep.cpp @@ -5,7 +5,7 @@ //----------------------------------------------------------------------------- #include "solvespace.h" -void StepFileWriter::WriteHeader(void) { +void StepFileWriter::WriteHeader() { fprintf(f, "ISO-10303-21;\n" "HEADER;\n" @@ -66,7 +66,7 @@ void StepFileWriter::WriteHeader(void) { // Start the ID somewhere beyond the header IDs. id = 200; } -void StepFileWriter::WriteProductHeader(void) { +void StepFileWriter::WriteProductHeader() { fprintf(f, "#175 = SHAPE_DEFINITION_REPRESENTATION(#176, #169);\n" "#176 = PRODUCT_DEFINITION_SHAPE('Version', 'Test Part', #177);\n" @@ -283,7 +283,7 @@ void StepFileWriter::ExportSurface(SSurface *ss, SBezierList *sbl) { spxyz.Clear(); } -void StepFileWriter::WriteFooter(void) { +void StepFileWriter::WriteFooter() { fprintf(f, "\n" "ENDSEC;\n" @@ -354,7 +354,7 @@ void StepFileWriter::ExportSurfacesTo(const std::string &filename) { advancedFaces.Clear(); } -void StepFileWriter::WriteWireframe(void) { +void StepFileWriter::WriteWireframe() { fprintf(f, "#%d=GEOMETRIC_CURVE_SET('curves',(", id); int *c; for(c = curves.First(); c; c = curves.NextAfter(c)) { diff --git a/src/exportvector.cpp b/src/exportvector.cpp index b22b763b..d3698f13 100644 --- a/src/exportvector.cpp +++ b/src/exportvector.cpp @@ -658,7 +658,7 @@ bool DxfFileWriter::OutputConstraints(IdList *constraint return true; } -void DxfFileWriter::StartFile(void) { +void DxfFileWriter::StartFile() { paths.clear(); } @@ -680,7 +680,7 @@ void DxfFileWriter::Bezier(SBezier *sb) { paths.back().beziers.push_back(sb); } -void DxfFileWriter::FinishAndCloseFile(void) { +void DxfFileWriter::FinishAndCloseFile() { dxfRW dxf(filename.c_str()); DxfWriteInterface interface(this, &dxf); dxf.write(&interface, DRW::AC1021, false); @@ -759,7 +759,7 @@ static std::string MakeStipplePattern(int pattern, double scale, char delimiter, return result; } -void EpsFileWriter::StartFile(void) { +void EpsFileWriter::StartFile() { fprintf(f, "%%!PS-Adobe-2.0\r\n" "%%%%Creator: SolveSpace\r\n" @@ -871,7 +871,7 @@ void EpsFileWriter::Bezier(SBezier *sb) { } } -void EpsFileWriter::FinishAndCloseFile(void) { +void EpsFileWriter::FinishAndCloseFile() { fprintf(f, "\r\n" "grestore\r\n" @@ -883,7 +883,7 @@ void EpsFileWriter::FinishAndCloseFile(void) { // Routines for PDF output, some extra complexity because we have to generate // a correct xref table. //----------------------------------------------------------------------------- -void PdfFileWriter::StartFile(void) { +void PdfFileWriter::StartFile() { if((ptMax.x - ptMin.x) > 200*25.4 || (ptMax.y - ptMin.y) > 200*25.4) { @@ -945,7 +945,7 @@ void PdfFileWriter::StartFile(void) { bodyStart = (uint32_t)ftell(f); } -void PdfFileWriter::FinishAndCloseFile(void) { +void PdfFileWriter::FinishAndCloseFile() { uint32_t bodyEnd = (uint32_t)ftell(f); fprintf(f, @@ -1087,7 +1087,7 @@ void PdfFileWriter::Bezier(SBezier *sb) { //----------------------------------------------------------------------------- // Routines for SVG output //----------------------------------------------------------------------------- -void SvgFileWriter::StartFile(void) { +void SvgFileWriter::StartFile() { fprintf(f, "\r\n" @@ -1211,7 +1211,7 @@ void SvgFileWriter::Bezier(SBezier *sb) { } } -void SvgFileWriter::FinishAndCloseFile(void) { +void SvgFileWriter::FinishAndCloseFile() { fprintf(f, "\r\n\r\n"); fclose(f); } @@ -1223,7 +1223,7 @@ double HpglFileWriter::MmToHpglUnits(double mm) { return mm*40; } -void HpglFileWriter::StartFile(void) { +void HpglFileWriter::StartFile() { fprintf(f, "IN;\r\n"); fprintf(f, "SP1;\r\n"); } @@ -1253,7 +1253,7 @@ void HpglFileWriter::Bezier(SBezier *sb) { } } -void HpglFileWriter::FinishAndCloseFile(void) { +void HpglFileWriter::FinishAndCloseFile() { fclose(f); } @@ -1262,7 +1262,7 @@ void HpglFileWriter::FinishAndCloseFile(void) { // multiple passes, and to specify the feeds and depth; those parameters get // set in the configuration screen. //----------------------------------------------------------------------------- -void GCodeFileWriter::StartFile(void) { +void GCodeFileWriter::StartFile() { sel = {}; } void GCodeFileWriter::StartPath(RgbaColor strokeRgb, double lineWidth, @@ -1284,7 +1284,7 @@ void GCodeFileWriter::Bezier(SBezier *sb) { } } -void GCodeFileWriter::FinishAndCloseFile(void) { +void GCodeFileWriter::FinishAndCloseFile() { SPolygon sp = {}; sel.AssemblePolygon(&sp, NULL); @@ -1324,7 +1324,7 @@ void GCodeFileWriter::FinishAndCloseFile(void) { // Routine for STEP output; just a wrapper around the general STEP stuff that // can also be used for surfaces or 3d curves. //----------------------------------------------------------------------------- -void Step2dFileWriter::StartFile(void) { +void Step2dFileWriter::StartFile() { sfw = {}; sfw.f = f; sfw.WriteHeader(); @@ -1347,7 +1347,7 @@ void Step2dFileWriter::Bezier(SBezier *sb) { sfw.curves.Add(&c); } -void Step2dFileWriter::FinishAndCloseFile(void) { +void Step2dFileWriter::FinishAndCloseFile() { sfw.WriteWireframe(); sfw.WriteFooter(); fclose(f); diff --git a/src/expr.cpp b/src/expr.cpp index f3c8b422..2f510008 100644 --- a/src/expr.cpp +++ b/src/expr.cpp @@ -82,7 +82,7 @@ ExprVector ExprVector::WithMagnitude(Expr *s) { return ScaledBy(s->Div(m)); } -Expr *ExprVector::Magnitude(void) { +Expr *ExprVector::Magnitude() { Expr *r; r = x->Square(); r = r->Plus(y->Square()); @@ -90,7 +90,7 @@ Expr *ExprVector::Magnitude(void) { return r->Sqrt(); } -Vector ExprVector::Eval(void) { +Vector ExprVector::Eval() { Vector r; r.x = x->Eval(); r.y = y->Eval(); @@ -126,7 +126,7 @@ ExprQuaternion ExprQuaternion::From(Quaternion qn) { return qe; } -ExprVector ExprQuaternion::RotationU(void) { +ExprVector ExprQuaternion::RotationU() { ExprVector u; Expr *two = Expr::From(2); @@ -144,7 +144,7 @@ ExprVector ExprQuaternion::RotationU(void) { return u; } -ExprVector ExprQuaternion::RotationV(void) { +ExprVector ExprQuaternion::RotationV() { ExprVector v; Expr *two = Expr::From(2); @@ -162,7 +162,7 @@ ExprVector ExprQuaternion::RotationV(void) { return v; } -ExprVector ExprQuaternion::RotationN(void) { +ExprVector ExprQuaternion::RotationN() { ExprVector n; Expr *two = Expr::From(2); @@ -203,7 +203,7 @@ ExprQuaternion ExprQuaternion::Times(ExprQuaternion b) { return r; } -Expr *ExprQuaternion::Magnitude(void) { +Expr *ExprQuaternion::Magnitude() { return ((w ->Square())->Plus( (vx->Square())->Plus( (vy->Square())->Plus( @@ -262,7 +262,7 @@ Expr *Expr::AnyOp(int newOp, Expr *b) { return r; } -int Expr::Children(void) { +int Expr::Children() { switch(op) { case PARAM: case PARAM_PTR: @@ -288,7 +288,7 @@ int Expr::Children(void) { } } -int Expr::Nodes(void) { +int Expr::Nodes() { switch(Children()) { case 0: return 1; case 1: return 1 + a->Nodes(); @@ -297,7 +297,7 @@ int Expr::Nodes(void) { } } -Expr *Expr::DeepCopy(void) { +Expr *Expr::DeepCopy() { Expr *n = AllocExpr(); *n = *this; int c = n->Children(); @@ -333,7 +333,7 @@ Expr *Expr::DeepCopyWithParamsAsPointers(IdList *firstTry, return n; } -double Expr::Eval(void) { +double Expr::Eval() { switch(op) { case PARAM: return SK.GetParam(parh)->val; case PARAM_PTR: return parp->val; @@ -400,7 +400,7 @@ Expr *Expr::PartialWrt(hParam p) { } } -uint64_t Expr::ParamsUsed(void) { +uint64_t Expr::ParamsUsed() { uint64_t r = 0; if(op == PARAM) r |= ((uint64_t)1 << (parh.v % 61)); if(op == PARAM_PTR) r |= ((uint64_t)1 << (parp->h.v % 61)); @@ -424,7 +424,7 @@ bool Expr::DependsOn(hParam p) { bool Expr::Tol(double a, double b) { return fabs(a - b) < 0.001; } -Expr *Expr::FoldConstants(void) { +Expr *Expr::FoldConstants() { Expr *n = AllocExpr(); *n = *this; @@ -546,7 +546,7 @@ hParam Expr::ReferencedParams(ParamList *pl) { // Routines to pretty-print an expression. Mostly for debugging. //----------------------------------------------------------------------------- -std::string Expr::Print(void) { +std::string Expr::Print() { char c; switch(op) { @@ -597,11 +597,11 @@ void Expr::PushOperator(Expr *e) { if(OperatorsP >= MAX_UNPARSED) throw "operator stack full!"; Operators[OperatorsP++] = e; } -Expr *Expr::TopOperator(void) { +Expr *Expr::TopOperator() { if(OperatorsP <= 0) throw "operator stack empty (get top)"; return Operators[OperatorsP-1]; } -Expr *Expr::PopOperator(void) { +Expr *Expr::PopOperator() { if(OperatorsP <= 0) throw "operator stack empty (pop)"; return Operators[--OperatorsP]; } @@ -609,15 +609,15 @@ void Expr::PushOperand(Expr *e) { if(OperandsP >= MAX_UNPARSED) throw "operand stack full"; Operands[OperandsP++] = e; } -Expr *Expr::PopOperand(void) { +Expr *Expr::PopOperand() { if(OperandsP <= 0) throw "operand stack empty"; return Operands[--OperandsP]; } -Expr *Expr::Next(void) { +Expr *Expr::Next() { if(UnparsedP >= UnparsedCnt) return NULL; return Unparsed[UnparsedP]; } -void Expr::Consume(void) { +void Expr::Consume() { if(UnparsedP >= UnparsedCnt) throw "no token to consume"; UnparsedP++; } @@ -642,7 +642,7 @@ int Expr::Precedence(Expr *e) { } } -void Expr::Reduce(void) { +void Expr::Reduce() { Expr *a, *b; Expr *op = PopOperator(); @@ -676,7 +676,7 @@ void Expr::ReduceAndPush(Expr *n) { PushOperator(n); } -void Expr::Parse(void) { +void Expr::Parse() { Expr *e = AllocExpr(); e->op = ALL_RESOLVED; PushOperator(e); diff --git a/src/expr.h b/src/expr.h index eaf79b0c..42222acb 100644 --- a/src/expr.h +++ b/src/expr.h @@ -60,7 +60,7 @@ public: Expr() { } Expr(double val) : op(CONSTANT) { v = val; } - static inline Expr *AllocExpr(void) + static inline Expr *AllocExpr() { return (Expr *)AllocTemporary(sizeof(Expr)); } static Expr *From(hParam p); @@ -72,36 +72,36 @@ public: inline Expr *Times(Expr *b_) { return AnyOp(TIMES, b_); } inline Expr *Div (Expr *b_) { return AnyOp(DIV, b_); } - inline Expr *Negate(void) { return AnyOp(NEGATE, NULL); } - inline Expr *Sqrt (void) { return AnyOp(SQRT, NULL); } - inline Expr *Square(void) { return AnyOp(SQUARE, NULL); } - inline Expr *Sin (void) { return AnyOp(SIN, NULL); } - inline Expr *Cos (void) { return AnyOp(COS, NULL); } - inline Expr *ASin (void) { return AnyOp(ASIN, NULL); } - inline Expr *ACos (void) { return AnyOp(ACOS, NULL); } + inline Expr *Negate() { return AnyOp(NEGATE, NULL); } + inline Expr *Sqrt () { return AnyOp(SQRT, NULL); } + inline Expr *Square() { return AnyOp(SQUARE, NULL); } + inline Expr *Sin () { return AnyOp(SIN, NULL); } + inline Expr *Cos () { return AnyOp(COS, NULL); } + inline Expr *ASin () { return AnyOp(ASIN, NULL); } + inline Expr *ACos () { return AnyOp(ACOS, NULL); } Expr *PartialWrt(hParam p); - double Eval(void); - uint64_t ParamsUsed(void); + double Eval(); + uint64_t ParamsUsed(); bool DependsOn(hParam p); static bool Tol(double a, double b); - Expr *FoldConstants(void); + Expr *FoldConstants(); void Substitute(hParam oldh, hParam newh); static const hParam NO_PARAMS, MULTIPLE_PARAMS; hParam ReferencedParams(ParamList *pl); - void ParamsToPointers(void); + void ParamsToPointers(); - std::string Print(void); + std::string Print(); // number of child nodes: 0 (e.g. constant), 1 (sqrt), or 2 (+) - int Children(void); + int Children(); // total number of nodes in the tree - int Nodes(void); + int Nodes(); // Make a simple copy - Expr *DeepCopy(void); + Expr *DeepCopy(); // Make a copy, with the parameters (usually referenced by hParam) // resolved to pointers to the actual value. This speeds things up // considerably. @@ -110,21 +110,21 @@ public: static Expr *From(const char *in, bool popUpError); static void Lex(const char *in); - static Expr *Next(void); - static void Consume(void); + static Expr *Next(); + static void Consume(); static void PushOperator(Expr *e); - static Expr *PopOperator(void); - static Expr *TopOperator(void); + static Expr *PopOperator(); + static Expr *TopOperator(); static void PushOperand(Expr *e); - static Expr *PopOperand(void); + static Expr *PopOperand(); - static void Reduce(void); + static void Reduce(); static void ReduceAndPush(Expr *e); static int Precedence(Expr *e); static int Precedence(int op); - static void Parse(void); + static void Parse(); }; class ExprVector { @@ -142,9 +142,9 @@ public: ExprVector Cross(ExprVector b); ExprVector ScaledBy(Expr *s); ExprVector WithMagnitude(Expr *s); - Expr *Magnitude(void); + Expr *Magnitude(); - Vector Eval(void); + Vector Eval(); }; class ExprQuaternion { @@ -155,14 +155,14 @@ public: static ExprQuaternion From(Quaternion qn); static ExprQuaternion From(hParam w, hParam vx, hParam vy, hParam vz); - ExprVector RotationU(void); - ExprVector RotationV(void); - ExprVector RotationN(void); + ExprVector RotationU(); + ExprVector RotationV(); + ExprVector RotationN(); ExprVector Rotate(ExprVector p); ExprQuaternion Times(ExprQuaternion b); - Expr *Magnitude(void); + Expr *Magnitude(); }; #endif diff --git a/src/file.cpp b/src/file.cpp index 705510f2..a423d177 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -16,7 +16,7 @@ static int StrStartsWith(const char *str, const char *start) { // sketch. This does not leave the program in an acceptable state (with the // references created, and so on), so anyone calling this must fix that later. //----------------------------------------------------------------------------- -void SolveSpaceUI::ClearExisting(void) { +void SolveSpaceUI::ClearExisting() { UndoClearStack(&redo); UndoClearStack(&undo); @@ -35,7 +35,7 @@ void SolveSpaceUI::ClearExisting(void) { SK.param.Clear(); } -hGroup SolveSpaceUI::CreateDefaultDrawingGroup(void) { +hGroup SolveSpaceUI::CreateDefaultDrawingGroup() { Group g = {}; // And an empty group, for the first stuff the user draws. @@ -52,7 +52,7 @@ hGroup SolveSpaceUI::CreateDefaultDrawingGroup(void) { return g.h; } -void SolveSpaceUI::NewFile(void) { +void SolveSpaceUI::NewFile() { ClearExisting(); // Our initial group, that contains the references. diff --git a/src/generate.cpp b/src/generate.cpp index c96217cc..16117d94 100644 --- a/src/generate.cpp +++ b/src/generate.cpp @@ -28,7 +28,7 @@ void SolveSpaceUI::MarkGroupDirty(hGroup hg) { unsaved = true; } -bool SolveSpaceUI::PruneOrphans(void) { +bool SolveSpaceUI::PruneOrphans() { int i; for(i = 0; i < SK.request.n; i++) { Request *r = &(SK.request.elem[i]); @@ -399,7 +399,7 @@ pruned: GenerateAll(type, andFindFree, genForBBox); } -void SolveSpaceUI::ForceReferences(void) { +void SolveSpaceUI::ForceReferences() { // Force the values of the parameters that define the three reference // coordinate systems. static const struct { @@ -429,7 +429,7 @@ void SolveSpaceUI::ForceReferences(void) { } } -void SolveSpaceUI::MarkDraggedParams(void) { +void SolveSpaceUI::MarkDraggedParams() { sys.dragged.Clear(); for(int i = -1; i < SS.GW.pending.points.n; i++) { diff --git a/src/glhelper.cpp b/src/glhelper.cpp index 9aacc3ad..5234ad08 100644 --- a/src/glhelper.cpp +++ b/src/glhelper.cpp @@ -244,7 +244,7 @@ void ssglLockColorTo(RgbaColor rgb) ColorLocked = true; } -void ssglUnlockColor(void) +void ssglUnlockColor() { ColorLocked = false; } diff --git a/src/graphicswin.cpp b/src/graphicswin.cpp index 8776f29e..c0ea4d1a 100644 --- a/src/graphicswin.cpp +++ b/src/graphicswin.cpp @@ -204,7 +204,7 @@ std::string SolveSpace::MakeAcceleratorLabel(int accel) { return label; } -void GraphicsWindow::Init(void) { +void GraphicsWindow::Init() { scale = 5; offset = Vector::From(0, 0, 0); projRight = Vector::From(1, 0, 0); @@ -239,7 +239,7 @@ void GraphicsWindow::Init(void) { ClearSuper(); } -void GraphicsWindow::AnimateOntoWorkplane(void) { +void GraphicsWindow::AnimateOntoWorkplane() { if(!LockedInWorkplane()) return; Entity *w = SK.GetEntity(ActiveWorkplane()); @@ -601,7 +601,7 @@ void GraphicsWindow::MenuView(int id) { InvalidateGraphics(); } -void GraphicsWindow::EnsureValidActives(void) { +void GraphicsWindow::EnsureValidActives() { bool change = false; // The active group must exist, and not be the references. Group *g = SK.group.FindByIdNoOops(activeGroup); @@ -681,10 +681,10 @@ void GraphicsWindow::EnsureValidActives(void) { if(change) SS.ScheduleShowTW(); } -void GraphicsWindow::SetWorkplaneFreeIn3d(void) { +void GraphicsWindow::SetWorkplaneFreeIn3d() { SK.GetGroup(activeGroup)->activeWorkplane = Entity::FREE_IN_3D; } -hEntity GraphicsWindow::ActiveWorkplane(void) { +hEntity GraphicsWindow::ActiveWorkplane() { Group *g = SK.group.FindByIdNoOops(activeGroup); if(g) { return g->activeWorkplane; @@ -692,11 +692,11 @@ hEntity GraphicsWindow::ActiveWorkplane(void) { return Entity::FREE_IN_3D; } } -bool GraphicsWindow::LockedInWorkplane(void) { +bool GraphicsWindow::LockedInWorkplane() { return (SS.GW.ActiveWorkplane().v != Entity::FREE_IN_3D.v); } -void GraphicsWindow::ForceTextWindowShown(void) { +void GraphicsWindow::ForceTextWindowShown() { if(!showTextWindow) { showTextWindow = true; CheckMenuById(MNU_SHOW_TEXT_WND, true); @@ -704,7 +704,7 @@ void GraphicsWindow::ForceTextWindowShown(void) { } } -void GraphicsWindow::DeleteTaggedRequests(void) { +void GraphicsWindow::DeleteTaggedRequests() { // Rewrite any point-coincident constraints that were affected by this // deletion. Request *r; @@ -1039,7 +1039,7 @@ c: } } -void GraphicsWindow::ClearSuper(void) { +void GraphicsWindow::ClearSuper() { HideGraphicsEditControl(); ClearPending(); ClearSelection(); diff --git a/src/group.cpp b/src/group.cpp index 2b921e5a..6d3b2f59 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -19,7 +19,7 @@ const hGroup Group::HGROUP_REFERENCES = { 1 }; // The group structure includes pointers to other dynamically-allocated // memory. This clears and frees them all. //----------------------------------------------------------------------------- -void Group::Clear(void) { +void Group::Clear() { polyLoops.Clear(); bezierLoops.Clear(); bezierOpens.Clear(); @@ -45,7 +45,7 @@ void Group::AddParam(IdList *param, hParam hp, double v) { param->Add(&pa); } -bool Group::IsVisible(void) { +bool Group::IsVisible() { if(!visible) return false; if(SS.GroupsInOrder(SS.GW.activeGroup, h)) return false; return true; @@ -314,7 +314,7 @@ void Group::TransformImportedBy(Vector t, Quaternion q) { SK.GetParam(qz)->val = qg.vz; } -std::string Group::DescriptionString(void) { +std::string Group::DescriptionString() { if(name.empty()) { return ssprintf("g%03x-(unnamed)", h.v); } else { @@ -322,7 +322,7 @@ std::string Group::DescriptionString(void) { } } -void Group::Activate(void) { +void Group::Activate() { if(type == EXTRUDE || type == LINKED || type == LATHE || type == TRANSLATE || type == ROTATE) { SS.GW.showFaces = true; } else { diff --git a/src/groupmesh.cpp b/src/groupmesh.cpp index 342f0c24..a61945d2 100644 --- a/src/groupmesh.cpp +++ b/src/groupmesh.cpp @@ -53,7 +53,7 @@ void Group::AssembleLoops(bool *allClosed, sbl.Clear(); } -void Group::GenerateLoops(void) { +void Group::GenerateLoops() { polyLoops.Clear(); bezierLoops.Clear(); bezierOpens.Clear(); @@ -177,7 +177,7 @@ void Group::GenerateForBoolean(T *prevs, T *thiss, T *outs, int how) { } } -void Group::GenerateShellAndMesh(void) { +void Group::GenerateShellAndMesh() { bool prevBooleanFailed = booleanFailed; booleanFailed = false; @@ -357,7 +357,7 @@ void Group::GenerateShellAndMesh(void) { displayDirty = true; } -void Group::GenerateDisplayItems(void) { +void Group::GenerateDisplayItems() { // This is potentially slow (since we've got to triangulate a shell, or // to find the emphasized edges for a mesh), so we will run it only // if its inputs have changed. @@ -421,7 +421,7 @@ void Group::GenerateDisplayItems(void) { } } -Group *Group::PreviousGroup(void) { +Group *Group::PreviousGroup() { int i; for(i = 0; i < SK.groupOrder.n; i++) { Group *g = SK.GetGroup(SK.groupOrder.elem[i]); @@ -431,7 +431,7 @@ Group *Group::PreviousGroup(void) { return SK.GetGroup(SK.groupOrder.elem[i - 1]); } -Group *Group::RunningMeshGroup(void) { +Group *Group::RunningMeshGroup() { if(type == TRANSLATE || type == ROTATE) { return SK.GetGroup(opA)->RunningMeshGroup(); } else { @@ -518,7 +518,7 @@ void Group::DrawDisplayItems(int t) { if(SS.GW.showMesh) ssglDebugMesh(&displayMesh); } -void Group::Draw(void) { +void Group::Draw() { // Everything here gets drawn whether or not the group is hidden; we // can control this stuff independently, with show/hide solids, edges, // mesh, etc. @@ -583,7 +583,7 @@ void Group::FillLoopSetAsPolygon(SBezierLoopSet *sbls) { sp.Clear(); } -void Group::DrawFilledPaths(void) { +void Group::DrawFilledPaths() { SBezierLoopSet *sbls; SBezierLoopSetSet *sblss = &bezierLoops; for(sbls = sblss->l.First(); sbls; sbls = sblss->l.NextAfter(sbls)) { diff --git a/src/mesh.cpp b/src/mesh.cpp index 737a92ef..fe30f947 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -8,7 +8,7 @@ #include -void SMesh::Clear(void) { +void SMesh::Clear() { l.Clear(); } @@ -322,7 +322,7 @@ void SMesh::MakeFromTransformationOf(SMesh *a, } } -bool SMesh::IsEmpty(void) { +bool SMesh::IsEmpty() { return (l.n == 0); } @@ -356,9 +356,9 @@ uint32_t SMesh::FirstIntersectionWith(Point2d mp) { return face; } -STriangleLl *STriangleLl::Alloc(void) +STriangleLl *STriangleLl::Alloc() { return (STriangleLl *)AllocTemporary(sizeof(STriangleLl)); } -SKdNode *SKdNode::Alloc(void) +SKdNode *SKdNode::Alloc() { return (SKdNode *)AllocTemporary(sizeof(SKdNode)); } SKdNode *SKdNode::From(SMesh *m) { @@ -487,7 +487,7 @@ leaf: return ret; } -void SKdNode::ClearTags(void) { +void SKdNode::ClearTags() { if(gt && lt) { gt->ClearTags(); lt->ClearTags(); diff --git a/src/modify.cpp b/src/modify.cpp index 1d18fa0e..6162db1c 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -133,7 +133,7 @@ void GraphicsWindow::ParametricCurve::MakeFromEntity(hEntity he, bool reverse) { v = wrkpln->NormalV(); } else ssassert(false, "Unexpected entity type"); } -double GraphicsWindow::ParametricCurve::LengthForAuto(void) { +double GraphicsWindow::ParametricCurve::LengthForAuto() { if(isLine) { // Allow a third of the line to disappear with auto radius return (p1.Minus(p0)).Magnitude() / 3; @@ -232,7 +232,7 @@ void GraphicsWindow::ParametricCurve::ConstrainPointIfCoincident(hEntity hpt) { // non-construction line segments that join at this point, and create a // tangent arc joining them. //----------------------------------------------------------------------------- -void GraphicsWindow::MakeTangentArc(void) { +void GraphicsWindow::MakeTangentArc() { if(!LockedInWorkplane()) { Error("Must be sketching in workplane to create tangent " "arc."); @@ -599,7 +599,7 @@ hEntity GraphicsWindow::SplitEntity(hEntity he, Vector pinter) { return ret; } -void GraphicsWindow::SplitLinesOrCurves(void) { +void GraphicsWindow::SplitLinesOrCurves() { if(!LockedInWorkplane()) { Error("Must be sketching in workplane to split."); return; diff --git a/src/mouse.cpp b/src/mouse.cpp index 4da6218d..6d737b7e 100644 --- a/src/mouse.cpp +++ b/src/mouse.cpp @@ -62,7 +62,7 @@ void GraphicsWindow::StartDraggingByEntity(hEntity he) { } } -void GraphicsWindow::StartDraggingBySelection(void) { +void GraphicsWindow::StartDraggingBySelection() { List *ls = &(selection); for(Selection *s = ls->First(); s; s = ls->NextAfter(s)) { if(!s->entity.v) continue; @@ -466,7 +466,7 @@ void GraphicsWindow::MouseMoved(double x, double y, bool leftDown, } } -void GraphicsWindow::ClearPending(void) { +void GraphicsWindow::ClearPending() { pending.points.Clear(); pending = {}; SS.ScheduleShowTW(); @@ -483,7 +483,7 @@ void GraphicsWindow::MouseMiddleOrRightDown(double x, double y) { orig.startedMoving = false; } -void GraphicsWindow::ContextMenuListStyles(void) { +void GraphicsWindow::ContextMenuListStyles() { CreateContextSubmenu(); Style *s; bool empty = true; @@ -1394,7 +1394,7 @@ void GraphicsWindow::MouseScroll(double x, double y, int delta) { InvalidateGraphics(); } -void GraphicsWindow::MouseLeave(void) { +void GraphicsWindow::MouseLeave() { // Un-hover everything when the mouse leaves our window, unless there's // currently a context menu shown. if(!context.active) { @@ -1472,7 +1472,7 @@ void GraphicsWindow::SpaceNavigatorMoved(double tx, double ty, double tz, InvalidateGraphics(); } -void GraphicsWindow::SpaceNavigatorButtonUp(void) { +void GraphicsWindow::SpaceNavigatorButtonUp() { ZoomToFit(/*includingInvisibles=*/false, /*useSelection=*/true); InvalidateGraphics(); } diff --git a/src/platform/w32main.cpp b/src/platform/w32main.cpp index a3fe02b5..ae1a721a 100644 --- a/src/platform/w32main.cpp +++ b/src/platform/w32main.cpp @@ -203,12 +203,12 @@ void SolveSpace::AddContextMenuItem(const char *label, int id) } } -void SolveSpace::CreateContextSubmenu(void) +void SolveSpace::CreateContextSubmenu() { ContextSubmenu = CreatePopupMenu(); } -int SolveSpace::ShowContextMenu(void) +int SolveSpace::ShowContextMenu() { POINT p; GetCursorPos(&p); @@ -268,7 +268,7 @@ void SolveSpace::OpenWebsite(const char *url) { ShellExecuteW(GraphicsWnd, L"open", Widen(url).c_str(), NULL, NULL, SW_SHOWNORMAL); } -void SolveSpace::ExitNow(void) { +void SolveSpace::ExitNow() { PostQuitMessage(0); } @@ -710,11 +710,11 @@ static bool ProcessKeyDown(WPARAM wParam) return false; } -void SolveSpace::ToggleMenuBar(void) +void SolveSpace::ToggleMenuBar() { // Implement me } -bool SolveSpace::MenuBarIsVisible(void) +bool SolveSpace::MenuBarIsVisible() { // Implement me return true; @@ -752,27 +752,27 @@ static void CreateGlContext(HWND hwnd, HGLRC *glrc) wglMakeCurrent(hdc, *glrc); } -void SolveSpace::PaintGraphics(void) +void SolveSpace::PaintGraphics() { SS.GW.Paint(); SwapBuffers(GetDC(GraphicsWnd)); } -void SolveSpace::InvalidateGraphics(void) +void SolveSpace::InvalidateGraphics() { InvalidateRect(GraphicsWnd, NULL, false); } -void SolveSpace::ToggleFullScreen(void) +void SolveSpace::ToggleFullScreen() { // Implement me } -bool SolveSpace::FullScreenIsActive(void) +bool SolveSpace::FullScreenIsActive() { // Implement me return false; } -int64_t SolveSpace::GetMilliseconds(void) +int64_t SolveSpace::GetMilliseconds() { LARGE_INTEGER t, f; QueryPerformanceCounter(&t); @@ -781,7 +781,7 @@ int64_t SolveSpace::GetMilliseconds(void) return (int64_t)d; } -void SolveSpace::InvalidateText(void) +void SolveSpace::InvalidateText() { InvalidateRect(TextWnd, NULL, false); } @@ -830,11 +830,11 @@ void SolveSpace::ShowTextEditControl(int x, int y, const std::string &str) ShowEditControl(TextEditControl, x, y, TextWindow::CHAR_HEIGHT, 30, /*isMonospace=*/true, Widen(str)); } -void SolveSpace::HideTextEditControl(void) +void SolveSpace::HideTextEditControl() { ShowWindow(TextEditControl, SW_HIDE); } -bool SolveSpace::TextEditControlIsVisible(void) +bool SolveSpace::TextEditControlIsVisible() { return IsWindowVisible(TextEditControl) ? true : false; } @@ -851,11 +851,11 @@ void SolveSpace::ShowGraphicsEditControl(int x, int y, int fontHeight, int minWi ShowEditControl(GraphicsEditControl, x, y, fontHeight, minWidthChars, /*isMonospace=*/false, Widen(str)); } -void SolveSpace::HideGraphicsEditControl(void) +void SolveSpace::HideGraphicsEditControl() { ShowWindow(GraphicsEditControl, SW_HIDE); } -bool SolveSpace::GraphicsEditControlIsVisible(void) +bool SolveSpace::GraphicsEditControlIsVisible() { return IsWindowVisible(GraphicsEditControl) ? true : false; } @@ -1048,7 +1048,7 @@ bool SolveSpace::GetSaveFile(std::string *filename, const std::string &defExtens return OpenSaveFile(false, filename, defExtension, filters); } -DialogChoice SolveSpace::SaveFileYesNoCancel(void) +DialogChoice SolveSpace::SaveFileYesNoCancel() { EnableWindow(GraphicsWnd, false); EnableWindow(TextWnd, false); @@ -1073,7 +1073,7 @@ DialogChoice SolveSpace::SaveFileYesNoCancel(void) } } -DialogChoice SolveSpace::LoadAutosaveYesNo(void) +DialogChoice SolveSpace::LoadAutosaveYesNo() { EnableWindow(GraphicsWnd, false); EnableWindow(TextWnd, false); @@ -1192,13 +1192,13 @@ static void DoRecent(HMENU m, int base) } if(c == 0) AppendMenuW(m, MF_STRING | MF_GRAYED, 0, L"(no recent files)"); } -void SolveSpace::RefreshRecentMenus(void) +void SolveSpace::RefreshRecentMenus() { DoRecent(RecentOpenMenu, RECENT_OPEN); DoRecent(RecentImportMenu, RECENT_LINK); } -HMENU CreateGraphicsWindowMenus(void) +HMENU CreateGraphicsWindowMenus() { HMENU top = CreateMenu(); HMENU m = 0; @@ -1241,7 +1241,7 @@ HMENU CreateGraphicsWindowMenus(void) return top; } -static void CreateMainWindows(void) +static void CreateMainWindows() { WNDCLASSEX wc = {}; diff --git a/src/platform/w32util.cpp b/src/platform/w32util.cpp index b9d72a8a..a79642c7 100644 --- a/src/platform/w32util.cpp +++ b/src/platform/w32util.cpp @@ -115,7 +115,7 @@ void *AllocTemporary(size_t n) void FreeTemporary(void *p) { HeapFree(TempHeap, HEAP_NO_SERIALIZE, p); } -void FreeAllTemporary(void) +void FreeAllTemporary() { if(TempHeap) HeapDestroy(TempHeap); TempHeap = HeapCreate(HEAP_NO_SERIALIZE, 1024*1024*20, 0); @@ -133,12 +133,12 @@ void MemFree(void *p) { HeapFree(PermHeap, HEAP_NO_SERIALIZE, p); } -void vl(void) { +void vl() { ssassert(HeapValidate(TempHeap, HEAP_NO_SERIALIZE, NULL), "Corrupted heap"); ssassert(HeapValidate(PermHeap, HEAP_NO_SERIALIZE, NULL), "Corrupted heap"); } -void InitHeaps(void) { +void InitHeaps() { // Create the heap used for long-lived stuff (that gets freed piecewise). PermHeap = HeapCreate(HEAP_NO_SERIALIZE, 1024*1024*20, 0); // Create the heap that we use to store Exprs and other temp stuff. diff --git a/src/polygon.cpp b/src/polygon.cpp index bc1f3226..f035f104 100644 --- a/src/polygon.cpp +++ b/src/polygon.cpp @@ -5,12 +5,12 @@ //----------------------------------------------------------------------------- #include "solvespace.h" -Vector STriangle::Normal(void) { +Vector STriangle::Normal() { Vector ab = b.Minus(a), bc = c.Minus(b); return ab.Cross(bc); } -double STriangle::MinAltitude(void) { +double STriangle::MinAltitude() { double altA = a.DistanceToLine(b, c.Minus(b)), altB = b.DistanceToLine(c, a.Minus(c)), altC = c.DistanceToLine(a, b.Minus(a)); @@ -42,7 +42,7 @@ bool STriangle::ContainsPointProjd(Vector n, Vector p) { return true; } -void STriangle::FlipNormal(void) { +void STriangle::FlipNormal() { swap(a, b); swap(an, bn); } @@ -141,7 +141,7 @@ bool SEdge::EdgeCrosses(Vector ea, Vector eb, Vector *ppi, SPointList *spl) { return false; } -void SEdgeList::Clear(void) { +void SEdgeList::Clear() { l.Clear(); } @@ -270,7 +270,7 @@ bool SEdgeList::ContainsEdge(SEdge *set) { // Remove unnecessary edges: if two are anti-parallel then remove both, and if // two are parallel then remove one. //----------------------------------------------------------------------------- -void SEdgeList::CullExtraneousEdges(void) { +void SEdgeList::CullExtraneousEdges() { l.ClearTags(); int i, j; for(i = 0; i < l.n; i++) { @@ -295,12 +295,12 @@ void SEdgeList::CullExtraneousEdges(void) { // Make a kd-tree of edges. This is used for O(log(n)) implementations of stuff // that would naively be O(n). //----------------------------------------------------------------------------- -SKdNodeEdges *SKdNodeEdges::Alloc(void) { +SKdNodeEdges *SKdNodeEdges::Alloc() { SKdNodeEdges *ne = (SKdNodeEdges *)AllocTemporary(sizeof(SKdNodeEdges)); *ne = {}; return ne; } -SEdgeLl *SEdgeLl::Alloc(void) { +SEdgeLl *SEdgeLl::Alloc() { SEdgeLl *sell = (SEdgeLl *)AllocTemporary(sizeof(SEdgeLl)); *sell = {}; return sell; @@ -458,7 +458,7 @@ void SEdgeList::MergeCollinearSegments(Vector a, Vector b) { l.RemoveTagged(); } -void SPointList::Clear(void) { +void SPointList::Clear() { l.Clear(); } @@ -520,7 +520,7 @@ void SContour::CopyInto(SContour *dest) { } } -void SContour::FindPointWithMinX(void) { +void SContour::FindPointWithMinX() { SPoint *sp; xminPt = Vector::From(1e10, 1e10, 1e10); for(sp = l.First(); sp; sp = l.NextAfter(sp)) { @@ -530,7 +530,7 @@ void SContour::FindPointWithMinX(void) { } } -Vector SContour::ComputeNormal(void) { +Vector SContour::ComputeNormal() { Vector n = Vector::From(0, 0, 0); for(int i = 0; i < l.n - 2; i++) { @@ -544,7 +544,7 @@ Vector SContour::ComputeNormal(void) { return n.WithMagnitude(1); } -Vector SContour::AnyEdgeMidpoint(void) { +Vector SContour::AnyEdgeMidpoint() { ssassert(l.n >= 2, "Need two points to find a midpoint"); return ((l.elem[0].p).Plus(l.elem[1].p)).ScaledBy(0.5); } @@ -600,12 +600,12 @@ bool SContour::ContainsPointProjdToNormal(Vector n, Vector p) { return inside; } -void SContour::Reverse(void) { +void SContour::Reverse() { l.Reverse(); } -void SPolygon::Clear(void) { +void SPolygon::Clear() { int i; for(i = 0; i < l.n; i++) { (l.elem[i]).l.Clear(); @@ -613,7 +613,7 @@ void SPolygon::Clear(void) { l.Clear(); } -void SPolygon::AddEmptyContour(void) { +void SPolygon::AddEmptyContour() { SContour c = {}; l.Add(&c); } @@ -625,12 +625,12 @@ void SPolygon::MakeEdgesInto(SEdgeList *el) { } } -Vector SPolygon::ComputeNormal(void) { +Vector SPolygon::ComputeNormal() { if(l.n < 1) return Vector::From(0, 0, 0); return (l.elem[0]).ComputeNormal(); } -double SPolygon::SignedArea(void) { +double SPolygon::SignedArea() { SContour *sc; double area = 0; // This returns the true area only if the contours are all oriented @@ -657,7 +657,7 @@ int SPolygon::WindingNumberForPoint(Vector p) { return winding; } -void SPolygon::FixContourDirections(void) { +void SPolygon::FixContourDirections() { // At output, the contour's tag will be 1 if we reversed it, else 0. l.ClearTags(); @@ -690,12 +690,12 @@ void SPolygon::FixContourDirections(void) { } } -bool SPolygon::IsEmpty(void) { +bool SPolygon::IsEmpty() { if(l.n == 0 || l.elem[0].l.n == 0) return true; return false; } -Vector SPolygon::AnyPoint(void) { +Vector SPolygon::AnyPoint() { ssassert(!IsEmpty(), "Need at least one point"); return l.elem[0].l.elem[0].p; } diff --git a/src/polygon.h b/src/polygon.h index 7d2907b1..5b4084f3 100644 --- a/src/polygon.h +++ b/src/polygon.h @@ -29,7 +29,7 @@ class SEdgeList { public: List l; - void Clear(void); + void Clear(); void AddEdge(Vector a, Vector b, int auxA=0, int auxB=0); bool AssemblePolygon(SPolygon *dest, SEdge *errorAt, bool keepDir=false); bool AssembleContour(Vector first, Vector last, SContour *dest, @@ -38,7 +38,7 @@ public: Vector *pi=NULL, SPointList *spl=NULL); bool ContainsEdgeFrom(SEdgeList *sel); bool ContainsEdge(SEdge *se); - void CullExtraneousEdges(void); + void CullExtraneousEdges(); void MergeCollinearSegments(Vector a, Vector b); }; @@ -52,7 +52,7 @@ public: SEdge *se; SEdgeLl *next; - static SEdgeLl *Alloc(void); + static SEdgeLl *Alloc(); }; class SKdNodeEdges { @@ -66,7 +66,7 @@ public: static SKdNodeEdges *From(SEdgeList *sel); static SKdNodeEdges *From(SEdgeLl *sell); - static SKdNodeEdges *Alloc(void); + static SKdNodeEdges *Alloc(); int AnyEdgeCrossings(Vector a, Vector b, int cnt, Vector *pi=NULL, SPointList *spl=NULL); }; @@ -90,7 +90,7 @@ class SPointList { public: List l; - void Clear(void); + void Clear(); bool ContainsPoint(Vector pt); int IndexForPoint(Vector pt); void IncrementTagFor(Vector pt); @@ -106,15 +106,15 @@ public: void AddPoint(Vector p); void MakeEdgesInto(SEdgeList *el); - void Reverse(void); - Vector ComputeNormal(void); + void Reverse(); + Vector ComputeNormal(); double SignedAreaProjdToNormal(Vector n); bool IsClockwiseProjdToNormal(Vector n); bool ContainsPointProjdToNormal(Vector n, Vector p); void OffsetInto(SContour *dest, double r); void CopyInto(SContour *dest); - void FindPointWithMinX(void); - Vector AnyEdgeMidpoint(void); + void FindPointWithMinX(); + Vector AnyEdgeMidpoint(); bool IsEar(int bp, double scaledEps); bool BridgeToContour(SContour *sc, SEdgeList *el, List *vl); @@ -132,17 +132,17 @@ public: List l; Vector normal; - Vector ComputeNormal(void); - void AddEmptyContour(void); + Vector ComputeNormal(); + void AddEmptyContour(); int WindingNumberForPoint(Vector p); - double SignedArea(void); + double SignedArea(); bool ContainsPoint(Vector p); void MakeEdgesInto(SEdgeList *el); - void FixContourDirections(void); - void Clear(void); + void FixContourDirections(); + void Clear(); bool SelfIntersecting(Vector *intersectsAt); - bool IsEmpty(void); - Vector AnyPoint(void); + bool IsEmpty(); + Vector AnyPoint(); void OffsetInto(SPolygon *dest, double r); void UvTriangulateInto(SMesh *m, SSurface *srf); void UvGridTriangulateInto(SMesh *m, SSurface *srf); @@ -156,9 +156,9 @@ public: Vector an, bn, cn; static STriangle From(STriMeta meta, Vector a, Vector b, Vector c); - Vector Normal(void); - void FlipNormal(void); - double MinAltitude(void); + Vector Normal(); + void FlipNormal(); + double MinAltitude(); int WindingNumberForPoint(Vector p); bool ContainsPoint(Vector p); bool ContainsPointProjd(Vector n, Vector p); @@ -183,7 +183,7 @@ public: Vector IntersectionWith(Vector a, Vector b); void InsertEdge(SEdge *nedge, Vector nnp, Vector out); static SBsp2 *InsertOrCreateEdge(SBsp2 *where, SEdge *nedge, Vector nnp, Vector out); - static SBsp2 *Alloc(void); + static SBsp2 *Alloc(); void DebugDraw(Vector n, double d); }; @@ -201,7 +201,7 @@ public: SBsp2 *edges; - static SBsp3 *Alloc(void); + static SBsp3 *Alloc(); static SBsp3 *FromMesh(SMesh *m); Vector IntersectionWith(Vector a, Vector b); @@ -219,7 +219,7 @@ public: void GenerateInPaintOrder(SMesh *m); - void DebugDraw(void); + void DebugDraw(); }; class SMesh { @@ -231,7 +231,7 @@ public: bool atLeastOneDiscarded; bool isTransparent; - void Clear(void); + void Clear(); void AddTriangle(STriangle *st); void AddTriangle(STriMeta meta, Vector a, Vector b, Vector c); void AddTriangle(STriMeta meta, Vector n, Vector a, Vector b, Vector c); @@ -252,7 +252,7 @@ public: void MakeEdgesInPlaneInto(SEdgeList *sel, Vector n, double d); void MakeCertainEdgesAndOutlinesInto(SEdgeList *sel, SOutlineList *sol, int type); - bool IsEmpty(void); + bool IsEmpty(); void RemapFaces(Group *g, int remap); uint32_t FirstIntersectionWith(Point2d mp); @@ -265,7 +265,7 @@ public: STriangleLl *next; - static STriangleLl *Alloc(void); + static STriangleLl *Alloc(); }; class SOutline { @@ -305,14 +305,14 @@ public: STriangleLl *tris; - static SKdNode *Alloc(void); + static SKdNode *Alloc(); static SKdNode *From(SMesh *m); static SKdNode *From(STriangleLl *tll); void AddTriangle(STriangle *tr); void MakeMeshInto(SMesh *m); void ListTrianglesInto(std::vector *tl); - void ClearTags(void); + void ClearTags(); void FindEdgeOn(Vector a, Vector b, int cnt, bool coplanarIsInter, EdgeOnInfo *info); enum { diff --git a/src/request.cpp b/src/request.cpp index 03db380d..aa3a4c82 100644 --- a/src/request.cpp +++ b/src/request.cpp @@ -169,7 +169,7 @@ void Request::Generate(IdList *entity, if(et) entity->Add(&e); } -std::string Request::DescriptionString(void) { +std::string Request::DescriptionString() { const char *s; if(h.v == Request::HREQUEST_REFERENCE_XY.v) { s = "#XY"; diff --git a/src/sketch.h b/src/sketch.h index 18189ba5..8fc76fc0 100644 --- a/src/sketch.h +++ b/src/sketch.h @@ -41,7 +41,7 @@ public: inline hEntity entity(int i); inline hParam param(int i); - inline bool IsFromReferences(void); + inline bool IsFromReferences(); }; class hEntity { public: @@ -49,9 +49,9 @@ public: // 31:16 -- request index uint32_t v; - inline bool isFromRequest(void); - inline hRequest request(void); - inline hGroup group(void); + inline bool isFromRequest(); + inline hRequest request(); + inline hGroup group(); inline hEquation equation(int i); }; class hParam { @@ -60,7 +60,7 @@ public: // 31:16 -- request index uint32_t v; - inline hRequest request(void); + inline hRequest request(); }; class hStyle { @@ -82,7 +82,7 @@ public: int copyNumber; // (input, copyNumber) gets mapped to ((Request)xxx).entity(h.v) - void Clear(void) {} + void Clear() {} }; // A set of requests. Every request must have an associated group. @@ -201,9 +201,9 @@ public: std::string name; - void Activate(void); - std::string DescriptionString(void); - void Clear(void); + void Activate(); + std::string DescriptionString(); + void Clear(); static void AddParam(ParamList *param, hParam hp, double v); void Generate(EntityList *entity, ParamList *param); @@ -236,7 +236,7 @@ public: void AddEq(IdList *l, Expr *expr, int index); void GenerateEquations(IdList *l); - bool IsVisible(void); + bool IsVisible(); int GetNumConstraints(); Vector ExtrusionGetVector(); void ExtrusionForceVectorTo(const Vector &v); @@ -244,23 +244,23 @@ public: // Assembling the curves into loops, and into a piecewise linear polygon // at the same time. void AssembleLoops(bool *allClosed, bool *allCoplanar, bool *allNonZeroLen); - void GenerateLoops(void); + void GenerateLoops(); // And the mesh stuff - Group *PreviousGroup(void); - Group *RunningMeshGroup(void); + Group *PreviousGroup(); + Group *RunningMeshGroup(); bool IsMeshGroup(); - void GenerateShellAndMesh(void); + void GenerateShellAndMesh(); template void GenerateForStepAndRepeat(T *steps, T *outs); template void GenerateForBoolean(T *a, T *b, T *o, int how); - void GenerateDisplayItems(void); + void GenerateDisplayItems(); void DrawDisplayItems(int t); - void Draw(void); + void Draw(); RgbaColor GetLoopSetFillColor(SBezierLoopSet *sbls, bool *allSame, Vector *errorAt); void FillLoopSetAsPolygon(SBezierLoopSet *sbls); - void DrawFilledPaths(void); + void DrawFilledPaths(); - SPolygon GetPolygon(void); + SPolygon GetPolygon(); static void MenuGroup(int id); }; @@ -303,10 +303,10 @@ public: static hParam AddParam(ParamList *param, hParam hp); void Generate(EntityList *entity, ParamList *param); - std::string DescriptionString(void); + std::string DescriptionString(); int IndexOfPoint(hEntity he); - void Clear(void) {} + void Clear() {} }; #define MAX_POINTS_IN_ENTITY (12) @@ -381,74 +381,74 @@ public: Quaternion GetAxisAngleQuaternion(int param0); ExprQuaternion GetAxisAngleQuaternionExprs(int param0); - bool IsCircle(void); - Expr *CircleGetRadiusExpr(void); - double CircleGetRadiusNum(void); + bool IsCircle(); + Expr *CircleGetRadiusExpr(); + double CircleGetRadiusNum(); void ArcGetAngles(double *thetaa, double *thetab, double *dtheta); - bool HasVector(void); - ExprVector VectorGetExprs(void); - Vector VectorGetNum(void); - Vector VectorGetRefPoint(void); - Vector VectorGetStartPoint(void); + bool HasVector(); + ExprVector VectorGetExprs(); + Vector VectorGetNum(); + Vector VectorGetRefPoint(); + Vector VectorGetStartPoint(); // For distances - bool IsDistance(void); - double DistanceGetNum(void); - Expr *DistanceGetExpr(void); + bool IsDistance(); + double DistanceGetNum(); + Expr *DistanceGetExpr(); void DistanceForceTo(double v); - bool IsWorkplane(void); + bool IsWorkplane(); // The plane is points P such that P dot (xn, yn, zn) - d = 0 void WorkplaneGetPlaneExprs(ExprVector *n, Expr **d); - ExprVector WorkplaneGetOffsetExprs(void); - Vector WorkplaneGetOffset(void); - EntityBase *Normal(void); + ExprVector WorkplaneGetOffsetExprs(); + Vector WorkplaneGetOffset(); + EntityBase *Normal(); - bool IsFace(void); - ExprVector FaceGetNormalExprs(void); - Vector FaceGetNormalNum(void); - ExprVector FaceGetPointExprs(void); - Vector FaceGetPointNum(void); + bool IsFace(); + ExprVector FaceGetNormalExprs(); + Vector FaceGetNormalNum(); + ExprVector FaceGetPointExprs(); + Vector FaceGetPointNum(); - bool IsPoint(void); + bool IsPoint(); // Applies for any of the point types - Vector PointGetNum(void); - ExprVector PointGetExprs(void); + Vector PointGetNum(); + ExprVector PointGetExprs(); void PointGetExprsInWorkplane(hEntity wrkpl, Expr **u, Expr **v); void PointForceTo(Vector v); // These apply only the POINT_N_ROT_TRANS, which has an assoc rotation - Quaternion PointGetQuaternion(void); + Quaternion PointGetQuaternion(); void PointForceQuaternionTo(Quaternion q); - bool IsNormal(void); + bool IsNormal(); // Applies for any of the normal types - Quaternion NormalGetNum(void); - ExprQuaternion NormalGetExprs(void); + Quaternion NormalGetNum(); + ExprQuaternion NormalGetExprs(); void NormalForceTo(Quaternion q); - Vector NormalU(void); - Vector NormalV(void); - Vector NormalN(void); - ExprVector NormalExprsU(void); - ExprVector NormalExprsV(void); - ExprVector NormalExprsN(void); + Vector NormalU(); + Vector NormalV(); + Vector NormalN(); + ExprVector NormalExprsU(); + ExprVector NormalExprsV(); + ExprVector NormalExprsN(); - Vector CubicGetStartNum(void); - Vector CubicGetFinishNum(void); - ExprVector CubicGetStartTangentExprs(void); - ExprVector CubicGetFinishTangentExprs(void); - Vector CubicGetStartTangentNum(void); - Vector CubicGetFinishTangentNum(void); + Vector CubicGetStartNum(); + Vector CubicGetFinishNum(); + ExprVector CubicGetStartTangentExprs(); + ExprVector CubicGetFinishTangentExprs(); + Vector CubicGetStartTangentNum(); + Vector CubicGetFinishTangentNum(); - bool HasEndpoints(void); + bool HasEndpoints(); Vector EndpointStart(); Vector EndpointFinish(); void AddEq(IdList *l, Expr *expr, int index); void GenerateEquations(IdList *l); - void Clear(void) {} + void Clear() {} }; class Entity : public EntityBase { @@ -500,11 +500,11 @@ public: int data; } dogd; // state for drawing or getting distance (for hit testing) void LineDrawOrGetDistance(Vector a, Vector b, bool maybeFat=false, int userData = -1); - void DrawOrGetDistance(void); + void DrawOrGetDistance(); bool IsStylable(); - bool IsVisible(void); - bool PointIsFromReferences(void); + bool IsVisible(); + bool PointIsFromReferences(); void ComputeInterpolatingSpline(SBezierList *sbl, bool periodic); void GenerateBezierCurves(SBezierList *sbl); @@ -513,11 +513,11 @@ public: static void DrawAll(bool drawAsHidden); void Draw(bool drawAsHidden); double GetDistance(Point2d mp); - Vector GetReferencePos(void); + Vector GetReferencePos(); void CalculateNumerical(bool forExport); - std::string DescriptionString(void); + std::string DescriptionString(); SBezierList *GetOrGenerateBezierCurves(); SEdgeList *GetOrGenerateEdges(); @@ -567,7 +567,7 @@ public: static const hParam NO_PARAM; - void Clear(void) {} + void Clear() {} }; @@ -643,12 +643,12 @@ public: bool reference; // a ref dimension, that generates no eqs std::string comment; // since comments are represented as constraints - bool HasLabel(void); + bool HasLabel(); void Generate(IdList *l); void GenerateReal(IdList *l); // Some helpers when generating symbolic constraint equations - void ModifyToSatisfy(void); + void ModifyToSatisfy(); void AddEq(IdList *l, Expr *expr, int index); static Expr *DirectionCosine(hEntity wrkpl, ExprVector ae, ExprVector be); static Expr *Distance(hEntity workplane, hEntity pa, hEntity pb); @@ -657,7 +657,7 @@ public: static Expr *VectorsParallel(int eq, ExprVector a, ExprVector b); static ExprVector PointInThreeSpace(hEntity workplane, Expr *u, Expr *v); - void Clear(void) {} + void Clear() {} }; class Constraint : public ConstraintBase { @@ -681,9 +681,9 @@ public: } dogd; double GetDistance(Point2d mp); - Vector GetLabelPos(void); - Vector GetReferencePos(void); - void Draw(void); + Vector GetLabelPos(); + Vector GetReferencePos(); + void Draw(); void GetEdges(SEdgeList *sel); bool IsStylable(); hStyle GetStyle() const; @@ -692,7 +692,7 @@ public: void LineDrawOrGetDistance(Vector a, Vector b); bool IsVisible() const; void DrawOrGetDistance(Vector *labelPos); - std::string Label(void); + std::string Label(); bool DoLineExtend(Vector p0, Vector p1, Vector pt, double salient); void DoArcForAngle(Vector a0, Vector da, Vector b0, Vector db, Vector offset, Vector *ref, bool trim); @@ -706,7 +706,7 @@ public: void DoEqualLenTicks(Vector a, Vector b, Vector gn); void DoEqualRadiusTicks(hEntity he); - std::string DescriptionString(void); + std::string DescriptionString(); static hConstraint AddConstraint(Constraint *c, bool rememberForUndo); static hConstraint AddConstraint(Constraint *c); @@ -724,8 +724,8 @@ class hEquation { public: uint32_t v; - inline bool isFromConstraint(void); - inline hConstraint constraint(void); + inline bool isFromConstraint(); + inline hConstraint constraint(); }; class Equation { @@ -735,7 +735,7 @@ public: Expr *e; - void Clear(void) {} + void Clear() {} }; @@ -825,11 +825,11 @@ public: static std::string CnfTextHeight(const std::string &prefix); static std::string CnfPrefixToName(const std::string &prefix); - static void CreateAllDefaultStyles(void); + static void CreateAllDefaultStyles(); static void CreateDefaultStyle(hStyle h); static void FillDefaultStyle(Style *s, const Default *d = NULL); - static void FreezeDefaultStyles(void); - static void LoadFactoryDefaults(void); + static void FreezeDefaultStyles(); + static void LoadFactoryDefaults(); static void AssignSelectionToStyle(uint32_t v); static uint32_t CreateCustomStyle(bool rememberForUndo = true); @@ -850,9 +850,9 @@ public: static int PatternType(hStyle hs); static double StippleScaleMm(hStyle hs); - std::string DescriptionString(void); + std::string DescriptionString(); - void Clear(void) {} + void Clear() {} }; @@ -863,7 +863,7 @@ inline hParam hGroup::param(int i) inline hEquation hGroup::equation(int i) { hEquation r; r.v = (v << 16) | 0x80000000 | (uint32_t)i; return r; } -inline bool hRequest::IsFromReferences(void) { +inline bool hRequest::IsFromReferences() { if(v == Request::HREQUEST_REFERENCE_XY.v) return true; if(v == Request::HREQUEST_REFERENCE_YZ.v) return true; if(v == Request::HREQUEST_REFERENCE_ZX.v) return true; @@ -874,25 +874,25 @@ inline hEntity hRequest::entity(int i) inline hParam hRequest::param(int i) { hParam r; r.v = (v << 16) | (uint32_t)i; return r; } -inline bool hEntity::isFromRequest(void) +inline bool hEntity::isFromRequest() { if(v & 0x80000000) return false; else return true; } -inline hRequest hEntity::request(void) +inline hRequest hEntity::request() { hRequest r; r.v = (v >> 16); return r; } -inline hGroup hEntity::group(void) +inline hGroup hEntity::group() { hGroup r; r.v = (v >> 16) & 0x3fff; return r; } inline hEquation hEntity::equation(int i) { hEquation r; r.v = v | 0x40000000; return r; } -inline hRequest hParam::request(void) +inline hRequest hParam::request() { hRequest r; r.v = (v >> 16); return r; } inline hEquation hConstraint::equation(int i) { hEquation r; r.v = (v << 16) | (uint32_t)i; return r; } -inline bool hEquation::isFromConstraint(void) +inline bool hEquation::isFromConstraint() { if(v & 0xc0000000) return false; else return true; } -inline hConstraint hEquation::constraint(void) +inline hConstraint hEquation::constraint() { hConstraint r; r.v = (v >> 16); return r; } // The format for entities stored on the clipboard. diff --git a/src/solvespace.cpp b/src/solvespace.cpp index b845c894..e38b2791 100644 --- a/src/solvespace.cpp +++ b/src/solvespace.cpp @@ -146,7 +146,7 @@ bool SolveSpaceUI::OpenFile(const std::string &filename) { return success; } -void SolveSpaceUI::Exit(void) { +void SolveSpaceUI::Exit() { if(!OkayToStartNewFile()) return; @@ -242,20 +242,20 @@ void SolveSpaceUI::ScheduleShowTW() { later.showTW = true; } -void SolveSpaceUI::DoLater(void) { +void SolveSpaceUI::DoLater() { if(later.generateAll) GenerateAll(); if(later.showTW) TW.Show(); later = {}; } -double SolveSpaceUI::MmPerUnit(void) { +double SolveSpaceUI::MmPerUnit() { if(viewUnits == UNIT_INCHES) { return 25.4; } else { return 1.0; } } -const char *SolveSpaceUI::UnitName(void) { +const char *SolveSpaceUI::UnitName() { if(viewUnits == UNIT_INCHES) { return "inch"; } else { @@ -275,18 +275,18 @@ double SolveSpaceUI::ExprToMm(Expr *e) { double SolveSpaceUI::StringToMm(const std::string &str) { return std::stod(str) * MmPerUnit(); } -double SolveSpaceUI::ChordTolMm(void) { +double SolveSpaceUI::ChordTolMm() { if(exportMode) return ExportChordTolMm(); return chordTolCalculated; } -double SolveSpaceUI::ExportChordTolMm(void) { +double SolveSpaceUI::ExportChordTolMm() { return exportChordTol / exportScale; } -int SolveSpaceUI::GetMaxSegments(void) { +int SolveSpaceUI::GetMaxSegments() { if(exportMode) return exportMaxSegments; return maxSegments; } -int SolveSpaceUI::UnitDigitsAfterDecimal(void) { +int SolveSpaceUI::UnitDigitsAfterDecimal() { return (viewUnits == UNIT_INCHES) ? afterDecimalInch : afterDecimalMm; } void SolveSpaceUI::SetUnitDigitsAfterDecimal(int v) { @@ -297,7 +297,7 @@ void SolveSpaceUI::SetUnitDigitsAfterDecimal(int v) { } } -double SolveSpaceUI::CameraTangent(void) { +double SolveSpaceUI::CameraTangent() { if(!usePerspectiveProj) { return 0; } else { @@ -305,7 +305,7 @@ double SolveSpaceUI::CameraTangent(void) { } } -void SolveSpaceUI::AfterNewFile(void) { +void SolveSpaceUI::AfterNewFile() { // Clear out the traced point, which is no longer valid traced.point = Entity::NO_ENTITY; traced.path.l.Clear(); @@ -413,7 +413,7 @@ void SolveSpaceUI::RemoveAutosave() ssremove(autosaveFile); } -bool SolveSpaceUI::OkayToStartNewFile(void) { +bool SolveSpaceUI::OkayToStartNewFile() { if(!unsaved) return true; switch(SaveFileYesNoCancel()) { @@ -430,7 +430,7 @@ bool SolveSpaceUI::OkayToStartNewFile(void) { } } -void SolveSpaceUI::UpdateWindowTitle(void) { +void SolveSpaceUI::UpdateWindowTitle() { SetCurrentFilename(saveFile); } @@ -827,7 +827,7 @@ void SolveSpaceUI::MenuHelp(int id) { } } -void SolveSpaceUI::Clear(void) { +void SolveSpaceUI::Clear() { sys.Clear(); for(int i = 0; i < MAX_UNDO; i++) { if(i < undo.cnt) undo.d[i].Clear(); @@ -835,7 +835,7 @@ void SolveSpaceUI::Clear(void) { } } -void Sketch::Clear(void) { +void Sketch::Clear() { group.Clear(); groupOrder.Clear(); constraint.Clear(); diff --git a/src/solvespace.h b/src/solvespace.h index cd778214..de687ea4 100644 --- a/src/solvespace.h +++ b/src/solvespace.h @@ -157,11 +157,11 @@ void ssremove(const std::string &filename); #define RECENT_OPEN (0xf000) #define RECENT_LINK (0xf100) extern std::string RecentFile[MAX_RECENT]; -void RefreshRecentMenus(void); +void RefreshRecentMenus(); enum DialogChoice { DIALOG_YES = 1, DIALOG_NO = -1, DIALOG_CANCEL = 0 }; -DialogChoice SaveFileYesNoCancel(void); -DialogChoice LoadAutosaveYesNo(void); +DialogChoice SaveFileYesNoCancel(); +DialogChoice LoadAutosaveYesNo(); DialogChoice LocateImportedFileYesNoCancel(const std::string &filename, bool canCancel); @@ -237,30 +237,30 @@ void EnableMenuById(int id, bool enabled); void ShowGraphicsEditControl(int x, int y, int fontHeight, int minWidthChars, const std::string &str); -void HideGraphicsEditControl(void); -bool GraphicsEditControlIsVisible(void); +void HideGraphicsEditControl(); +bool GraphicsEditControlIsVisible(); void ShowTextEditControl(int x, int y, const std::string &str); -void HideTextEditControl(void); -bool TextEditControlIsVisible(void); +void HideTextEditControl(); +bool TextEditControlIsVisible(); void MoveTextScrollbarTo(int pos, int maxPos, int page); #define CONTEXT_SUBMENU (-1) #define CONTEXT_SEPARATOR (-2) void AddContextMenuItem(const char *legend, int id); -void CreateContextSubmenu(void); -int ShowContextMenu(void); +void CreateContextSubmenu(); +int ShowContextMenu(); -void ToggleMenuBar(void); -bool MenuBarIsVisible(void); +void ToggleMenuBar(); +bool MenuBarIsVisible(); void ShowTextWindow(bool visible); -void InvalidateText(void); -void InvalidateGraphics(void); -void PaintGraphics(void); -void ToggleFullScreen(void); -bool FullScreenIsActive(void); +void InvalidateText(); +void InvalidateGraphics(); +void PaintGraphics(); +void ToggleFullScreen(); +bool FullScreenIsActive(); void GetGraphicsWindowSize(int *w, int *h); void GetTextWindowSize(int *w, int *h); -int64_t GetMilliseconds(void); +int64_t GetMilliseconds(); void dbp(const char *str, ...); #define DBPTRI(tri) \ @@ -273,7 +273,7 @@ void DoMessageBox(const char *str, int rows, int cols, bool error); void SetTimerFor(int milliseconds); void SetAutosaveTimerFor(int minutes); void ScheduleLater(); -void ExitNow(void); +void ExitNow(); void CnfFreezeInt(uint32_t val, const std::string &name); void CnfFreezeFloat(float val, const std::string &name); @@ -284,11 +284,11 @@ float CnfThawFloat(float val, const std::string &name); void *AllocTemporary(size_t n); void FreeTemporary(void *p); -void FreeAllTemporary(void); +void FreeAllTemporary(); void *MemAlloc(size_t n); void MemFree(void *p); -void InitHeaps(void); -void vl(void); // debug function to validate heaps +void InitHeaps(); +void vl(); // debug function to validate heaps #include "resource.h" @@ -342,7 +342,7 @@ void ssglAxisAlignedLineLoop(double l, double r, double t, double b); #else # define SSGL_CALLBACK #endif -extern "C" { typedef void SSGL_CALLBACK ssglCallbackFptr(void); } +extern "C" { typedef void SSGL_CALLBACK ssglCallbackFptr(); } void ssglTesselatePolygon(GLUtesselator *gt, SPolygon *p); void ssglFillPolygon(SPolygon *p); void ssglFillMesh(bool useSpecColor, RgbaColor color, @@ -366,7 +366,7 @@ void ssglStippledLine(Vector a, Vector b, double width, void ssglStippledLine(Vector a, Vector b, double width, const char *stipplePattern, double stippleScale, bool maybeFat); void ssglFatLine(Vector a, Vector b, double width); -void ssglUnlockColor(void); +void ssglUnlockColor(); void ssglColorRGB(RgbaColor rgb); void ssglColorRGBa(RgbaColor rgb, double a); void ssglDepthRangeOffset(int units); @@ -449,18 +449,18 @@ public: } mat; static const double RANK_MAG_TOLERANCE, CONVERGE_TOLERANCE; - int CalculateRank(void); - bool TestRank(void); + int CalculateRank(); + bool TestRank(); static bool SolveLinearSystem(double X[], double A[][MAX_UNKNOWNS], double B[], int N); - bool SolveLeastSquares(void); + bool SolveLeastSquares(); bool WriteJacobian(int tag); - void EvalJacobian(void); + void EvalJacobian(); void WriteEquationsExceptFor(hConstraint hc, Group *g); void FindWhichToRemoveToFixJacobian(Group *g, List *bad); - void SolveBySubstitution(void); + void SolveBySubstitution(); bool IsDragged(hParam p); @@ -476,7 +476,7 @@ public: int Solve(Group *g, int *dof, List *bad, bool andFindBad, bool andFindFree); - void Clear(void); + void Clear(); }; #include "ttf.h" @@ -484,13 +484,13 @@ public: class StepFileWriter { public: void ExportSurfacesTo(const std::string &filename); - void WriteHeader(void); - void WriteProductHeader(void); + void WriteHeader(); + void WriteProductHeader(); int ExportCurve(SBezier *sb); int ExportCurveLoop(SBezierLoop *loop, bool inner); void ExportSurface(SSurface *ss, SBezierList *sbl); - void WriteWireframe(void); - void WriteFooter(void); + void WriteWireframe(); + void WriteFooter(); List curves; List advancedFaces; @@ -678,7 +678,7 @@ public: inline Group *GetGroup (hGroup h) { return group. FindById(h); } // Styles are handled a bit differently. - void Clear(void); + void Clear(); BBox CalculateEntityBBox(bool includingInvisible); Group *GetRunningMeshGroupFor(hGroup h); @@ -702,7 +702,7 @@ public: IdList style; hGroup activeGroup; - void Clear(void) { + void Clear() { group.Clear(); request.Clear(); constraint.Clear(); @@ -718,10 +718,10 @@ public: } UndoStack; UndoStack undo; UndoStack redo; - void UndoEnableMenus(void); - void UndoRemember(void); - void UndoUndo(void); - void UndoRedo(void); + void UndoEnableMenus(); + void UndoRemember(); + void UndoUndo(); + void UndoRedo(); void PushFromCurrentOnto(UndoStack *uk); void PopOntoCurrentFrom(UndoStack *uk); void UndoClearState(UndoState *ut); @@ -782,15 +782,15 @@ public: std::string MmToString(double v); double ExprToMm(Expr *e); double StringToMm(const std::string &s); - const char *UnitName(void); - double MmPerUnit(void); - int UnitDigitsAfterDecimal(void); + const char *UnitName(); + double MmPerUnit(); + int UnitDigitsAfterDecimal(); void SetUnitDigitsAfterDecimal(int v); - double ChordTolMm(void); - double ExportChordTolMm(void); - int GetMaxSegments(void); + double ChordTolMm(); + double ExportChordTolMm(); + int GetMaxSegments(); bool usePerspectiveProj; - double CameraTangent(void); + double CameraTangent(); // Some stuff relating to the tangent arcs created non-parametrically // as special requests. @@ -799,14 +799,14 @@ public: bool tangentArcDeleteOld; // The platform-dependent code calls this before entering the msg loop - void Init(void); + void Init(); bool OpenFile(const std::string &filename); - void Exit(void); + void Exit(); // File load/save routines, including the additional files that get // loaded when we have link groups. FILE *fh; - void AfterNewFile(void); + void AfterNewFile(); static void RemoveFromRecentList(const std::string &filename); static void AddToRecentList(const std::string &filename); std::string saveFile; @@ -833,11 +833,11 @@ public: bool Autosave(); void RemoveAutosave(); bool GetFilenameAndSave(bool saveAs); - bool OkayToStartNewFile(void); - hGroup CreateDefaultDrawingGroup(void); - void UpdateWindowTitle(void); - void ClearExisting(void); - void NewFile(void); + bool OkayToStartNewFile(); + hGroup CreateDefaultDrawingGroup(); + void UpdateWindowTitle(); + void ClearExisting(); + void NewFile(); bool SaveToFile(const std::string &filename); bool LoadAutosaveFor(const std::string &filename); bool LoadFromFile(const std::string &filename); @@ -890,7 +890,7 @@ public: List r; List c; - void Clear(void); + void Clear(); bool ContainsEntity(hEntity old); hEntity NewEntityFor(hEntity old); }; @@ -908,7 +908,7 @@ public: int nonTrivialConstraints; } deleted; bool GroupExists(hGroup hg); - bool PruneOrphans(void); + bool PruneOrphans(); bool EntityExists(hEntity he); bool GroupsInOrder(hGroup before, hGroup after); bool PruneGroups(hGroup hg); @@ -925,10 +925,10 @@ public: void GenerateAll(GenerateType type = GENERATE_DIRTY, bool andFindFree = false, bool genForBBox = false); void SolveGroup(hGroup hg, bool andFindFree); - void MarkDraggedParams(void); - void ForceReferences(void); + void MarkDraggedParams(); + void ForceReferences(); - bool ActiveGroupsOkay(void); + bool ActiveGroupsOkay(); // The system to be solved. System *pSys; @@ -949,11 +949,11 @@ public: } later; void ScheduleShowTW(); void ScheduleGenerateAll(); - void DoLater(void); + void DoLater(); static void MenuHelp(int id); - void Clear(void); + void Clear(); // We allocate TW and sys on the heap to work around an MSVC problem // where it puts zero-initialized global data in the binary (~30M of zeroes) diff --git a/src/srf/boolean.cpp b/src/srf/boolean.cpp index 54aee882..5cc81527 100644 --- a/src/srf/boolean.cpp +++ b/src/srf/boolean.cpp @@ -627,7 +627,7 @@ void SShell::MakeIntersectionCurvesAgainst(SShell *agnst, SShell *into) { } } -void SShell::CleanupAfterBoolean(void) { +void SShell::CleanupAfterBoolean() { SSurface *ss; for(ss = surface.First(); ss; ss = surface.NextAfter(ss)) { ss->edges.Clear(); @@ -769,7 +769,7 @@ void SSurface::MakeClassifyingBsp(SShell *shell, SShell *useCurvesFrom) { MakeEdgesInto(shell, &edges, AS_XYZ, useCurvesFrom); } -SBspUv *SBspUv::Alloc(void) { +SBspUv *SBspUv::Alloc() { return (SBspUv *)AllocTemporary(sizeof(SBspUv)); } diff --git a/src/srf/curve.cpp b/src/srf/curve.cpp index 4adede39..ae38c197 100644 --- a/src/srf/curve.cpp +++ b/src/srf/curve.cpp @@ -60,15 +60,15 @@ SBezier SBezier::From(Vector p0, Vector p1, Vector p2, Vector p3) { p3.Project4d()); } -Vector SBezier::Start(void) { +Vector SBezier::Start() { return ctrl[0]; } -Vector SBezier::Finish(void) { +Vector SBezier::Finish() { return ctrl[deg]; } -void SBezier::Reverse(void) { +void SBezier::Reverse() { int i; for(i = 0; i < (deg+1)/2; i++) { swap(ctrl[i], ctrl[deg-i]); @@ -170,7 +170,7 @@ bool SBezier::IsCircle(Vector axis, Vector *center, double *r) { return true; } -bool SBezier::IsRational(void) { +bool SBezier::IsRational() { int i; for(i = 0; i <= deg; i++) { if(fabs(weight[i] - 1) > LENGTH_EPS) return true; @@ -218,7 +218,7 @@ bool SBezier::Equals(SBezier *b) { return true; } -void SBezierList::Clear(void) { +void SBezierList::Clear() { l.Clear(); } @@ -233,7 +233,7 @@ void SBezierList::ScaleSelfBy(double s) { // If our list contains multiple identical Beziers (in either forward or // reverse order), then cull them. //----------------------------------------------------------------------------- -void SBezierList::CullIdenticalBeziers(void) { +void SBezierList::CullIdenticalBeziers() { int i, j; l.ClearTags(); @@ -443,7 +443,7 @@ SBezierLoop SBezierLoop::FromCurves(SBezierList *sbl, return loop; } -void SBezierLoop::Reverse(void) { +void SBezierLoop::Reverse() { l.Reverse(); SBezier *sb; for(sb = l.First(); sb; sb = l.NextAfter(sb)) { @@ -478,7 +478,7 @@ void SBezierLoop::MakePwlInto(SContour *sc, double chordTol) { } } -bool SBezierLoop::IsClosed(void) { +bool SBezierLoop::IsClosed() { if(l.n < 1) return false; Vector s = l.elem[0].Start(), f = l.elem[l.n-1].Finish(); @@ -553,7 +553,7 @@ void SBezierLoopSet::MakePwlInto(SPolygon *sp) { } } -void SBezierLoopSet::Clear(void) { +void SBezierLoopSet::Clear() { int i; for(i = 0; i < l.n; i++) { (l.elem[i]).Clear(); @@ -724,7 +724,7 @@ void SBezierLoopSetSet::AddOpenPath(SBezier *sb) { l.Add(&sbls); } -void SBezierLoopSetSet::Clear(void) { +void SBezierLoopSetSet::Clear() { SBezierLoopSet *sbls; for(sbls = l.First(); sbls; sbls = l.NextAfter(sbls)) { sbls->Clear(); @@ -753,7 +753,7 @@ SCurve SCurve::FromTransformationOf(SCurve *a, return ret; } -void SCurve::Clear(void) { +void SCurve::Clear() { pts.Clear(); } diff --git a/src/srf/merge.cpp b/src/srf/merge.cpp index 487fb92c..29d1965d 100644 --- a/src/srf/merge.cpp +++ b/src/srf/merge.cpp @@ -6,7 +6,7 @@ //----------------------------------------------------------------------------- #include "../solvespace.h" -void SShell::MergeCoincidentSurfaces(void) { +void SShell::MergeCoincidentSurfaces() { surface.ClearTags(); int i, j; diff --git a/src/srf/raycast.cpp b/src/srf/raycast.cpp index 7dbca01f..17d7742f 100644 --- a/src/srf/raycast.cpp +++ b/src/srf/raycast.cpp @@ -16,7 +16,7 @@ const double SShell::DOTP_TOL = 1e-5; extern int FLAG; -double SSurface::DepartureFromCoplanar(void) { +double SSurface::DepartureFromCoplanar() { int i, j; int ia, ja, ib = 0, jb = 0, ic = 0, jc = 0; double best; @@ -73,7 +73,7 @@ double SSurface::DepartureFromCoplanar(void) { return farthest; } -void SSurface::WeightControlPoints(void) { +void SSurface::WeightControlPoints() { int i, j; for(i = 0; i <= degm; i++) { for(j = 0; j <= degn; j++) { @@ -81,7 +81,7 @@ void SSurface::WeightControlPoints(void) { } } } -void SSurface::UnWeightControlPoints(void) { +void SSurface::UnWeightControlPoints() { int i, j; for(i = 0; i <= degm; i++) { for(j = 0; j <= degn; j++) { diff --git a/src/srf/surface.cpp b/src/srf/surface.cpp index 9b36cb90..e1d1c4dc 100644 --- a/src/srf/surface.cpp +++ b/src/srf/surface.cpp @@ -449,7 +449,7 @@ void SSurface::TriangulateInto(SShell *shell, SMesh *sm) { // normal. We therefore must reverse all our trim curves too. The uv // coordinates change, but trim curves are stored as xyz so nothing happens //----------------------------------------------------------------------------- -void SSurface::Reverse(void) { +void SSurface::Reverse() { int i, j; for(i = 0; i < (degm+1)/2; i++) { for(j = 0; j <= degn; j++) { @@ -474,7 +474,7 @@ void SSurface::ScaleSelfBy(double s) { } } -void SSurface::Clear(void) { +void SSurface::Clear() { trim.Clear(); } @@ -860,11 +860,11 @@ void SShell::TriangulateInto(SMesh *sm) { } } -bool SShell::IsEmpty(void) { +bool SShell::IsEmpty() { return (surface.n == 0); } -void SShell::Clear(void) { +void SShell::Clear() { SSurface *s; for(s = surface.First(); s; s = surface.NextAfter(s)) { s->Clear(); diff --git a/src/srf/surface.h b/src/srf/surface.h index 86d69db3..22a226b6 100644 --- a/src/srf/surface.h +++ b/src/srf/surface.h @@ -36,7 +36,7 @@ public: EDGE_OTHER = 500 }; - static SBspUv *Alloc(void); + static SBspUv *Alloc(); static SBspUv *From(SEdgeList *el, SSurface *srf); void ScalePoints(Point2d *pt, Point2d *a, Point2d *b, SSurface *srf); @@ -86,8 +86,8 @@ public: void SplitAt(double t, SBezier *bef, SBezier *aft); bool PointOnThisAndCurve(SBezier *sbb, Vector *p); - Vector Start(void); - Vector Finish(void); + Vector Start(); + Vector Finish(); bool Equals(SBezier *b); void MakePwlInto(SEdgeList *sel, double chordTol=0); void MakePwlInto(List *l, double chordTol=0); @@ -98,11 +98,11 @@ public: void AllIntersectionsWith(SBezier *sbb, SPointList *spl); void GetBoundingProjd(Vector u, Vector orig, double *umin, double *umax); - void Reverse(void); + void Reverse(); bool IsInPlane(Vector n, double d); bool IsCircle(Vector axis, Vector *center, double *r); - bool IsRational(void); + bool IsRational(); SBezier TransformedBy(Vector t, Quaternion q, double scale); SBezier InPerspective(Vector u, Vector v, Vector n, @@ -121,9 +121,9 @@ class SBezierList { public: List l; - void Clear(void); + void Clear(); void ScaleSelfBy(double s); - void CullIdenticalBeziers(void); + void CullIdenticalBeziers(); void AllIntersectionsWith(SBezierList *sblb, SPointList *spl); bool GetPlaneContainingBeziers(Vector *p, Vector *u, Vector *v, Vector *notCoplanarAt); @@ -134,9 +134,9 @@ public: int tag; List l; - inline void Clear(void) { l.Clear(); } - bool IsClosed(void); - void Reverse(void); + inline void Clear() { l.Clear(); } + bool IsClosed(); + void Reverse(); void MakePwlInto(SContour *sc, double chordTol=0); void GetBoundingProjd(Vector u, Vector orig, double *umin, double *umax); @@ -157,7 +157,7 @@ public: void GetBoundingProjd(Vector u, Vector orig, double *umin, double *umax); void MakePwlInto(SPolygon *sp); - void Clear(void); + void Clear(); }; class SBezierLoopSetSet { @@ -170,7 +170,7 @@ public: bool *allCoplanar, Vector *notCoplanarAt, SBezierList *openContours); void AddOpenPath(SBezier *sb); - void Clear(void); + void Clear(); }; // Stuff for the surface trim curves: piecewise linear @@ -212,7 +212,7 @@ public: SSurface *GetSurfaceA(SShell *a, SShell *b); SSurface *GetSurfaceB(SShell *a, SShell *b); - void Clear(void); + void Clear(); }; // A segment of a curve by which a surface is trimmed: indicates which curve, @@ -297,12 +297,12 @@ public: int tag; Point2d p; } Inter; - void WeightControlPoints(void); - void UnWeightControlPoints(void); + void WeightControlPoints(); + void UnWeightControlPoints(); void CopyRowOrCol(bool row, int this_ij, SSurface *src, int src_ij); void BlendRowOrCol(bool row, int this_ij, SSurface *a, int a_ij, SSurface *b, int b_ij); - double DepartureFromCoplanar(void); + double DepartureFromCoplanar(); void SplitInHalf(bool byU, SSurface *sa, SSurface *sb); void AllPointsIntersecting(Vector a, Vector b, List *l, @@ -352,8 +352,8 @@ public: bool swapped); Vector PointAtMaybeSwapped(double u, double v, bool swapped); - void Reverse(void); - void Clear(void); + void Reverse(); + void Clear(); }; class SShell { @@ -386,7 +386,7 @@ public: void MakeCoincidentEdgesInto(SSurface *proto, bool sameNormal, SEdgeList *el, SShell *useCurvesFrom); void RewriteSurfaceHandlesForCurves(SShell *a, SShell *b); - void CleanupAfterBoolean(void); + void CleanupAfterBoolean(); // Definitions when classifying regions of a surface; it is either inside, // outside, or coincident (with parallel or antiparallel normal) with a @@ -408,15 +408,15 @@ public: void MakeFromTransformationOf(SShell *a, Vector trans, Quaternion q, double scale); void MakeFromAssemblyOf(SShell *a, SShell *b); - void MergeCoincidentSurfaces(void); + void MergeCoincidentSurfaces(); void TriangulateInto(SMesh *sm); void MakeEdgesInto(SEdgeList *sel); void MakeSectionEdgesInto(Vector n, double d, SEdgeList *sel, SBezierList *sbl); - bool IsEmpty(void); + bool IsEmpty(); void RemapFaces(Group *g, int remap); - void Clear(void); + void Clear(); }; #endif diff --git a/src/style.cpp b/src/style.cpp index 20008ece..c9f3ea08 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -51,7 +51,7 @@ std::string Style::CnfPrefixToName(const std::string &prefix) { return name; } -void Style::CreateAllDefaultStyles(void) { +void Style::CreateAllDefaultStyles() { const Default *d; for(d = &(Defaults[0]); d->h.v; d++) { (void)Get(d->h); @@ -102,7 +102,7 @@ void Style::FillDefaultStyle(Style *s, const Default *d) { s->zIndex = d->zIndex; } -void Style::LoadFactoryDefaults(void) { +void Style::LoadFactoryDefaults() { const Default *d; for(d = &(Defaults[0]); d->h.v; d++) { Style *s = Get(d->h); @@ -113,7 +113,7 @@ void Style::LoadFactoryDefaults(void) { SS.bgImage.fromFile = NULL; } -void Style::FreezeDefaultStyles(void) { +void Style::FreezeDefaultStyles() { const Default *d; for(d = &(Defaults[0]); d->h.v; d++) { CnfFreezeColor(Color(d->h), CnfColor(d->cnfPrefix)); @@ -337,7 +337,7 @@ double Style::StippleScaleMm(hStyle hs) { return 1.0; } -std::string Style::DescriptionString(void) { +std::string Style::DescriptionString() { if(name.empty()) { return ssprintf("s%03x-(unnamed)", h.v); } else { @@ -447,7 +447,7 @@ void TextWindow::ScreenChangeBackgroundImageScale(int link, uint32_t v) { SS.TW.ShowEditControl(10, ssprintf("%.3f", SS.bgImage.scale * SS.MmPerUnit())); } -void TextWindow::ShowListOfStyles(void) { +void TextWindow::ShowListOfStyles() { Printf(true, "%Ft color style-name"); bool darkbg = false; @@ -755,7 +755,7 @@ bool TextWindow::EditControlDoneForStyles(const char *str) { return true; } -void TextWindow::ShowStyleInfo(void) { +void TextWindow::ShowStyleInfo() { Printf(true, "%Fl%f%Ll(back to list of styles)%E", &ScreenShowListOfStyles); Style *s = Style::Get(shown.style); diff --git a/src/system.cpp b/src/system.cpp index 5ff118ef..edd5b717 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -67,7 +67,7 @@ bool System::WriteJacobian(int tag) { return true; } -void System::EvalJacobian(void) { +void System::EvalJacobian() { int i, j; for(i = 0; i < mat.m; i++) { for(j = 0; j < mat.n; j++) { @@ -84,7 +84,7 @@ bool System::IsDragged(hParam p) { return false; } -void System::SolveBySubstitution(void) { +void System::SolveBySubstitution() { int i; for(i = 0; i < eq.n; i++) { Equation *teq = &(eq.elem[i]); @@ -135,7 +135,7 @@ void System::SolveBySubstitution(void) { // in place. A row (~equation) is considered to be all zeros if its magnitude // is less than the tolerance RANK_MAG_TOLERANCE. //----------------------------------------------------------------------------- -int System::CalculateRank(void) { +int System::CalculateRank() { // Actually work with magnitudes squared, not the magnitudes double rowMag[MAX_UNKNOWNS] = {}; double tol = RANK_MAG_TOLERANCE*RANK_MAG_TOLERANCE; @@ -172,7 +172,7 @@ int System::CalculateRank(void) { return rank; } -bool System::TestRank(void) { +bool System::TestRank() { EvalJacobian(); return CalculateRank() == mat.m; } @@ -233,7 +233,7 @@ bool System::SolveLinearSystem(double X[], double A[][MAX_UNKNOWNS], return true; } -bool System::SolveLeastSquares(void) { +bool System::SolveLeastSquares() { int r, c, i; // Scale the columns; this scale weights the parameters for the least @@ -532,7 +532,7 @@ didnt_converge: return rankOk ? System::DIDNT_CONVERGE : System::REDUNDANT_DIDNT_CONVERGE; } -void System::Clear(void) { +void System::Clear() { entity.Clear(); param.Clear(); eq.Clear(); diff --git a/src/textscreens.cpp b/src/textscreens.cpp index 0f37fa8f..286d8e73 100644 --- a/src/textscreens.cpp +++ b/src/textscreens.cpp @@ -89,7 +89,7 @@ void TextWindow::ScreenShowEditView(int link, uint32_t v) { void TextWindow::ScreenGoToWebsite(int link, uint32_t v) { OpenWebsite("http://solvespace.com/txtlink"); } -void TextWindow::ShowListOfGroups(void) { +void TextWindow::ShowListOfGroups() { const char *radioTrue = " " RADIO_TRUE " ", *radioFalse = " " RADIO_FALSE " ", *checkTrue = " " CHECK_TRUE " ", @@ -275,7 +275,7 @@ void TextWindow::ScreenDeleteGroup(int link, uint32_t v) { // group if it was removed. SS.GW.ClearSuper(); } -void TextWindow::ShowGroupInfo(void) { +void TextWindow::ShowGroupInfo() { Group *g = SK.GetGroup(shown.group); const char *s = "???"; @@ -474,7 +474,7 @@ void TextWindow::ScreenAllowRedundant(int link, uint32_t v) { SS.TW.shown.screen = SCREEN_GROUP_INFO; SS.TW.Show(); } -void TextWindow::ShowGroupSolveInfo(void) { +void TextWindow::ShowGroupSolveInfo() { Group *g = SK.GetGroup(shown.group); if(g->IsSolvedOkay()) { // Go back to the default group info screen @@ -569,7 +569,7 @@ void TextWindow::ScreenStepDimGo(int link, uint32_t v) { InvalidateGraphics(); SS.TW.GoToScreen(SCREEN_LIST_OF_GROUPS); } -void TextWindow::ShowStepDimension(void) { +void TextWindow::ShowStepDimension() { Constraint *c = SK.constraint.FindByIdNoOops(shown.constraint); if(!c) { shown.screen = SCREEN_LIST_OF_GROUPS; @@ -613,7 +613,7 @@ void TextWindow::ScreenChangeTangentArc(int link, uint32_t v) { case 'd': SS.tangentArcDeleteOld = !SS.tangentArcDeleteOld; break; } } -void TextWindow::ShowTangentArc(void) { +void TextWindow::ShowTangentArc() { Printf(true, "%FtTANGENT ARC PARAMETERS%E"); Printf(true, "%Ft radius of created arc%E"); diff --git a/src/textwin.cpp b/src/textwin.cpp index 9f26594a..1676a8a4 100644 --- a/src/textwin.cpp +++ b/src/textwin.cpp @@ -55,11 +55,11 @@ void TextWindow::MakeColorTable(const Color *in, float *out) { } } -void TextWindow::Init(void) { +void TextWindow::Init() { ClearSuper(); } -void TextWindow::ClearSuper(void) { +void TextWindow::ClearSuper() { HideEditControl(); // Cannot use *this = {} here because TextWindow instances @@ -74,7 +74,7 @@ void TextWindow::ClearSuper(void) { Show(); } -void TextWindow::HideEditControl(void) { +void TextWindow::HideEditControl() { editControl.colorPicker.show = false; HideTextEditControl(); } @@ -102,7 +102,7 @@ void TextWindow::ShowEditControlWithColorPicker(int col, RgbaColor rgb) ShowEditControl(col, ssprintf("%.2f, %.2f, %.2f", rgb.redF(), rgb.greenF(), rgb.blueF())); } -void TextWindow::ClearScreen(void) { +void TextWindow::ClearScreen() { int i, j; for(i = 0; i < MAX_ROWS; i++) { for(j = 0; j < MAX_COLS; j++) { @@ -282,7 +282,7 @@ done: } #define gs (SS.GW.gs) -void TextWindow::Show(void) { +void TextWindow::Show() { if(!(SS.GW.pending.operation)) SS.GW.ClearPending(); SS.GW.GroupSelection(); @@ -338,7 +338,7 @@ void TextWindow::Show(void) { InvalidateText(); } -void TextWindow::TimerCallback(void) +void TextWindow::TimerCallback() { tooltippedIcon = hoveredIcon; InvalidateText(); @@ -506,7 +506,7 @@ Vector TextWindow::HsvToRgb(Vector hsv) { return rgb; } -uint8_t *TextWindow::HsvPattern2d(void) { +uint8_t *TextWindow::HsvPattern2d() { static uint8_t Texture[256*256*3]; static bool Init; @@ -546,7 +546,7 @@ uint8_t *TextWindow::HsvPattern1d(double h, double s) { return Texture; } -void TextWindow::ColorPickerDone(void) { +void TextWindow::ColorPickerDone() { RgbaColor rgb = editControl.colorPicker.rgb; EditControlDone(ssprintf("%.2f, %.2f, %.3f", rgb.redF(), rgb.greenF(), rgb.blueF()).c_str()); } @@ -795,7 +795,7 @@ bool TextWindow::DrawOrHitTestColorPicker(int how, bool leftDown, return true; } -void TextWindow::Paint(void) { +void TextWindow::Paint() { int width, height; GetTextWindowSize(&width, &height); @@ -1028,7 +1028,7 @@ done: } } -void TextWindow::MouseLeave(void) { +void TextWindow::MouseLeave() { tooltippedIcon = NULL; hoveredIcon = NULL; hoveredRow = 0; diff --git a/src/toolbar.cpp b/src/toolbar.cpp index 1594e798..872f5f5a 100644 --- a/src/toolbar.cpp +++ b/src/toolbar.cpp @@ -54,7 +54,7 @@ static struct { { NULL, 0, 0, {} } }; -void GraphicsWindow::ToolbarDraw(void) { +void GraphicsWindow::ToolbarDraw() { ToolbarDrawOrHitTest(0, 0, true, NULL); } @@ -249,7 +249,7 @@ bool GraphicsWindow::ToolbarDrawOrHitTest(int mx, int my, return withinToolbar; } -void GraphicsWindow::TimerCallback(void) { +void GraphicsWindow::TimerCallback() { SS.GW.toolbarTooltipped = SS.GW.toolbarHovered; PaintGraphics(); } diff --git a/src/ui.h b/src/ui.h index 873b93bb..8724f0e3 100644 --- a/src/ui.h +++ b/src/ui.h @@ -70,10 +70,10 @@ public: static bool SPACER; // These are called by the platform-specific code. - void Paint(void); + void Paint(); void MouseEvent(bool isClick, bool leftDown, double x, double y); void MouseScroll(double x, double y, int delta); - void MouseLeave(void); + void MouseLeave(); void ScrollbarEvent(int newPos); enum { @@ -82,22 +82,22 @@ public: CLICK = 2 }; void DrawOrHitTestIcons(int how, double mx, double my); - void TimerCallback(void); + void TimerCallback(); Point2d oldMousePos; HideShowIcon *hoveredIcon, *tooltippedIcon; Vector HsvToRgb(Vector hsv); - uint8_t *HsvPattern2d(void); + uint8_t *HsvPattern2d(); uint8_t *HsvPattern1d(double h, double s); - void ColorPickerDone(void); + void ColorPickerDone(); bool DrawOrHitTestColorPicker(int how, bool leftDown, double x, double y); - void Init(void); + void Init(); void MakeColorTable(const Color *in, float *out); void Printf(bool half, const char *fmt, ...); - void ClearScreen(void); + void ClearScreen(); - void Show(void); + void Show(); // State for the screen that we are showing in the text window. enum { @@ -209,27 +209,27 @@ public: } colorPicker; } editControl; - void HideEditControl(void); + void HideEditControl(); void ShowEditControl(int col, const std::string &str, int halfRow = -1); void ShowEditControlWithColorPicker(int col, RgbaColor rgb); - void ClearSuper(void); + void ClearSuper(); void ShowHeader(bool withNav); // These are self-contained screens, that show some information about // the sketch. - void ShowListOfGroups(void); - void ShowGroupInfo(void); - void ShowGroupSolveInfo(void); - void ShowConfiguration(void); - void ShowListOfStyles(void); - void ShowStyleInfo(void); - void ShowStepDimension(void); - void ShowPasteTransformed(void); - void ShowEditView(void); - void ShowTangentArc(void); + void ShowListOfGroups(); + void ShowGroupInfo(); + void ShowGroupSolveInfo(); + void ShowConfiguration(); + void ShowListOfStyles(); + void ShowStyleInfo(); + void ShowStepDimension(); + void ShowPasteTransformed(); + void ShowEditView(); + void ShowTangentArc(); // Special screen, based on selection - void DescribeSelection(void); + void DescribeSelection(); void GoToScreen(int screen); @@ -333,7 +333,7 @@ public: class GraphicsWindow { public: - void Init(void); + void Init(); // This table describes the top-level menus in the graphics winodw. typedef enum { @@ -465,8 +465,8 @@ public: static void MenuView(int id); static void MenuEdit(int id); static void MenuRequest(int id); - void DeleteSelection(void); - void CopySelection(void); + void DeleteSelection(); + void CopySelection(); void PasteClipboard(Vector trans, double theta, double scale); static void MenuClipboard(int id); @@ -511,14 +511,14 @@ public: bool active; } context; - void NormalizeProjectionVectors(void); + void NormalizeProjectionVectors(); Point2d ProjectPoint(Vector p); Vector ProjectPoint3(Vector p); Vector ProjectPoint4(Vector p, double *w); Vector UnProjectPoint(Point2d p); Vector UnProjectPoint3(Vector p); void AnimateOnto(Quaternion quatf, Vector offsetf); - void AnimateOntoWorkplane(void); + void AnimateOntoWorkplane(); Vector VectorFromProjs(Vector rightUpForward); void HandlePointForZoomToFit(Vector p, Point2d *pmax, Point2d *pmin, double *wmin, bool usePerspective); @@ -527,11 +527,11 @@ public: void ZoomToFit(bool includingInvisibles, bool useSelection = false); hGroup activeGroup; - void EnsureValidActives(void); - bool LockedInWorkplane(void); - void SetWorkplaneFreeIn3d(void); - hEntity ActiveWorkplane(void); - void ForceTextWindowShown(void); + void EnsureValidActives(); + bool LockedInWorkplane(); + void SetWorkplaneFreeIn3d(); + hEntity ActiveWorkplane(); + void ForceTextWindowShown(); // Operations that must be completed by doing something with the mouse // are noted here. These occupy the same space as the menu ids. @@ -569,7 +569,7 @@ public: SuggestedConstraint suggestion; } pending; - void ClearPending(void); + void ClearPending(); // The constraint that is being edited with the on-screen textbox. hConstraint constraintBeingEdited; @@ -577,7 +577,7 @@ public: Vector SnapToGrid(Vector p); bool ConstrainPointByHovered(hEntity pt); - void DeleteTaggedRequests(void); + void DeleteTaggedRequests(); hRequest AddRequest(int type, bool rememberForUndo); hRequest AddRequest(int type); @@ -591,14 +591,14 @@ public: void MakeFromEntity(hEntity he, bool reverse); Vector PointAt(double t); Vector TangentAt(double t); - double LengthForAuto(void); + double LengthForAuto(); hRequest CreateRequestTrimmedTo(double t, bool extraConstraints, hEntity orig, hEntity arc, bool arcFinish); void ConstrainPointIfCoincident(hEntity hpt); }; - void MakeTangentArc(void); - void SplitLinesOrCurves(void); + void MakeTangentArc(); + void SplitLinesOrCurves(); hEntity SplitEntity(hEntity he, Vector pinter); hEntity SplitLine(hEntity he, Vector pinter); hEntity SplitCircle(hEntity he, Vector pinter); @@ -617,19 +617,19 @@ public: hConstraint constraint; bool emphasized; - void Draw(void); + void Draw(); - void Clear(void); - bool IsEmpty(void); + void Clear(); + bool IsEmpty(); bool Equals(Selection *b); - bool HasEndpoints(void); + bool HasEndpoints(); }; Selection hover; bool hoverWasSelectedOnMousedown; List selection; void HitTestMakeSelection(Point2d mp); - void ClearSelection(void); - void ClearNonexistentSelectionItems(void); + void ClearSelection(); + void ClearNonexistentSelectionItems(); enum { MAX_SELECTED = 32 }; struct { hEntity point[MAX_SELECTED]; @@ -655,15 +655,15 @@ public: int withEndpoints; int n; } gs; - void GroupSelection(void); + void GroupSelection(); bool IsSelected(Selection *s); bool IsSelected(hEntity he); void MakeSelected(hEntity he); void MakeSelected(Selection *s); void MakeUnselected(hEntity he, bool coincidentPointTrick); void MakeUnselected(Selection *s, bool coincidentPointTrick); - void SelectByMarquee(void); - void ClearSuper(void); + void SelectByMarquee(); + void ClearSuper(); enum { CMNU_UNSELECT_ALL = 0x100, @@ -686,15 +686,15 @@ public: CMNU_ADD_SPLINE_PT = 0x142, CMNU_FIRST_STYLE = 0x40000000 }; - void ContextMenuListStyles(void); + void ContextMenuListStyles(); int64_t contextMenuCancelTime; // The toolbar, in toolbar.cpp bool ToolbarDrawOrHitTest(int x, int y, bool paint, int *menuHit); - void ToolbarDraw(void); + void ToolbarDraw(); bool ToolbarMouseMoved(int x, int y); bool ToolbarMouseDown(int x, int y); - static void TimerCallback(void); + static void TimerCallback(); int toolbarHovered; int toolbarTooltipped; int toolbarMouseX, toolbarMouseY; @@ -717,12 +717,12 @@ public: void AddPointToDraggedList(hEntity hp); void StartDraggingByEntity(hEntity he); - void StartDraggingBySelection(void); + void StartDraggingBySelection(); void UpdateDraggedNum(Vector *pos, double mx, double my); void UpdateDraggedPoint(hEntity hp, double mx, double my); // These are called by the platform-specific code. - void Paint(void); + void Paint(); void MouseMoved(double x, double y, bool leftDown, bool middleDown, bool rightDown, bool shiftDown, bool ctrlDown); void MouseLeftDown(double x, double y); @@ -731,7 +731,7 @@ public: void MouseMiddleOrRightDown(double x, double y); void MouseRightUp(double x, double y); void MouseScroll(double x, double y, int delta); - void MouseLeave(void); + void MouseLeave(); bool KeyDown(int c); void EditControlDone(const char *s); @@ -739,7 +739,7 @@ public: hGroup lastSpaceNavigatorGroup; void SpaceNavigatorMoved(double tx, double ty, double tz, double rx, double ry, double rz, bool shiftDown); - void SpaceNavigatorButtonUp(void); + void SpaceNavigatorButtonUp(); }; diff --git a/src/undoredo.cpp b/src/undoredo.cpp index d21ca937..d4b39c30 100644 --- a/src/undoredo.cpp +++ b/src/undoredo.cpp @@ -7,14 +7,14 @@ //----------------------------------------------------------------------------- #include "solvespace.h" -void SolveSpaceUI::UndoRemember(void) { +void SolveSpaceUI::UndoRemember() { unsaved = true; PushFromCurrentOnto(&undo); UndoClearStack(&redo); UndoEnableMenus(); } -void SolveSpaceUI::UndoUndo(void) { +void SolveSpaceUI::UndoUndo() { if(undo.cnt <= 0) return; PushFromCurrentOnto(&redo); @@ -22,7 +22,7 @@ void SolveSpaceUI::UndoUndo(void) { UndoEnableMenus(); } -void SolveSpaceUI::UndoRedo(void) { +void SolveSpaceUI::UndoRedo() { if(redo.cnt <= 0) return; PushFromCurrentOnto(&undo); @@ -30,7 +30,7 @@ void SolveSpaceUI::UndoRedo(void) { UndoEnableMenus(); } -void SolveSpaceUI::UndoEnableMenus(void) { +void SolveSpaceUI::UndoEnableMenus() { EnableMenuById(GraphicsWindow::MNU_UNDO, undo.cnt > 0); EnableMenuById(GraphicsWindow::MNU_REDO, redo.cnt > 0); } diff --git a/src/util.cpp b/src/util.cpp index 65555701..659b4bba 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -178,7 +178,7 @@ RgbaColor SolveSpace::CnfThawColor(RgbaColor v, const std::string &name) // There also may be elements in the last two columns of any row. We solve // without pivoting. //----------------------------------------------------------------------------- -void BandedMatrix::Solve(void) { +void BandedMatrix::Solve() { int i, ip, j, jp; double temp; @@ -306,7 +306,7 @@ Quaternion Quaternion::ScaledBy(double s) { return q; } -double Quaternion::Magnitude(void) { +double Quaternion::Magnitude() { return sqrt(w*w + vx*vx + vy*vy + vz*vz); } @@ -314,7 +314,7 @@ Quaternion Quaternion::WithMagnitude(double s) { return ScaledBy(s/Magnitude()); } -Vector Quaternion::RotationU(void) { +Vector Quaternion::RotationU() { Vector v; v.x = w*w + vx*vx - vy*vy - vz*vz; v.y = 2*w *vz + 2*vx*vy; @@ -322,7 +322,7 @@ Vector Quaternion::RotationU(void) { return v; } -Vector Quaternion::RotationV(void) { +Vector Quaternion::RotationV() { Vector v; v.x = 2*vx*vy - 2*w*vz; v.y = w*w - vx*vx + vy*vy - vz*vz; @@ -330,7 +330,7 @@ Vector Quaternion::RotationV(void) { return v; } -Vector Quaternion::RotationN(void) { +Vector Quaternion::RotationN() { Vector v; v.x = 2*w*vy + 2*vx*vz; v.y = 2*vy*vz - 2*w*vx; @@ -345,7 +345,7 @@ Vector Quaternion::Rotate(Vector p) { RotationN().ScaledBy(p.z)); } -Quaternion Quaternion::Inverse(void) { +Quaternion Quaternion::Inverse() { Quaternion r; r.w = w; r.vx = -vx; @@ -390,7 +390,7 @@ Quaternion Quaternion::Times(Quaternion b) { return r; } -Quaternion Quaternion::Mirror(void) { +Quaternion Quaternion::Mirror() { Vector u = RotationU(), v = RotationV(); u = u.ScaledBy(-1); @@ -457,7 +457,7 @@ Vector Vector::Minus(Vector b) { return r; } -Vector Vector::Negated(void) { +Vector Vector::Negated() { Vector r; r.x = -x; @@ -614,11 +614,11 @@ Vector Vector::ClosestPointOnLine(Vector p0, Vector dp) { return this->Plus(n.WithMagnitude(d)); } -double Vector::MagSquared(void) { +double Vector::MagSquared() { return x*x + y*y + z*z; } -double Vector::Magnitude(void) { +double Vector::Magnitude() { return sqrt(x*x + y*y + z*z); } @@ -672,14 +672,14 @@ Point2d Vector::Project2d(Vector u, Vector v) { return p; } -Point2d Vector::ProjectXy(void) { +Point2d Vector::ProjectXy() { Point2d p; p.x = x; p.y = y; return p; } -Vector4 Vector::Project4d(void) { +Vector4 Vector::Project4d() { return Vector4::From(1, x, y, z); } @@ -695,7 +695,7 @@ double Vector::DivPivoting(Vector delta) { } } -Vector Vector::ClosestOrtho(void) { +Vector Vector::ClosestOrtho() { double mx = fabs(x), my = fabs(y), mz = fabs(z); if(mx > my && mx > mz) { @@ -930,7 +930,7 @@ Vector4 Vector4::ScaledBy(double s) { return Vector4::From(w*s, x*s, y*s, z*s); } -Vector Vector4::PerspectiveProject(void) { +Vector Vector4::PerspectiveProject() { return Vector::From(x / w, y / w, z / w); } @@ -971,11 +971,11 @@ double Point2d::DivPivoting(Point2d delta) const { } } -double Point2d::MagSquared(void) const { +double Point2d::MagSquared() const { return x*x + y*y; } -double Point2d::Magnitude(void) const { +double Point2d::Magnitude() const { return sqrt(x*x + y*y); } @@ -1017,7 +1017,7 @@ double Point2d::DistanceToLine(const Point2d &p0, const Point2d &dp, bool segmen } } -Point2d Point2d::Normal(void) const { +Point2d Point2d::Normal() const { return { y, -x }; } diff --git a/src/view.cpp b/src/view.cpp index bf76ba95..977df6a5 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -6,7 +6,7 @@ //----------------------------------------------------------------------------- #include "solvespace.h" -void TextWindow::ShowEditView(void) { +void TextWindow::ShowEditView() { Printf(true, "%Ft3D VIEW PARAMETERS%E"); Printf(true, "%Bd %Ftoverall scale factor%E");