1
0
Fork 0

Fixes for MSVC++ issues.

This commit is contained in:
curt 2000-09-21 22:59:27 +00:00
parent dda2746ca3
commit bf14bb1151
10 changed files with 41 additions and 26 deletions

View file

@ -207,7 +207,7 @@ int FGRunwaysUtil::load( const string& file ) {
#else #else
in >> skipws; in >> ::skipws;
while ( ! in.eof() ) { while ( ! in.eof() ) {
char c = 0; char c = 0;
in.get(c); in.get(c);
@ -222,7 +222,7 @@ int FGRunwaysUtil::load( const string& file ) {
} else { } else {
in >> skipeol; in >> skipeol;
} }
in >> skipws; in >> ::skipws;
} }
#endif #endif

View file

@ -151,7 +151,7 @@ int FGAirportsUtil::load( const string& file ) {
#else #else
in >> skipws; in >> ::skipws;
while ( ! in.eof() ) { while ( ! in.eof() ) {
char c = 0; char c = 0;
in.get(c); in.get(c);
@ -165,7 +165,7 @@ int FGAirportsUtil::load( const string& file ) {
} else { } else {
in >> skipeol; in >> skipeol;
} }
in >> skipws; in >> ::skipws;
} }
#endif #endif

View file

@ -1020,11 +1020,12 @@ fgCreateSmallSinglePropPanel (int xpos, int ypos, int finx, int finy)
FGLayeredInstrument * inst = FGLayeredInstrument * inst =
new FGLayeredInstrument(gauge.x, gauge.y, gauge.w, gauge.h); new FGLayeredInstrument(gauge.x, gauge.y, gauge.w, gauge.h);
for (int j = 0; gauge.actions[j]; j++) { int j;
for (j = 0; gauge.actions[j]; j++) {
inst->addAction(gauge.actions[j]); inst->addAction(gauge.actions[j]);
} }
for (int j = 0; gauge.layers[j].layer; j++) { for (j = 0; gauge.layers[j].layer; j++) {
LayerData &layer = gauge.layers[j]; LayerData &layer = gauge.layers[j];
// inst->addLayer(tex[layer.textureName], layer.w, layer.h); // inst->addLayer(tex[layer.textureName], layer.w, layer.h);
inst->addLayer(layer.layer); inst->addLayer(layer.layer);

View file

@ -5,6 +5,12 @@
#include <list> #include <list>
#include <fstream> #include <fstream>
#include <simgear/compiler.h>
FG_USING_STD(list);
FG_USING_STD(string);
FG_USING_STD(ifstream);
#define DELIMITERS " \t" #define DELIMITERS " \t"
#define COMMENT "#" #define COMMENT "#"

View file

@ -87,11 +87,12 @@ void uiuc_recorder( double dt )
command_list = recordParts->getCommands(); command_list = recordParts->getCommands();
fout << endl; fout << endl;
for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line) LIST command_line;
for (command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
record_variables += recordParts->getToken(*command_line,2) + " "; record_variables += recordParts->getToken(*command_line,2) + " ";
fout << record_variables << endl; fout << record_variables << endl;
for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line) for (command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
{ {
linetoken = recordParts->getToken(*command_line, 2); linetoken = recordParts->getToken(*command_line, 2);

View file

@ -4,6 +4,8 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
using std::string;
void uiuc_warnings_errors(int errorCode, string line); void uiuc_warnings_errors(int errorCode, string line);
#endif //_WARNINGS_ERRORS_H_ #endif //_WARNINGS_ERRORS_H_

View file

@ -275,7 +275,8 @@ fgJoystickInit()
// //
// Initialize the axes. // Initialize the axes.
// //
for (int j = 0; j < naxes; j++) { int j;
for (j = 0; j < naxes; j++) {
axis &a = joysticks[i].axes[j]; axis &a = joysticks[i].axes[j];
string base = "/input/"; string base = "/input/";
@ -368,7 +369,7 @@ fgJoystickInit()
// //
// Initialize the buttons. // Initialize the buttons.
// //
for (int j = 0; j < nbuttons; j++) { for (j = 0; j < nbuttons; j++) {
button &b = joysticks[i].buttons[j]; button &b = joysticks[i].buttons[j];
string base = "/input/"; string base = "/input/";
@ -472,7 +473,8 @@ fgJoystickRead()
// //
// Axes // Axes
// //
for (int j = 0; j < joysticks[i].naxes; j++) { int j;
for (j = 0; j < joysticks[i].naxes; j++) {
bool flag = true; bool flag = true;
axis &a = joysticks[i].axes[j]; axis &a = joysticks[i].axes[j];
@ -494,7 +496,7 @@ fgJoystickRead()
// //
// Buttons // Buttons
// //
for (int j = 0; j < joysticks[i].nbuttons; j++) { for (j = 0; j < joysticks[i].nbuttons; j++) {
bool flag; bool flag;
button &b = joysticks[i].buttons[j]; button &b = joysticks[i].buttons[j];
if (b.value == 0) if (b.value == 0)

View file

@ -945,8 +945,10 @@ static void fgMainLoop( void ) {
// } // }
// fprintf(stderr, "pitch4: %f\n", pitch); // fprintf(stderr, "pitch4: %f\n", pitch);
double volume = controls.get_throttle(0) * 1.15 + 0.3 + double volume = controls.get_throttle(0) * 0.1 + 0.3 +
log(cur_fdm_state->get_V_calibrated_kts() * kts_to_fts + 1.0)/14.0; log(cur_fdm_state->get_V_calibrated_kts() * kts_to_fts + 1.0)/14.0;
if ( volume > 1.0 ) { volume = 1.0; }
// fprintf(stderr, "volume: %f\n", volume); // fprintf(stderr, "volume: %f\n", volume);
pitch_envelope.setStep ( 0, 0.01, pitch ); pitch_envelope.setStep ( 0, 0.01, pitch );

View file

@ -21,6 +21,7 @@
// $Id$ // $Id$
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
#include <simgear/io/iochannel.hxx> #include <simgear/io/iochannel.hxx>
#include <simgear/math/fg_geodesy.hxx> #include <simgear/math/fg_geodesy.hxx>
@ -104,11 +105,11 @@ bool FGRAY::gen_message() {
/* Make sure the angles are reasonable onscale */ /* Make sure the angles are reasonable onscale */
/* We use an asymmetric mapping so that the chair behaves /* We use an asymmetric mapping so that the chair behaves
reasonably when upside down. Otherwise it oscillates. */ reasonably when upside down. Otherwise it oscillates. */
while ( ang_pos < -2*M_PI/3 ) { while ( ang_pos < -2*FG_PI/3 ) {
ang_pos += 2 * M_PI; ang_pos += 2 * FG_PI;
} }
while ( ang_pos > 4*M_PI/3 ) { while ( ang_pos > 4*FG_PI/3 ) {
ang_pos -= 2 * M_PI; ang_pos -= 2 * FG_PI;
} }
/* Tell interested parties what the situation is */ /* Tell interested parties what the situation is */
@ -131,11 +132,11 @@ bool FGRAY::gen_message() {
/* yaw */ /* yaw */
/* Make sure that we walk through North cleanly */ /* Make sure that we walk through North cleanly */
if ( fabs ( ang_pos - chair_heading ) > M_PI ) if ( fabs ( ang_pos - chair_heading ) > FG_PI )
{ /* Need to swing chair by 360 degrees */ { /* Need to swing chair by 360 degrees */
if ( ang_pos < chair_heading ) if ( ang_pos < chair_heading )
chair_heading -= 2 * M_PI; chair_heading -= 2 * FG_PI;
else chair_heading += 2 * M_PI; else chair_heading += 2 * FG_PI;
} }
/* Remove the chair heading from the true heading */ /* Remove the chair heading from the true heading */
ang_pos -= chair_heading; ang_pos -= chair_heading;
@ -144,7 +145,7 @@ bool FGRAY::gen_message() {
can just about represent 30 degrees full scale. */ can just about represent 30 degrees full scale. */
chair_heading += ang_pos * dt * 0.2; chair_heading += ang_pos * dt * 0.2;
/* If they turn fast, at 90 deg error subtract 30 deg */ /* If they turn fast, at 90 deg error subtract 30 deg */
if ( fabs(ang_pos) > M_PI / 2 ) if ( fabs(ang_pos) > FG_PI / 2 )
chair_heading += ang_pos / 3; chair_heading += ang_pos / 3;
} else } else
@ -178,8 +179,8 @@ bool FGRAY::gen_message() {
/* Scale to the hardware's full scale range */ /* Scale to the hardware's full scale range */
propose /= fullscale [ subaxis ]; propose /= fullscale [ subaxis ];
/* Use a sine shaped washout on all axes */ /* Use a sine shaped washout on all axes */
if ( propose < -M_PI / 2 ) *dac = 0x0000; else if ( propose < -FG_PI / 2 ) *dac = 0x0000; else
if ( propose > M_PI / 2 ) *dac = 0xFFFF; else if ( propose > FG_PI / 2 ) *dac = 0xFFFF; else
*dac = (unsigned short) ( 32767 * *dac = (unsigned short) ( 32767 *
( 1.0 + sin ( propose ) ) ); ( 1.0 + sin ( propose ) ) );
} }

View file

@ -338,7 +338,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t, const bool is_base) {
while ( ! in.eof() ) { while ( ! in.eof() ) {
#endif #endif
#if defined( macintosh ) #if defined( macintosh ) || defined( _MSC_VER )
in >> ::skipws; in >> ::skipws;
#else #else
in >> skipws; in >> skipws;
@ -572,7 +572,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t, const bool is_base) {
// read all subsequent numbers until next thing isn't a number // read all subsequent numbers until next thing isn't a number
while ( true ) { while ( true ) {
#if defined( macintosh ) #if defined( macintosh ) || defined( _MSC_VER )
in >> ::skipws; in >> ::skipws;
#else #else
in >> skipws; in >> skipws;
@ -673,7 +673,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t, const bool is_base) {
// eat white space before start of while loop so if we are // eat white space before start of while loop so if we are
// done with useful input it is noticed before hand. // done with useful input it is noticed before hand.
#if defined( macintosh ) #if defined( macintosh ) || defined( _MSC_VER )
in >> ::skipws; in >> ::skipws;
#else #else
in >> skipws; in >> skipws;