General compiler warning/error fixes

This addresses a grab bag of compiler grievances relating to C++ syntax,
type, and scope, as observed on Linux with g++ and Solaris with Sun
WorkShop 6.
pull/3/head
Daniel Richard G 2013-08-26 16:54:04 -04:00
parent 7715fd1bb8
commit 66f46b7b67
8 changed files with 30 additions and 30 deletions

View File

@ -198,7 +198,7 @@ const SolveSpace::SaveTable SolveSpace::SAVED[] = {
{ 's', "Style.visible", 'b', &(SS.sv.s.visible) },
{ 's', "Style.exportable", 'b', &(SS.sv.s.exportable) },
{ 0, NULL, NULL, NULL },
{ 0, NULL, 0, NULL }
};
void SolveSpace::SaveUsingTable(int type) {

View File

@ -684,7 +684,7 @@ void SPolygon::FixContourDirections(void) {
}
bool clockwise = sc->IsClockwiseProjdToNormal(normal);
if(clockwise && outer || (!clockwise && !outer)) {
if((clockwise && outer) || (!clockwise && !outer)) {
sc->Reverse();
sc->tag = 1;
}

View File

@ -643,7 +643,7 @@ public:
typedef enum {
UNIT_MM = 0,
UNIT_INCHES,
UNIT_INCHES
} Unit;
Unit viewUnits;
int afterDecimalMm;

View File

@ -484,6 +484,11 @@ void SSurface::Clear(void) {
trim.Clear();
}
typedef struct {
hSCurve hc;
hSSurface hs;
} TrimLine;
void SShell::MakeFromExtrusionOf(SBezierLoopSet *sbls, Vector t0, Vector t1,
int color)
{
@ -524,11 +529,6 @@ void SShell::MakeFromExtrusionOf(SBezierLoopSet *sbls, Vector t0, Vector t1,
SBezierLoop *sbl;
for(sbl = sbls->l.First(); sbl; sbl = sbls->l.NextAfter(sbl)) {
SBezier *sb;
typedef struct {
hSCurve hc;
hSSurface hs;
} TrimLine;
List<TrimLine> trimLines;
ZERO(&trimLines);
@ -605,6 +605,10 @@ void SShell::MakeFromExtrusionOf(SBezierLoopSet *sbls, Vector t0, Vector t1,
}
typedef struct {
hSSurface d[4];
} Revolved;
void SShell::MakeFromRevolutionOf(SBezierLoopSet *sbls, Vector pt, Vector axis,
int color)
{
@ -643,10 +647,6 @@ void SShell::MakeFromRevolutionOf(SBezierLoopSet *sbls, Vector pt, Vector axis,
for(sbl = sbls->l.First(); sbl; sbl = sbls->l.NextAfter(sbl)) {
int i, j;
SBezier *sb, *prev;
typedef struct {
hSSurface d[4];
} Revolved;
List<Revolved> hsl;
ZERO(&hsl);

View File

@ -222,7 +222,7 @@ public:
Vector start;
Vector finish;
static STrimBy STrimBy::EntireCurve(SShell *shell, hSCurve hsc, bool bkwds);
static STrimBy EntireCurve(SShell *shell, hSCurve hsc, bool bkwds);
};
// An intersection point between a line and a surface

View File

@ -9,20 +9,20 @@
#include <png.h>
const Style::Default Style::Defaults[] = {
{ ACTIVE_GRP, "ActiveGrp", RGBf(1.0, 1.0, 1.0), 1.5, },
{ CONSTRUCTION, "Construction", RGBf(0.1, 0.7, 0.1), 1.5, },
{ INACTIVE_GRP, "InactiveGrp", RGBf(0.5, 0.3, 0.0), 1.5, },
{ DATUM, "Datum", RGBf(0.0, 0.8, 0.0), 1.5, },
{ SOLID_EDGE, "SolidEdge", RGBf(0.8, 0.8, 0.8), 1.0, },
{ CONSTRAINT, "Constraint", RGBf(1.0, 0.1, 1.0), 1.0, },
{ SELECTED, "Selected", RGBf(1.0, 0.0, 0.0), 1.5, },
{ HOVERED, "Hovered", RGBf(1.0, 1.0, 0.0), 1.5, },
{ CONTOUR_FILL, "ContourFill", RGBf(0.0, 0.1, 0.1), 1.0, },
{ NORMALS, "Normals", RGBf(0.0, 0.4, 0.4), 1.0, },
{ ANALYZE, "Analyze", RGBf(0.0, 1.0, 1.0), 1.0, },
{ DRAW_ERROR, "DrawError", RGBf(1.0, 0.0, 0.0), 8.0, },
{ DIM_SOLID, "DimSolid", RGBf(0.1, 0.1, 0.1), 1.0, },
{ 0, NULL, 0, 0.0, },
{ { ACTIVE_GRP }, "ActiveGrp", RGBf(1.0, 1.0, 1.0), 1.5, },
{ { CONSTRUCTION }, "Construction", RGBf(0.1, 0.7, 0.1), 1.5, },
{ { INACTIVE_GRP }, "InactiveGrp", RGBf(0.5, 0.3, 0.0), 1.5, },
{ { DATUM }, "Datum", RGBf(0.0, 0.8, 0.0), 1.5, },
{ { SOLID_EDGE }, "SolidEdge", RGBf(0.8, 0.8, 0.8), 1.0, },
{ { CONSTRAINT }, "Constraint", RGBf(1.0, 0.1, 1.0), 1.0, },
{ { SELECTED }, "Selected", RGBf(1.0, 0.0, 0.0), 1.5, },
{ { HOVERED }, "Hovered", RGBf(1.0, 1.0, 0.0), 1.5, },
{ { CONTOUR_FILL }, "ContourFill", RGBf(0.0, 0.1, 0.1), 1.0, },
{ { NORMALS }, "Normals", RGBf(0.0, 0.4, 0.4), 1.0, },
{ { ANALYZE }, "Analyze", RGBf(0.0, 1.0, 1.0), 1.0, },
{ { DRAW_ERROR }, "DrawError", RGBf(1.0, 0.0, 0.0), 8.0, },
{ { DIM_SOLID }, "DimSolid", RGBf(0.1, 0.1, 0.1), 1.0, },
{ { 0 }, NULL, 0, 0.0, }
};
char *Style::CnfColor(const char *prefix) {

2
ui.h
View File

@ -412,7 +412,7 @@ public:
MNU_STEP_DIM,
// Help,
MNU_WEBSITE,
MNU_ABOUT,
MNU_ABOUT
} MenuId;
typedef void MenuHandler(int id);
typedef struct {

View File

@ -172,7 +172,7 @@ void DoMessageBox(const char *str, int rows, int cols, BOOL error)
MSG msg;
DWORD ret;
MessageDone = FALSE;
while((ret = GetMessage(&msg, NULL, 0, 0)) && !MessageDone) {
while((ret = GetMessage(&msg, NULL, 0, 0)) != 0 && !MessageDone) {
if((msg.message == WM_KEYDOWN &&
(msg.wParam == VK_RETURN ||
msg.wParam == VK_ESCAPE)) ||
@ -1169,7 +1169,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
// will be from the wndprocs.
MSG msg;
DWORD ret;
while(ret = GetMessage(&msg, NULL, 0, 0)) {
while((ret = GetMessage(&msg, NULL, 0, 0)) != 0) {
// Is it a message from the six degree of freedom input device?
if(ProcessSpaceNavigatorMsg(&msg)) goto done;