From 45904a45ebca13f994c55ed883445a38f1db4d02 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 30 Jul 2001 22:53:53 +0000 Subject: [PATCH] Various MSVC tweaks and warning fixes. --- src/FDM/IO360.cxx | 4 ++-- src/FDM/LaRCsim/c172_gear.c | 20 +++++++++++++------- src/FDM/LaRCsim/cherokee_gear.c | 5 ++++- src/FDM/LaRCsim/ls_trim.c | 9 ++++++--- src/FDM/LaRCsim/navion_gear.c | 5 ++++- src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp | 1 + src/FDM/UIUCModel/uiuc_2Dinterpolation.cpp | 1 + src/FDM/UIUCModel/uiuc_aerodeflections.cpp | 5 +++-- src/FDM/UIUCModel/uiuc_gear.cpp | 11 +++++++---- src/FDM/UIUCModel/uiuc_parsefile.cpp | 10 +++++----- 10 files changed, 46 insertions(+), 25 deletions(-) diff --git a/src/FDM/IO360.cxx b/src/FDM/IO360.cxx index 68687ef81..3adc1e363 100644 --- a/src/FDM/IO360.cxx +++ b/src/FDM/IO360.cxx @@ -141,7 +141,7 @@ float FGNewEngine::Lookup_Combustion_Efficiency(float thi_actual) float thi[NUM_ELEMENTS] = {0.0, 0.9, 1.0, 1.05, 1.1, 1.15, 1.2, 1.3, 1.4, 1.5, 1.6}; //array of equivalence ratio values float neta_comb[NUM_ELEMENTS] = {0.98, 0.98, 0.97, 0.95, 0.9, 0.85, 0.79, 0.7, 0.63, 0.57, 0.525}; //corresponding array of combustion efficiency values //combustion efficiency values from Heywood, "Internal Combustion Engine Fundamentals", ISBN 0-07-100499-8 - float neta_comb_actual; + float neta_comb_actual = 0.0f; float factor; int i; @@ -188,7 +188,7 @@ float FGNewEngine::Power_Mixture_Correlation(float thi_actual) // The lookup table is in AFR because the source data was. I added the two end elements to make sure we are almost always in it. float AFR[NUM_ELEMENTS] = {(14.7/1.6), 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, (14.7/0.6)}; //array of equivalence ratio values float mixPerPow[NUM_ELEMENTS] = {78, 86, 93.5, 98, 100, 99, 96.4, 92.5, 88, 83, 78.5, 74, 58}; //corresponding array of combustion efficiency values - float mixPerPow_actual; + float mixPerPow_actual = 0.0f; float factor; float dydx; diff --git a/src/FDM/LaRCsim/c172_gear.c b/src/FDM/LaRCsim/c172_gear.c index 180c26776..0f2f36c8c 100644 --- a/src/FDM/LaRCsim/c172_gear.c +++ b/src/FDM/LaRCsim/c172_gear.c @@ -36,6 +36,9 @@ $Header$ $Log$ +Revision 1.20 2001/07/30 20:53:54 curt +Various MSVC tweaks and warning fixes. + Revision 1.19 2001/03/02 21:37:01 curt Added a first pass at a C++ sound manager class. @@ -145,7 +148,7 @@ void c172_gear() { char rcsid[] = "$Id$"; #define NUM_WHEELS 4 -char gear_strings[NUM_WHEELS][12]={"nose","right main", "left main", "tail skid"}; +// char gear_strings[NUM_WHEELS][12]={"nose","right main", "left main", "tail skid"}; /* * Aircraft specific initializations and data goes here */ @@ -159,8 +162,8 @@ char gear_strings[NUM_WHEELS][12]={"nose","right main", "left main", "tail skid" { -1.47, -3.58, 6.71 }, /*left main*/ { -15.67, 0, 2.42 } /*tail skid */ }; - static DATA gear_travel[NUM_WHEELS] = /*in Z-axis*/ - { -0.5, 2.5, 2.5, 0}; + // static DATA gear_travel[NUM_WHEELS] = /*in Z-axis*/ + // { -0.5, 2.5, 2.5, 0}; static DATA spring_constant[NUM_WHEELS] = /* springiness, lbs/ft */ { 1200., 900., 900., 10000. }; static DATA spring_damping[NUM_WHEELS] = /* damping, lbs/ft/sec */ @@ -208,12 +211,15 @@ char gear_strings[NUM_WHEELS][12]={"nose","right main", "left main", "tail skid" DATA d_wheel_cg_local_v[3]; /* wheel offset from cg, N-E-D */ DATA d_wheel_rwy_local_v[3]; /* wheel offset from rwy, N-E-U */ DATA v_wheel_cg_local_v[3]; /*wheel velocity rel to cg N-E-D*/ - DATA v_wheel_body_v[3]; /* wheel velocity, X-Y-Z */ + // DATA v_wheel_body_v[3]; /* wheel velocity, X-Y-Z */ DATA v_wheel_local_v[3]; /* wheel velocity, N-E-D */ DATA f_wheel_local_v[3]; /* wheel reaction force, N-E-D */ - DATA altitude_local_v[3]; /*altitude vector in local (N-E-D) i.e. (0,0,h)*/ - DATA altitude_body_v[3]; /*altitude vector in body (X,Y,Z)*/ - DATA temp3a[3], temp3b[3], tempF[3], tempM[3]; + // DATA altitude_local_v[3]; /*altitude vector in local (N-E-D) i.e. (0,0,h)*/ + // DATA altitude_body_v[3]; /*altitude vector in body (X,Y,Z)*/ + DATA temp3a[3]; + // DATA temp3b[3]; + DATA tempF[3]; + DATA tempM[3]; DATA reaction_normal_force; /* wheel normal (to rwy) force */ DATA cos_wheel_hdg_angle, sin_wheel_hdg_angle; /* temp storage */ DATA v_wheel_forward, v_wheel_sideward, abs_v_wheel_sideward; diff --git a/src/FDM/LaRCsim/cherokee_gear.c b/src/FDM/LaRCsim/cherokee_gear.c index 27cf80cc6..616ebf787 100644 --- a/src/FDM/LaRCsim/cherokee_gear.c +++ b/src/FDM/LaRCsim/cherokee_gear.c @@ -36,6 +36,9 @@ $Header$ $Log$ +Revision 1.3 2001/07/30 20:53:54 curt +Various MSVC tweaks and warning fixes. + Revision 1.2 2000/04/10 18:09:41 curt David Megginson made a few (mostly minor) mods to the LaRCsim files, and it's now possible to choose the LaRCsim model at runtime, as in @@ -189,7 +192,7 @@ char rcsid[] = "$Id$"; DATA d_wheel_cg_body_v[3]; /* wheel offset from cg, X-Y-Z */ DATA d_wheel_cg_local_v[3]; /* wheel offset from cg, N-E-D */ DATA d_wheel_rwy_local_v[3]; /* wheel offset from rwy, N-E-U */ - DATA v_wheel_body_v[3]; /* wheel velocity, X-Y-Z */ + // DATA v_wheel_body_v[3]; /* wheel velocity, X-Y-Z */ DATA v_wheel_local_v[3]; /* wheel velocity, N-E-D */ DATA f_wheel_local_v[3]; /* wheel reaction force, N-E-D */ DATA temp3a[3], temp3b[3], tempF[3], tempM[3]; diff --git a/src/FDM/LaRCsim/ls_trim.c b/src/FDM/LaRCsim/ls_trim.c index 8d324d3ce..afa1e3ffd 100644 --- a/src/FDM/LaRCsim/ls_trim.c +++ b/src/FDM/LaRCsim/ls_trim.c @@ -88,8 +88,11 @@ $Header$ $Log$ -Revision 1.1 1999/06/17 18:07:33 curt -Initial revision +Revision 1.2 2001/07/30 20:53:54 curt +Various MSVC tweaks and warning fixes. + +Revision 1.1.1.1 1999/06/17 18:07:33 curt +Start of 0.7.x branch Revision 1.1.1.1 1999/04/05 21:32:45 curt Start of 0.6.x branch. @@ -226,7 +229,7 @@ int ls_trim_init() /* Initialize partials matrix */ { int i, error; - int result; + // int result; Index = -1; Trim_Cycles = 0; diff --git a/src/FDM/LaRCsim/navion_gear.c b/src/FDM/LaRCsim/navion_gear.c index 2e8fb4a5f..9c83472ff 100644 --- a/src/FDM/LaRCsim/navion_gear.c +++ b/src/FDM/LaRCsim/navion_gear.c @@ -36,6 +36,9 @@ $Header$ $Log$ +Revision 1.4 2001/07/30 20:53:54 curt +Various MSVC tweaks and warning fixes. + Revision 1.3 2000/06/12 18:52:37 curt Added differential braking (Alex and David). @@ -213,7 +216,7 @@ char rcsid[] = "$Id$"; DATA d_wheel_cg_body_v[3]; /* wheel offset from cg, X-Y-Z */ DATA d_wheel_cg_local_v[3]; /* wheel offset from cg, N-E-D */ DATA d_wheel_rwy_local_v[3]; /* wheel offset from rwy, N-E-U */ - DATA v_wheel_body_v[3]; /* wheel velocity, X-Y-Z */ + // DATA v_wheel_body_v[3]; /* wheel velocity, X-Y-Z */ DATA v_wheel_local_v[3]; /* wheel velocity, N-E-D */ DATA f_wheel_local_v[3]; /* wheel reaction force, N-E-D */ DATA temp3a[3], temp3b[3], tempF[3], tempM[3]; diff --git a/src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp b/src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp index e89d988b6..97c74229a 100644 --- a/src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp +++ b/src/FDM/UIUCModel/uiuc_1Dinterpolation.cpp @@ -70,6 +70,7 @@ USA or view http://www.gnu.org/copyleft/gpl.html. **********************************************************************/ +#include // to disable C4244 d to f warning #include "uiuc_1Dinterpolation.h" diff --git a/src/FDM/UIUCModel/uiuc_2Dinterpolation.cpp b/src/FDM/UIUCModel/uiuc_2Dinterpolation.cpp index d20217be5..a5b628bb7 100644 --- a/src/FDM/UIUCModel/uiuc_2Dinterpolation.cpp +++ b/src/FDM/UIUCModel/uiuc_2Dinterpolation.cpp @@ -72,6 +72,7 @@ USA or view http://www.gnu.org/copyleft/gpl.html. **********************************************************************/ +#include // MSVC: to disable C4244 d to f warning #include "uiuc_2Dinterpolation.h" diff --git a/src/FDM/UIUCModel/uiuc_aerodeflections.cpp b/src/FDM/UIUCModel/uiuc_aerodeflections.cpp index 0581dc6b0..f84d14452 100644 --- a/src/FDM/UIUCModel/uiuc_aerodeflections.cpp +++ b/src/FDM/UIUCModel/uiuc_aerodeflections.cpp @@ -74,8 +74,9 @@ void uiuc_aerodeflections( double dt ) { - double prevFlapHandle, flap_transit_rate; - bool flaps_in_transit; + double prevFlapHandle = 0.0f; + double flap_transit_rate; + bool flaps_in_transit = false; if (zero_Long_trim) { diff --git a/src/FDM/UIUCModel/uiuc_gear.cpp b/src/FDM/UIUCModel/uiuc_gear.cpp index accb7816b..6a739fc73 100644 --- a/src/FDM/UIUCModel/uiuc_gear.cpp +++ b/src/FDM/UIUCModel/uiuc_gear.cpp @@ -181,12 +181,15 @@ void uiuc_gear() DATA d_wheel_cg_local_v[3]; /* wheel offset from cg, N-E-D */ DATA d_wheel_rwy_local_v[3]; /* wheel offset from rwy, N-E-U */ DATA v_wheel_cg_local_v[3]; /*wheel velocity rel to cg N-E-D*/ - DATA v_wheel_body_v[3]; /* wheel velocity, X-Y-Z */ + // DATA v_wheel_body_v[3]; /* wheel velocity, X-Y-Z */ DATA v_wheel_local_v[3]; /* wheel velocity, N-E-D */ DATA f_wheel_local_v[3]; /* wheel reaction force, N-E-D */ - DATA altitude_local_v[3]; /*altitude vector in local (N-E-D) i.e. (0,0,h)*/ - DATA altitude_body_v[3]; /*altitude vector in body (X,Y,Z)*/ - DATA temp3a[3], temp3b[3], tempF[3], tempM[3]; + // DATA altitude_local_v[3]; /*altitude vector in local (N-E-D) i.e. (0,0,h)*/ + // DATA altitude_body_v[3]; /*altitude vector in body (X,Y,Z)*/ + DATA temp3a[3]; + // DATA temp3b[3]; + DATA tempF[3]; + DATA tempM[3]; DATA reaction_normal_force; /* wheel normal (to rwy) force */ DATA cos_wheel_hdg_angle, sin_wheel_hdg_angle; /* temp storage */ DATA v_wheel_forward, v_wheel_sideward, abs_v_wheel_sideward; diff --git a/src/FDM/UIUCModel/uiuc_parsefile.cpp b/src/FDM/UIUCModel/uiuc_parsefile.cpp index a9ab68c93..b09d41e01 100644 --- a/src/FDM/UIUCModel/uiuc_parsefile.cpp +++ b/src/FDM/UIUCModel/uiuc_parsefile.cpp @@ -80,7 +80,7 @@ ParseFile :: ~ParseFile () void ParseFile :: removeComments(string& inputLine) { - int pos = inputLine.find_first_of(COMMENT); + unsigned int pos = inputLine.find_first_of(COMMENT); if (pos != inputLine.npos) // a "#" exists in the line { @@ -94,8 +94,8 @@ void ParseFile :: removeComments(string& inputLine) string ParseFile :: getToken(string inputLine, int tokenNo) { - int pos = 0; - int pos1 = 0; + unsigned int pos = 0; + unsigned int pos1 = 0; int tokencounter = 0; while (tokencounter < tokenNo) @@ -118,9 +118,9 @@ string ParseFile :: getToken(string inputLine, int tokenNo) void ParseFile :: storeCommands(string inputLine) { - int pos; + unsigned int pos; int pos1; - int wordlength; + // int wordlength; string line; inputLine += " "; // To take care of the case when last character is not a blank -- 2.39.5