diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 6c0911a0c..27d9c9baf 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -194,7 +194,7 @@ bool FGAirportsUtil::dump_mk4( const string& file ) { c4_Row row; - iterator current = airports.begin(); + const_iterator current = airports.begin(); const_iterator end = airports.end(); while ( current != end ) { // add each airport record diff --git a/src/Cockpit/hud.hxx b/src/Cockpit/hud.hxx index 8734b1e9c..c6d004d02 100644 --- a/src/Cockpit/hud.hxx +++ b/src/Cockpit/hud.hxx @@ -28,6 +28,8 @@ # error This library requires C++ #endif +#include + #ifdef HAVE_CONFIG_H # include #endif diff --git a/src/Cockpit/panel_io.cxx b/src/Cockpit/panel_io.cxx index 8e550aee3..3c97c4c8f 100644 --- a/src/Cockpit/panel_io.cxx +++ b/src/Cockpit/panel_io.cxx @@ -638,7 +638,8 @@ readInstrument (SGPropertyNode node, int x, int y, int real_w, int real_h) // SGPropertyNode action_group = node.getSubNode("actions"); int nActions = action_group.size(); - for (int j = 0; j < nActions; j++) { + int j; + for (j = 0; j < nActions; j++) { FGPanelAction * action = readAction(action_group.getChild(j), hscale, vscale); if (action == 0) { @@ -653,7 +654,7 @@ readInstrument (SGPropertyNode node, int x, int y, int real_w, int real_h) // SGPropertyNode layer_group = node.getSubNode("layers"); int nLayers = layer_group.size(); - for (int j = 0; j < nLayers; j++) { + for (j = 0; j < nLayers; j++) { FGInstrumentLayer * layer = readLayer(layer_group.getChild(j), hscale, vscale); if (layer == 0) { diff --git a/src/Controls/controls.hxx b/src/Controls/controls.hxx index 54405b761..7c0ba350f 100644 --- a/src/Controls/controls.hxx +++ b/src/Controls/controls.hxx @@ -57,6 +57,8 @@ private: double rudder; double flaps; double throttle[MAX_ENGINES]; + double mixture[MAX_ENGINES]; + double prop_advance[MAX_ENGINES]; double brake[MAX_WHEELS]; bool throttle_idle; @@ -80,6 +82,10 @@ public: inline double get_rudder() const { return rudder; } inline double get_flaps() const { return flaps; } inline double get_throttle(int engine) const { return throttle[engine]; } + inline double get_mixture(int engine) const { return mixture[engine]; } + inline double get_prop_advance(int engine) const { + return prop_advance[engine]; + } inline double get_brake(int wheel) const { return brake[wheel]; } // Update functions @@ -163,6 +169,58 @@ public: } } } + inline void set_mixture( int engine, double pos ) { + if ( engine == ALL_ENGINES ) { + for ( int i = 0; i < MAX_ENGINES; i++ ) { + mixture[i] = pos; + CLAMP( &mixture[i], 0.0, 1.0 ); + } + } else { + if ( (engine >= 0) && (engine < MAX_ENGINES) ) { + mixture[engine] = pos; + CLAMP( &mixture[engine], 0.0, 1.0 ); + } + } + } + inline void move_mixture( int engine, double amt ) { + if ( engine == ALL_ENGINES ) { + for ( int i = 0; i < MAX_ENGINES; i++ ) { + mixture[i] += amt; + CLAMP( &mixture[i], 0.0, 1.0 ); + } + } else { + if ( (engine >= 0) && (engine < MAX_ENGINES) ) { + mixture[engine] += amt; + CLAMP( &mixture[engine], 0.0, 1.0 ); + } + } + } + inline void set_prop_advance( int engine, double pos ) { + if ( engine == ALL_ENGINES ) { + for ( int i = 0; i < MAX_ENGINES; i++ ) { + prop_advance[i] = pos; + CLAMP( &prop_advance[i], 0.0, 1.0 ); + } + } else { + if ( (engine >= 0) && (engine < MAX_ENGINES) ) { + prop_advance[engine] = pos; + CLAMP( &prop_advance[engine], 0.0, 1.0 ); + } + } + } + inline void move_prop_advance( int engine, double amt ) { + if ( engine == ALL_ENGINES ) { + for ( int i = 0; i < MAX_ENGINES; i++ ) { + prop_advance[i] += amt; + CLAMP( &prop_advance[i], 0.0, 1.0 ); + } + } else { + if ( (engine >= 0) && (engine < MAX_ENGINES) ) { + prop_advance[engine] += amt; + CLAMP( &prop_advance[engine], 0.0, 1.0 ); + } + } + } inline void set_brake( int wheel, double pos ) { if ( wheel == ALL_WHEELS ) { for ( int i = 0; i < MAX_WHEELS; i++ ) { diff --git a/src/FDM/10520d.cxx b/src/FDM/10520d.cxx index 2a0fcf20a..472ab79a2 100644 --- a/src/FDM/10520d.cxx +++ b/src/FDM/10520d.cxx @@ -47,11 +47,15 @@ // INCLUDES // ------------------------------------------------------------------------ -#include +#include + +#include #include #include "10520d.hxx" +FG_USING_STD(cout); +FG_USING_STD(endl); // ------------------------------------------------------------------------ // CODE diff --git a/src/FDM/10520d.hxx b/src/FDM/10520d.hxx index 082420e6e..954c6e436 100644 --- a/src/FDM/10520d.hxx +++ b/src/FDM/10520d.hxx @@ -51,7 +51,7 @@ #define _10520D_HXX_ -#include +#include #include diff --git a/src/FDM/IO360.cxx b/src/FDM/IO360.cxx index 22e7f97f9..64840d047 100644 --- a/src/FDM/IO360.cxx +++ b/src/FDM/IO360.cxx @@ -72,12 +72,15 @@ // ////////////////////////////////////////////////////////////////////// -#include -#include +#include + +#include +#include #include #include "IO360.hxx" +FG_USING_STD(cout); // ------------------------------------------------------------------------ // CODE diff --git a/src/FDM/IO360.hxx b/src/FDM/IO360.hxx index 71e63eb91..01fa64c8a 100644 --- a/src/FDM/IO360.hxx +++ b/src/FDM/IO360.hxx @@ -56,11 +56,13 @@ #define PHILS_PROP_MODEL #endif +#include -#include -#include +#include +#include #include +FG_USING_STD(ofstream); class FGEngine { diff --git a/src/FDM/UIUCModel/uiuc_1DdataFileReader.h b/src/FDM/UIUCModel/uiuc_1DdataFileReader.h index 1a2018c1a..09973ce74 100644 --- a/src/FDM/UIUCModel/uiuc_1DdataFileReader.h +++ b/src/FDM/UIUCModel/uiuc_1DdataFileReader.h @@ -1,11 +1,13 @@ #ifndef _1D_DATA_FILE_READER_H_ #define _1D_DATA_FILE_READER_H_ -#include +#include + +#include + #include "uiuc_parsefile.h" #include "uiuc_aircraft.h" - int uiuc_1DdataFileReader( string file_name, double x[100], double y[100], diff --git a/src/FDM/UIUCModel/uiuc_2DdataFileReader.h b/src/FDM/UIUCModel/uiuc_2DdataFileReader.h index c6bec85df..86a2324df 100644 --- a/src/FDM/UIUCModel/uiuc_2DdataFileReader.h +++ b/src/FDM/UIUCModel/uiuc_2DdataFileReader.h @@ -1,7 +1,10 @@ #ifndef _2D_DATA_FILE_READER_H_ #define _2D_DATA_FILE_READER_H_ -#include +#include + +#include + #include "uiuc_parsefile.h" #include "uiuc_aircraft.h" diff --git a/src/FDM/UIUCModel/uiuc_aircraft.h b/src/FDM/UIUCModel/uiuc_aircraft.h index b05a970cf..d2a5b601b 100644 --- a/src/FDM/UIUCModel/uiuc_aircraft.h +++ b/src/FDM/UIUCModel/uiuc_aircraft.h @@ -94,8 +94,11 @@ #define _AIRCRAFT_H_ #include + #include #include +#include + #include "uiuc_parsefile.h" FG_USING_STD(map); diff --git a/src/FDM/UIUCModel/uiuc_controlInput.cpp b/src/FDM/UIUCModel/uiuc_controlInput.cpp index f4b22682b..e9cfb8eee 100644 --- a/src/FDM/UIUCModel/uiuc_controlInput.cpp +++ b/src/FDM/UIUCModel/uiuc_controlInput.cpp @@ -66,7 +66,7 @@ **********************************************************************/ #include "uiuc_controlInput.h" -#include +#include void uiuc_controlInput() { diff --git a/src/FDM/UIUCModel/uiuc_controlInput.h b/src/FDM/UIUCModel/uiuc_controlInput.h index 53eadc70f..54bc05839 100644 --- a/src/FDM/UIUCModel/uiuc_controlInput.h +++ b/src/FDM/UIUCModel/uiuc_controlInput.h @@ -4,8 +4,15 @@ #include "uiuc_aircraft.h" #include "uiuc_1Dinterpolation.h" +#ifdef __cplusplus +extern "C" { +#endif + extern double Simtime; +#ifdef __cplusplus +} +#endif void uiuc_controlInput(); diff --git a/src/FDM/UIUCModel/uiuc_ice.h b/src/FDM/UIUCModel/uiuc_ice.h index 18bf1fa8c..3fc37e1fe 100644 --- a/src/FDM/UIUCModel/uiuc_ice.h +++ b/src/FDM/UIUCModel/uiuc_ice.h @@ -3,8 +3,15 @@ #include "uiuc_aircraft.h" +#ifdef __cplusplus +extern "C" { +#endif + extern double Simtime; +#ifdef __cplusplus +} +#endif void uiuc_ice_eta(); diff --git a/src/FDM/UIUCModel/uiuc_menu.cpp b/src/FDM/UIUCModel/uiuc_menu.cpp index 04af84ad6..016321056 100644 --- a/src/FDM/UIUCModel/uiuc_menu.cpp +++ b/src/FDM/UIUCModel/uiuc_menu.cpp @@ -89,8 +89,14 @@ **********************************************************************/ +#include + #include "uiuc_menu.h" -#include +#include + +FG_USING_STD(cerr); +FG_USING_STD(cout); +FG_USING_STD(endl); bool check_float(string &token) { diff --git a/src/FDM/UIUCModel/uiuc_parsefile.h b/src/FDM/UIUCModel/uiuc_parsefile.h index 8d831cba5..1dea4d449 100644 --- a/src/FDM/UIUCModel/uiuc_parsefile.h +++ b/src/FDM/UIUCModel/uiuc_parsefile.h @@ -1,12 +1,12 @@ #ifndef _PARSE_FILE_H_ #define _PARSE_FILE_H_ +#include + #include #include #include -#include - FG_USING_STD(list); FG_USING_STD(string); FG_USING_STD(ifstream); diff --git a/src/FDM/UIUCModel/uiuc_recorder.h b/src/FDM/UIUCModel/uiuc_recorder.h index b532920a5..75c262bf7 100644 --- a/src/FDM/UIUCModel/uiuc_recorder.h +++ b/src/FDM/UIUCModel/uiuc_recorder.h @@ -8,8 +8,16 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + extern double Simtime; +#ifdef __cplusplus +} +#endif + void uiuc_recorder(double dt ); #endif //_RECORDER_H diff --git a/src/FDM/UIUCModel/uiuc_warnings_errors.h b/src/FDM/UIUCModel/uiuc_warnings_errors.h index 5977b2faa..8248c00f2 100644 --- a/src/FDM/UIUCModel/uiuc_warnings_errors.h +++ b/src/FDM/UIUCModel/uiuc_warnings_errors.h @@ -1,10 +1,12 @@ #ifndef _WARNINGS_ERRORS_H_ #define _WARNINGS_ERRORS_H_ +#include + #include #include -using std::string; +FG_USING_STD(string); void uiuc_warnings_errors(int errorCode, string line); diff --git a/src/FDM/UIUCModel/uiuc_wrapper.cpp b/src/FDM/UIUCModel/uiuc_wrapper.cpp index 5867826c4..52a1e3d44 100644 --- a/src/FDM/UIUCModel/uiuc_wrapper.cpp +++ b/src/FDM/UIUCModel/uiuc_wrapper.cpp @@ -63,6 +63,8 @@ **********************************************************************/ +#include + #include "uiuc_aircraft.h" #include "uiuc_aircraftdir.h" #include "uiuc_coefficients.h" @@ -73,6 +75,9 @@ #include "uiuc_betaprobe.h" #include +FG_USING_STD(cout); +FG_USING_STD(endl); + extern "C" void uiuc_init_aeromodel (); extern "C" void uiuc_force_moment(double dt); extern "C" void uiuc_engine_routine(); diff --git a/src/FDM/flight.hxx b/src/FDM/flight.hxx index 99e916b80..c9e43e6f0 100644 --- a/src/FDM/flight.hxx +++ b/src/FDM/flight.hxx @@ -949,7 +949,7 @@ public: } inline void add_engine( FGEngInterface e ) { - return engines.push_back( e ); + engines.push_back( e ); } }; diff --git a/src/FDM/ps-10520c.cxx b/src/FDM/ps-10520c.cxx index 78ffb24a9..44c06c8f7 100644 --- a/src/FDM/ps-10520c.cxx +++ b/src/FDM/ps-10520c.cxx @@ -49,10 +49,13 @@ // INCLUDES // ------------------------------------------------------------------------ -#include -// #include +#include + +#include #include -// #include "10520c.h" + +FG_USING_STD(cout); +FG_USING_STD(endl); // ------------------------------------------------------------------------ // CODE diff --git a/src/Joystick/joystick.cxx b/src/Joystick/joystick.cxx index d0227744f..37e451fa3 100644 --- a/src/Joystick/joystick.cxx +++ b/src/Joystick/joystick.cxx @@ -21,6 +21,7 @@ // // $Id$ +#include #ifdef HAVE_CONFIG_H # include @@ -39,7 +40,8 @@ #include #include "joystick.hxx" -using std::string; +FG_USING_STD(string); +FG_USING_STD(cout); #ifdef WIN32 static const int MAX_JOYSTICKS = 2; diff --git a/src/Main/bfi.cxx b/src/Main/bfi.cxx index 9c34278ba..7199fd9ef 100644 --- a/src/Main/bfi.cxx +++ b/src/Main/bfi.cxx @@ -124,7 +124,7 @@ FGBFI::init () getRoll, setRoll); // Engine - current_properties.tieDouble("/engine0/rpm", + current_properties.tieDouble("/engines/engine0/rpm", getRPM, setRPM); // Velocities diff --git a/src/Main/save.cxx b/src/Main/save.cxx index 01a771fb1..1e0af086a 100644 --- a/src/Main/save.cxx +++ b/src/Main/save.cxx @@ -20,6 +20,7 @@ // // $Id$ +#include #ifdef HAVE_CONFIG_H # include diff --git a/src/Main/views.cxx b/src/Main/views.cxx index 23db806d4..a183a5de6 100644 --- a/src/Main/views.cxx +++ b/src/Main/views.cxx @@ -21,6 +21,7 @@ // // $Id$ +#include #ifdef HAVE_CONFIG_H # include diff --git a/src/Network/props.cxx b/src/Network/props.cxx index 25c304fd5..d97dbba9a 100644 --- a/src/Network/props.cxx +++ b/src/Network/props.cxx @@ -26,10 +26,12 @@ #include #include -#include +#include #include "props.hxx" +FG_USING_STD(cout); +FG_USING_STD(istrstream); FGProps::FGProps() { }