diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index 4bd1ece87..85639eb0e 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -207,7 +207,7 @@ int FGRunwaysUtil::load( const string& file ) { #else - in >> skipws; + in >> ::skipws; while ( ! in.eof() ) { char c = 0; in.get(c); @@ -222,7 +222,7 @@ int FGRunwaysUtil::load( const string& file ) { } else { in >> skipeol; } - in >> skipws; + in >> ::skipws; } #endif diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 6915132c7..6c0911a0c 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -151,7 +151,7 @@ int FGAirportsUtil::load( const string& file ) { #else - in >> skipws; + in >> ::skipws; while ( ! in.eof() ) { char c = 0; in.get(c); @@ -165,7 +165,7 @@ int FGAirportsUtil::load( const string& file ) { } else { in >> skipeol; } - in >> skipws; + in >> ::skipws; } #endif diff --git a/src/Cockpit/sp_panel.cxx b/src/Cockpit/sp_panel.cxx index 89e32248d..172c09994 100644 --- a/src/Cockpit/sp_panel.cxx +++ b/src/Cockpit/sp_panel.cxx @@ -1020,11 +1020,12 @@ fgCreateSmallSinglePropPanel (int xpos, int ypos, int finx, int finy) FGLayeredInstrument * inst = 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]); } - for (int j = 0; gauge.layers[j].layer; j++) { + for (j = 0; gauge.layers[j].layer; j++) { LayerData &layer = gauge.layers[j]; // inst->addLayer(tex[layer.textureName], layer.w, layer.h); inst->addLayer(layer.layer); diff --git a/src/FDM/UIUCModel/uiuc_parsefile.h b/src/FDM/UIUCModel/uiuc_parsefile.h index 09752146c..8d831cba5 100644 --- a/src/FDM/UIUCModel/uiuc_parsefile.h +++ b/src/FDM/UIUCModel/uiuc_parsefile.h @@ -5,6 +5,12 @@ #include #include +#include + +FG_USING_STD(list); +FG_USING_STD(string); +FG_USING_STD(ifstream); + #define DELIMITERS " \t" #define COMMENT "#" diff --git a/src/FDM/UIUCModel/uiuc_recorder.cpp b/src/FDM/UIUCModel/uiuc_recorder.cpp index 4c1e316d0..f5a5998cf 100644 --- a/src/FDM/UIUCModel/uiuc_recorder.cpp +++ b/src/FDM/UIUCModel/uiuc_recorder.cpp @@ -87,11 +87,12 @@ void uiuc_recorder( double dt ) command_list = recordParts->getCommands(); 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) + " "; 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); diff --git a/src/FDM/UIUCModel/uiuc_warnings_errors.h b/src/FDM/UIUCModel/uiuc_warnings_errors.h index 80cb9eaad..5977b2faa 100644 --- a/src/FDM/UIUCModel/uiuc_warnings_errors.h +++ b/src/FDM/UIUCModel/uiuc_warnings_errors.h @@ -4,6 +4,8 @@ #include #include +using std::string; + void uiuc_warnings_errors(int errorCode, string line); #endif //_WARNINGS_ERRORS_H_ diff --git a/src/Joystick/joystick.cxx b/src/Joystick/joystick.cxx index 279632abb..76f2f636a 100644 --- a/src/Joystick/joystick.cxx +++ b/src/Joystick/joystick.cxx @@ -275,7 +275,8 @@ fgJoystickInit() // // Initialize the axes. // - for (int j = 0; j < naxes; j++) { + int j; + for (j = 0; j < naxes; j++) { axis &a = joysticks[i].axes[j]; string base = "/input/"; @@ -368,7 +369,7 @@ fgJoystickInit() // // Initialize the buttons. // - for (int j = 0; j < nbuttons; j++) { + for (j = 0; j < nbuttons; j++) { button &b = joysticks[i].buttons[j]; string base = "/input/"; @@ -472,7 +473,8 @@ fgJoystickRead() // // Axes // - for (int j = 0; j < joysticks[i].naxes; j++) { + int j; + for (j = 0; j < joysticks[i].naxes; j++) { bool flag = true; axis &a = joysticks[i].axes[j]; @@ -494,7 +496,7 @@ fgJoystickRead() // // Buttons // - for (int j = 0; j < joysticks[i].nbuttons; j++) { + for (j = 0; j < joysticks[i].nbuttons; j++) { bool flag; button &b = joysticks[i].buttons[j]; if (b.value == 0) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index c577ba9ce..a27c142ec 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -945,8 +945,10 @@ static void fgMainLoop( void ) { // } // 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; + if ( volume > 1.0 ) { volume = 1.0; } + // fprintf(stderr, "volume: %f\n", volume); pitch_envelope.setStep ( 0, 0.01, pitch ); diff --git a/src/Network/ray.cxx b/src/Network/ray.cxx index 0173f9275..1d471972d 100644 --- a/src/Network/ray.cxx +++ b/src/Network/ray.cxx @@ -21,6 +21,7 @@ // $Id$ +#include #include #include #include @@ -104,11 +105,11 @@ bool FGRAY::gen_message() { /* Make sure the angles are reasonable onscale */ /* We use an asymmetric mapping so that the chair behaves reasonably when upside down. Otherwise it oscillates. */ - while ( ang_pos < -2*M_PI/3 ) { - ang_pos += 2 * M_PI; + while ( ang_pos < -2*FG_PI/3 ) { + ang_pos += 2 * FG_PI; } - while ( ang_pos > 4*M_PI/3 ) { - ang_pos -= 2 * M_PI; + while ( ang_pos > 4*FG_PI/3 ) { + ang_pos -= 2 * FG_PI; } /* Tell interested parties what the situation is */ @@ -131,11 +132,11 @@ bool FGRAY::gen_message() { /* yaw */ /* 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 */ if ( ang_pos < chair_heading ) - chair_heading -= 2 * M_PI; - else chair_heading += 2 * M_PI; + chair_heading -= 2 * FG_PI; + else chair_heading += 2 * FG_PI; } /* Remove the chair heading from the true heading */ ang_pos -= chair_heading; @@ -144,7 +145,7 @@ bool FGRAY::gen_message() { can just about represent 30 degrees full scale. */ chair_heading += ang_pos * dt * 0.2; /* 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; } else @@ -178,8 +179,8 @@ bool FGRAY::gen_message() { /* Scale to the hardware's full scale range */ propose /= fullscale [ subaxis ]; /* Use a sine shaped washout on all axes */ - if ( propose < -M_PI / 2 ) *dac = 0x0000; else - if ( propose > M_PI / 2 ) *dac = 0xFFFF; else + if ( propose < -FG_PI / 2 ) *dac = 0x0000; else + if ( propose > FG_PI / 2 ) *dac = 0xFFFF; else *dac = (unsigned short) ( 32767 * ( 1.0 + sin ( propose ) ) ); } diff --git a/src/Objects/obj.cxx b/src/Objects/obj.cxx index 2f7cef034..8db9e1e82 100644 --- a/src/Objects/obj.cxx +++ b/src/Objects/obj.cxx @@ -338,7 +338,7 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t, const bool is_base) { while ( ! in.eof() ) { #endif -#if defined( macintosh ) +#if defined( macintosh ) || defined( _MSC_VER ) in >> ::skipws; #else 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 while ( true ) { -#if defined( macintosh ) +#if defined( macintosh ) || defined( _MSC_VER ) in >> ::skipws; #else 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 // done with useful input it is noticed before hand. -#if defined( macintosh ) +#if defined( macintosh ) || defined( _MSC_VER ) in >> ::skipws; #else in >> skipws;