From 429f2530de08f922d62fcfeade85740569e04768 Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 29 Jul 2008 08:27:48 +0000 Subject: [PATCH] James Turner: * experimental clean-up / reduction on two of the FG headers: (I'm going to await feedback on the developers list before doing more of these, to avoiding going over files multiple times, but in principle it seems pretty straightforward.) * final fixes for SG_USING_STD removal --- src/Aircraft/aircraft.cxx | 5 +++-- src/Aircraft/aircraft.hxx | 16 ++++------------ src/Aircraft/controls.cxx | 3 +++ src/Aircraft/controls.hxx | 8 -------- src/Environment/environment_mgr.cxx | 1 + src/FDM/SP/Balloon.cxx | 3 ++- src/FDM/SP/Balloon.h | 1 - src/FDM/UIUCModel/uiuc_gear.cpp | 5 ----- src/FDM/UIUCModel/uiuc_warnings_errors.cpp | 6 +++--- src/FDM/UIUCModel/uiuc_wrapper.cpp | 7 +++---- src/Instrumentation/HUD/HUD_runway.cxx | 2 ++ src/Instrumentation/navradio.cxx | 1 + src/Main/fg_init.cxx | 1 + src/Main/fg_props.cxx | 2 ++ src/Main/globals.hxx | 4 ++-- src/Main/main.cxx | 2 +- src/Navaids/navdb.cxx | 2 +- src/Network/joyclient.cxx | 3 ++- src/Traffic/Schedule.cxx | 2 +- tests/test-up.cxx | 4 ++-- utils/GPSsmooth/MIDG-II.cxx | 4 ++-- utils/GPSsmooth/MIDG-II.hxx | 8 ++++---- utils/GPSsmooth/MIDG_main.cxx | 6 +++--- utils/GPSsmooth/UGear.cxx | 4 ++-- utils/GPSsmooth/UGear.hxx | 8 ++++---- utils/GPSsmooth/UGear_command.hxx | 8 ++++---- utils/GPSsmooth/UGear_main.cxx | 6 +++--- utils/GPSsmooth/gps.cxx | 4 ++-- utils/GPSsmooth/gps.hxx | 8 ++++---- utils/GPSsmooth/gps_main.cxx | 6 +++--- utils/TerraSync/terrasync.cxx | 6 +++--- 31 files changed, 68 insertions(+), 78 deletions(-) diff --git a/src/Aircraft/aircraft.cxx b/src/Aircraft/aircraft.cxx index 7bafb99ae..60b5eb311 100644 --- a/src/Aircraft/aircraft.cxx +++ b/src/Aircraft/aircraft.cxx @@ -24,8 +24,8 @@ # include "config.h" #endif -#include -#include // strdup +#include +#include // strdup #include @@ -36,6 +36,7 @@ #include #include
+#include
#include
#include
#include diff --git a/src/Aircraft/aircraft.hxx b/src/Aircraft/aircraft.hxx index 6ca0c5d8a..95763b017 100644 --- a/src/Aircraft/aircraft.hxx +++ b/src/Aircraft/aircraft.hxx @@ -25,18 +25,10 @@ #ifndef _AIRCRAFT_HXX #define _AIRCRAFT_HXX - - -#ifndef __cplusplus -# error This library requires C++ -#endif - - -#include -#include
- -#include "controls.hxx" - + +class FGInterface; +class FGControls; +class SGPropertyNode; // Define a structure containing all the parameters for an aircraft typedef struct{ diff --git a/src/Aircraft/controls.cxx b/src/Aircraft/controls.cxx index 150dbf296..2e3da344c 100644 --- a/src/Aircraft/controls.cxx +++ b/src/Aircraft/controls.cxx @@ -20,6 +20,9 @@ // // $Id$ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include #include diff --git a/src/Aircraft/controls.hxx b/src/Aircraft/controls.hxx index bd1717055..d9ea286f7 100644 --- a/src/Aircraft/controls.hxx +++ b/src/Aircraft/controls.hxx @@ -24,16 +24,8 @@ #ifndef _CONTROLS_HXX #define _CONTROLS_HXX -#include #include -#include
- -#ifndef __cplusplus -# error This library requires C++ -#endif - - // Define a structure containing the control parameters class FGControls : public SGSubsystem diff --git a/src/Environment/environment_mgr.cxx b/src/Environment/environment_mgr.cxx index 98178b5b2..5440ba253 100644 --- a/src/Environment/environment_mgr.cxx +++ b/src/Environment/environment_mgr.cxx @@ -31,6 +31,7 @@ #include
#include
#include +#include #include "environment.hxx" #include "environment_ctrl.hxx" diff --git a/src/FDM/SP/Balloon.cxx b/src/FDM/SP/Balloon.cxx index 62e4903b2..f97348c89 100644 --- a/src/FDM/SP/Balloon.cxx +++ b/src/FDM/SP/Balloon.cxx @@ -50,12 +50,13 @@ HISTORY #include #include -#include #include
#include
+#include #include "Balloon.h" + /****************************************************************************/ /********************************** CODE ************************************/ /****************************************************************************/ diff --git a/src/FDM/SP/Balloon.h b/src/FDM/SP/Balloon.h index 869b20a19..5b132f420 100644 --- a/src/FDM/SP/Balloon.h +++ b/src/FDM/SP/Balloon.h @@ -42,7 +42,6 @@ HISTORY /* INCLUDES */ /****************************************************************************/ -#include #include #include "BalloonSim.h" diff --git a/src/FDM/UIUCModel/uiuc_gear.cpp b/src/FDM/UIUCModel/uiuc_gear.cpp index 85f30df4d..f05c6211f 100644 --- a/src/FDM/UIUCModel/uiuc_gear.cpp +++ b/src/FDM/UIUCModel/uiuc_gear.cpp @@ -72,11 +72,6 @@ #include "uiuc_gear.h" - - -using std::cerr; - - #define HEIGHT_AGL_WHEEL d_wheel_rwy_local_v[2] diff --git a/src/FDM/UIUCModel/uiuc_warnings_errors.cpp b/src/FDM/UIUCModel/uiuc_warnings_errors.cpp index c16266c14..50866ad14 100644 --- a/src/FDM/UIUCModel/uiuc_warnings_errors.cpp +++ b/src/FDM/UIUCModel/uiuc_warnings_errors.cpp @@ -78,11 +78,11 @@ Prints to screen the follow: #include "uiuc_warnings_errors.h" -SG_USING_STD (cerr); -SG_USING_STD (endl); +using std::cerr; +using std::endl; #ifndef _MSC_VER -SG_USING_STD (exit); +using std::exit; #endif void uiuc_warnings_errors(int errorCode, std::string line) diff --git a/src/FDM/UIUCModel/uiuc_wrapper.cpp b/src/FDM/UIUCModel/uiuc_wrapper.cpp index 35ed164d4..c11cbc97e 100644 --- a/src/FDM/UIUCModel/uiuc_wrapper.cpp +++ b/src/FDM/UIUCModel/uiuc_wrapper.cpp @@ -82,6 +82,8 @@ # include #endif +#include + #include #include #include @@ -102,9 +104,6 @@ //#include "uiuc_network.h" #include "uiuc_get_flapper.h" -using std::cout; -using std::endl; - extern "C" void uiuc_initial_init (); extern "C" void uiuc_defaults_inits (); extern "C" void uiuc_vel_init (); @@ -323,7 +322,7 @@ void uiuc_init_aeromodel () SGPath path(globals->get_fg_root()); path.append(fgGetString("/sim/aircraft-dir")); path.append("aircraft.dat"); - cout << "We are using "<< path.str() << endl; + std::cout << "We are using "<< path.str() << std::endl; uiuc_initializemaps(); // Initialize the maps uiuc_menu(path.str()); // Read the specified aircraft file } diff --git a/src/Instrumentation/HUD/HUD_runway.cxx b/src/Instrumentation/HUD/HUD_runway.cxx index 67d4b857d..434b73c2e 100644 --- a/src/Instrumentation/HUD/HUD_runway.cxx +++ b/src/Instrumentation/HUD/HUD_runway.cxx @@ -31,6 +31,8 @@ #include
#include #include +#include +#include #include #include #include
diff --git a/src/Instrumentation/navradio.cxx b/src/Instrumentation/navradio.cxx index a208a14d6..dc9c094b9 100644 --- a/src/Instrumentation/navradio.cxx +++ b/src/Instrumentation/navradio.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 29134738a..15e3caaa3 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -62,6 +62,7 @@ #include #include +#include #include #include #include diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index f4b410a70..8ed56f001 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -36,6 +36,8 @@ #include #include +#include + #include