More static analysis fixes.

This commit is contained in:
Jason Watkins
2015-04-27 09:26:17 -07:00
parent bdc4a04f1f
commit 22a2adf5f2
4 changed files with 7 additions and 9 deletions

View File

@@ -439,7 +439,7 @@ namespace XPC
#endif
float gearArray[10];
if ((gear < -8.5f && gear > 9.5f) || (gear < -997.9f && gear > -999.1f))
if ((gear < -8.5f && gear > -9.5f) || (gear < -997.9f && gear > -999.1f))
{
return;
}

View File

@@ -136,13 +136,11 @@ namespace XPC
float py = XPLMGetDataf(planeYref);
float pz = XPLMGetDataf(planeZref);
Waypoint* g;
LocalPoint* l;
//Convert to local
for (size_t i = 0; i < numWaypoints; ++i)
{
g = &waypoints[i];
l = &localPoints[i];
Waypoint* g = &waypoints[i];
LocalPoint* l = &localPoints[i];
XPLMWorldToLocal(g->latitude, g->longitude, g->altitude,
&l->x, &l->y, &l->z);
}
@@ -153,7 +151,7 @@ namespace XPC
glBegin(GL_LINES);
for (size_t i = 0; i < numWaypoints; ++i)
{
l = &localPoints[i];
LocalPoint* l = &localPoints[i];
glVertex3f((float)l->x, (float)l->y, (float)l->z);
glVertex3f((float)l->x, -1000.0F, (float)l->z);
}
@@ -164,7 +162,7 @@ namespace XPC
glBegin(GL_LINE_STRIP);
for (size_t i = 0; i < numWaypoints; ++i)
{
l = &localPoints[i];
LocalPoint* l = &localPoints[i];
glVertex3f((float)l->x, (float)l->y, (float)l->z);
}
glEnd();
@@ -173,7 +171,7 @@ namespace XPC
glColor3f(1.0F, 1.0F, 1.0F);
for (size_t i = 0; i < numWaypoints; ++i)
{
l = &localPoints[i];
LocalPoint* l = &localPoints[i];
float xoff = (float)l->x - px;
float yoff = (float)l->y - py;
float zoff = (float)l->z - pz;

View File

@@ -78,13 +78,13 @@ namespace XPC
void Log::FormatLine(const char* format, ...)
{
va_list args;
va_start(args, format);
FILE* fd = fopen("XPCLog.txt", "a");
if (!fd)
{
return;
}
va_start(args, format);
WriteTime(fd);
vfprintf(fd, format, args);

Binary file not shown.