Improved consistency of comment formatting.

This commit is contained in:
Jason Watkins
2015-05-11 15:17:04 -07:00
parent a406b82f44
commit c0efe91b60
13 changed files with 142 additions and 142 deletions

View File

@@ -1,13 +1,13 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
// //
//X-Plane API // X-Plane API
//Copyright(c) 2008, Sandy Barbour and Ben Supnik All rights reserved. // Copyright(c) 2008, Sandy Barbour and Ben Supnik All rights reserved.
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
//associated documentation files(the "Software"), to deal in the Software without restriction, // associated documentation files(the "Software"), to deal in the Software without restriction,
//including without limitation the rights to use, copy, modify, merge, publish, distribute, // including without limitation the rights to use, copy, modify, merge, publish, distribute,
//sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is // sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions : // furnished to do so, subject to the following conditions :
// * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
// * Neither the names of the authors nor that of X - Plane or Laminar Research // * Neither the names of the authors nor that of X - Plane or Laminar Research

View File

@@ -1,5 +1,5 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
#ifndef XPCPLUGIN_DATAMANAGER_H_ #ifndef XPCPLUGIN_DATAMANAGER_H_
#define XPCPLUGIN_DATAMANAGER_H_ #define XPCPLUGIN_DATAMANAGER_H_
@@ -62,7 +62,7 @@ namespace XPC
DREF_L, DREF_L,
DREF_N, DREF_N,
//PQR (Angular Velocities) // PQR (Angular Velocities)
DREF_QRad = 1600, DREF_QRad = 1600,
DREF_PRad, DREF_PRad,
DREF_RRad, DREF_RRad,

View File

@@ -1,13 +1,13 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
// //
//X-Plane API // X-Plane API
//Copyright(c) 2008, Sandy Barbour and Ben Supnik All rights reserved. // Copyright(c) 2008, Sandy Barbour and Ben Supnik All rights reserved.
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
//associated documentation files(the "Software"), to deal in the Software without restriction, // associated documentation files(the "Software"), to deal in the Software without restriction,
//including without limitation the rights to use, copy, modify, merge, publish, distribute, // including without limitation the rights to use, copy, modify, merge, publish, distribute,
//sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is // sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions : // furnished to do so, subject to the following conditions :
// * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
// * Neither the names of the authors nor that of X - Plane or Laminar Research // * Neither the names of the authors nor that of X - Plane or Laminar Research
@@ -23,7 +23,7 @@
#include <cmath> #include <cmath>
#include <string> #include <string>
#include <cstring> #include <cstring>
//OpenGL includes // OpenGL includes
#if IBM #if IBM
#include <windows.h> #include <windows.h>
#endif #endif
@@ -31,11 +31,11 @@
# include <OpenGL/gl.h> # include <OpenGL/gl.h>
#else #else
# include <GL/gl.h> # include <GL/gl.h>
#endif/*__APPLE__*/ #endif
namespace XPC namespace XPC
{ {
//Internal Structures // Internal Structures
typedef struct typedef struct
{ {
double x; double x;
@@ -43,7 +43,7 @@ namespace XPC
double z; double z;
} LocalPoint; } LocalPoint;
//Internal Memory // Internal Memory
static const size_t MSG_MAX = 1024; static const size_t MSG_MAX = 1024;
static const size_t MSG_LINE_MAX = MSG_MAX / 16; static const size_t MSG_LINE_MAX = MSG_MAX / 16;
static bool msgEnabled = false; static bool msgEnabled = false;
@@ -64,7 +64,7 @@ namespace XPC
XPLMDataRef planeYref; XPLMDataRef planeYref;
XPLMDataRef planeZref; XPLMDataRef planeZref;
//Internal Functions // Internal Functions
/// Comparse two size_t integers. Used by qsort in RemoveWaypoints. /// Comparse two size_t integers. Used by qsort in RemoveWaypoints.
static int cmp(const void * a, const void * b) static int cmp(const void * a, const void * b)
@@ -90,34 +90,34 @@ namespace XPC
/// \param d The distance from the player airplane to the center of the cube. /// \param d The distance from the player airplane to the center of the cube.
static void gl_drawCube(float x, float y, float z, float d) static void gl_drawCube(float x, float y, float z, float d)
{ {
//tan(0.25) degrees. Should scale all markers to appear about the same size // tan(0.25) degrees. Should scale all markers to appear about the same size
const float TAN = 0.00436335F; const float TAN = 0.00436335F;
float h = d * TAN; float h = d * TAN;
glBegin(GL_QUAD_STRIP); glBegin(GL_QUAD_STRIP);
//Top // Top
glVertex3f(x - h, y + h, z - h); glVertex3f(x - h, y + h, z - h);
glVertex3f(x + h, y + h, z - h); glVertex3f(x + h, y + h, z - h);
glVertex3f(x - h, y + h, z + h); glVertex3f(x - h, y + h, z + h);
glVertex3f(x + h, y + h, z + h); glVertex3f(x + h, y + h, z + h);
//Front // Front
glVertex3f(x - h, y - h, z + h); glVertex3f(x - h, y - h, z + h);
glVertex3f(x + h, y - h, z + h); glVertex3f(x + h, y - h, z + h);
//Bottom // Bottom
glVertex3f(x - h, y - h, z - h); glVertex3f(x - h, y - h, z - h);
glVertex3f(x + h, y - h, z - h); glVertex3f(x + h, y - h, z - h);
//Back // Back
glVertex3f(x - h, y + h, z - h); glVertex3f(x - h, y + h, z - h);
glVertex3f(x + h, y + h, z - h); glVertex3f(x + h, y + h, z - h);
glEnd(); glEnd();
glBegin(GL_QUADS); glBegin(GL_QUADS);
//Left // Left
glVertex3f(x - h, y + h, z - h); glVertex3f(x - h, y + h, z - h);
glVertex3f(x - h, y + h, z + h); glVertex3f(x - h, y + h, z + h);
glVertex3f(x - h, y - h, z + h); glVertex3f(x - h, y - h, z + h);
glVertex3f(x - h, y - h, z - h); glVertex3f(x - h, y - h, z - h);
//Right // Right
glVertex3f(x + h, y + h, z + h); glVertex3f(x + h, y + h, z + h);
glVertex3f(x + h, y + h, z - h); glVertex3f(x + h, y + h, z - h);
glVertex3f(x + h, y - h, z - h); glVertex3f(x + h, y - h, z - h);
@@ -147,7 +147,7 @@ namespace XPC
float py = XPLMGetDataf(planeYref); float py = XPLMGetDataf(planeYref);
float pz = XPLMGetDataf(planeZref); float pz = XPLMGetDataf(planeZref);
//Convert to local // Convert to local
for (size_t i = 0; i < numWaypoints; ++i) for (size_t i = 0; i < numWaypoints; ++i)
{ {
Waypoint* g = &waypoints[i]; Waypoint* g = &waypoints[i];
@@ -157,7 +157,7 @@ namespace XPC
} }
//Draw posts // Draw posts
glColor3f(1.0F, 1.0F, 1.0F); glColor3f(1.0F, 1.0F, 1.0F);
glBegin(GL_LINES); glBegin(GL_LINES);
for (size_t i = 0; i < numWaypoints; ++i) for (size_t i = 0; i < numWaypoints; ++i)
@@ -168,7 +168,7 @@ namespace XPC
} }
glEnd(); glEnd();
//Draw route // Draw route
glColor3f(1.0F, 0.0F, 0.0F); glColor3f(1.0F, 0.0F, 0.0F);
glBegin(GL_LINE_STRIP); glBegin(GL_LINE_STRIP);
for (size_t i = 0; i < numWaypoints; ++i) for (size_t i = 0; i < numWaypoints; ++i)
@@ -178,7 +178,7 @@ namespace XPC
} }
glEnd(); glEnd();
//Draw markers // Draw markers
glColor3f(1.0F, 1.0F, 1.0F); glColor3f(1.0F, 1.0F, 1.0F);
for (size_t i = 0; i < numWaypoints; ++i) for (size_t i = 0; i < numWaypoints; ++i)
{ {
@@ -192,7 +192,7 @@ namespace XPC
return 1; return 1;
} }
//Public Functions // Public Functions
void Drawing::ClearMessage() void Drawing::ClearMessage()
{ {
XPLMUnregisterDrawCallback(MessageDrawCallback, xplm_Phase_Window, 0, NULL); XPLMUnregisterDrawCallback(MessageDrawCallback, xplm_Phase_Window, 0, NULL);
@@ -209,7 +209,7 @@ namespace XPC
return; return;
} }
//Set the message, location, and mark new lines. // Set the message, location, and mark new lines.
strncpy(msgVal, msg, len + 1); strncpy(msgVal, msg, len + 1);
newLineCount = 0; newLineCount = 0;
for (size_t i = 0; i < len && newLineCount < MSG_LINE_MAX; ++i) for (size_t i = 0; i < len && newLineCount < MSG_LINE_MAX; ++i)
@@ -223,7 +223,7 @@ namespace XPC
msgX = x < 0 ? 10 : x; msgX = x < 0 ? 10 : x;
msgY = y < 0 ? 600 : y; msgY = y < 0 ? 600 : y;
//Enable drawing if necessary // Enable drawing if necessary
if (!msgEnabled) if (!msgEnabled)
{ {
XPLMRegisterDrawCallback(MessageDrawCallback, xplm_Phase_Window, 0, NULL); XPLMRegisterDrawCallback(MessageDrawCallback, xplm_Phase_Window, 0, NULL);
@@ -268,7 +268,7 @@ namespace XPC
void Drawing::RemoveWaypoints(Waypoint points[], size_t numPoints) void Drawing::RemoveWaypoints(Waypoint points[], size_t numPoints)
{ {
//Build a list of indices of waypoints we should delete. // Build a list of indices of waypoints we should delete.
size_t delPoints[WAYPOINT_MAX]; size_t delPoints[WAYPOINT_MAX];
size_t delPointsCur = 0; size_t delPointsCur = 0;
for (size_t i = 0; i < numPoints; ++i) for (size_t i = 0; i < numPoints; ++i)
@@ -286,10 +286,10 @@ namespace XPC
} }
} }
} }
//Sort the indices so that we only have to iterate them once // Sort the indices so that we only have to iterate them once
qsort(delPoints, delPointsCur, sizeof(size_t), cmp); qsort(delPoints, delPointsCur, sizeof(size_t), cmp);
//Copy the new array on top of the old array // Copy the new array on top of the old array
size_t copyCur = 0; size_t copyCur = 0;
size_t count = delPointsCur; size_t count = delPointsCur;
delPointsCur = 0; delPointsCur = 0;

View File

@@ -1,5 +1,5 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
#ifndef XPCPLUGIN_DRAWING_H_ #ifndef XPCPLUGIN_DRAWING_H_
#define XPCPLUGIN_DRAWING_H_ #define XPCPLUGIN_DRAWING_H_

View File

@@ -1,5 +1,5 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
#include "Log.h" #include "Log.h"
#include "XPLMUtilities.h" #include "XPLMUtilities.h"

View File

@@ -1,5 +1,5 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
#ifndef XPCPLUGIN_LOG_H_ #ifndef XPCPLUGIN_LOG_H_
#define XPCPLUGIN_LOG_H_ #define XPCPLUGIN_LOG_H_
#include <string> #include <string>

View File

@@ -1,5 +1,5 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
#include "Message.h" #include "Message.h"
#include "Log.h" #include "Log.h"

View File

@@ -1,5 +1,5 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
#ifndef XPCPLUGIN_MESSAGE_H_ #ifndef XPCPLUGIN_MESSAGE_H_
#define XPCPLUGIN_MESSAGE_H_ #define XPCPLUGIN_MESSAGE_H_

View File

@@ -1,13 +1,13 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
// //
//X-Plane API // X-Plane API
//Copyright(c) 2008, Sandy Barbour and Ben Supnik All rights reserved. // Copyright(c) 2008, Sandy Barbour and Ben Supnik All rights reserved.
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
//associated documentation files(the "Software"), to deal in the Software without restriction, // associated documentation files(the "Software"), to deal in the Software without restriction,
//including without limitation the rights to use, copy, modify, merge, publish, distribute, // including without limitation the rights to use, copy, modify, merge, publish, distribute,
//sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is // sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions : // furnished to do so, subject to the following conditions :
// * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
// * Neither the names of the authors nor that of X - Plane or Laminar Research // * Neither the names of the authors nor that of X - Plane or Laminar Research

View File

@@ -1,5 +1,5 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
#ifndef XPCPLUGIN_MESSAGEHANDLERS_H_ #ifndef XPCPLUGIN_MESSAGEHANDLERS_H_
#define XPCPLUGIN_MESSAGEHANDLERS_H_ #define XPCPLUGIN_MESSAGEHANDLERS_H_
#include "Message.h" #include "Message.h"

View File

@@ -1,5 +1,5 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
#include "Log.h" #include "Log.h"
#include "UDPSocket.h" #include "UDPSocket.h"
@@ -19,7 +19,7 @@ namespace XPC
localAddr.sin_addr.s_addr = INADDR_ANY; localAddr.sin_addr.s_addr = INADDR_ANY;
localAddr.sin_port = htons(recvPort); localAddr.sin_port = htons(recvPort);
//Create and bind the socket // Create and bind the socket
#ifdef _WIN32 #ifdef _WIN32
WSADATA wsa; WSADATA wsa;
int startResult = WSAStartup(MAKEWORD(2, 2), &wsa); int startResult = WSAStartup(MAKEWORD(2, 2), &wsa);
@@ -56,7 +56,7 @@ namespace XPC
return; return;
} }
//Set Timout // Set Timout
int usTimeOut = 500; int usTimeOut = 500;
#ifdef _WIN32 #ifdef _WIN32
@@ -68,8 +68,8 @@ namespace XPC
} }
#else #else
struct timeval tv; struct timeval tv;
tv.tv_sec = 0; /* Sec Timeout */ tv.tv_sec = 0;
tv.tv_usec = usTimeOut; // Microsec Timeout tv.tv_usec = usTimeOut;
setsockopt(this->sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)); setsockopt(this->sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval));
#endif #endif
} }
@@ -103,8 +103,8 @@ namespace XPC
FD_SET(sock, &stReadFDS); FD_SET(sock, &stReadFDS);
FD_ZERO(&stExceptFDS); FD_ZERO(&stExceptFDS);
FD_SET(sock, &stExceptFDS); FD_SET(sock, &stExceptFDS);
tv.tv_sec = 0; /* Sec Timeout */ tv.tv_sec = 0;
tv.tv_usec = 250; // Microsec Timeout tv.tv_usec = 250;
// Select Command // Select Command
int result = select(-1, &stReadFDS, (FD_SET *)0, &stExceptFDS, &tv); int result = select(-1, &stReadFDS, (FD_SET *)0, &stExceptFDS, &tv);

View File

@@ -1,5 +1,5 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
#ifndef XPCPLUGIN_SOCKET_H_ #ifndef XPCPLUGIN_SOCKET_H_
#define XPCPLUGIN_SOCKET_H_ #define XPCPLUGIN_SOCKET_H_
@@ -8,7 +8,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib") //Winsock Library #pragma comment(lib, "ws2_32.lib") // Winsock Library
#elif (__APPLE__ || __linux) #elif (__APPLE__ || __linux)
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@@ -1,7 +1,7 @@
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the // Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
//National Aeronautics and Space Administration. All Rights Reserved. // National Aeronautics and Space Administration. All Rights Reserved.
// //
//DISCLAIMERS // DISCLAIMERS
// No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND, // No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND,
// EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT // EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT
// THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF // THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF
@@ -22,13 +22,13 @@
// TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE REMEDY FOR ANY SUCH MATTER SHALL BE THE // TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE REMEDY FOR ANY SUCH MATTER SHALL BE THE
// IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT. // IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT.
// //
//X-Plane API // X-Plane API
//Copyright(c) 2008, Sandy Barbour and Ben Supnik All rights reserved. // Copyright(c) 2008, Sandy Barbour and Ben Supnik All rights reserved.
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
//associated documentation files(the "Software"), to deal in the Software without restriction, // associated documentation files(the "Software"), to deal in the Software without restriction,
//including without limitation the rights to use, copy, modify, merge, publish, distribute, // including without limitation the rights to use, copy, modify, merge, publish, distribute,
//sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is // sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions : // furnished to do so, subject to the following conditions :
// * Redistributions of source code must retain the above copyright notice, // * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. // this list of conditions and the following disclaimer.
// * Neither the names of the authors nor that of X - Plane or Laminar Research // * Neither the names of the authors nor that of X - Plane or Laminar Research