From 02a757f9e670e8036169145ff289b24081f703e8 Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 18 Feb 2005 10:16:30 +0000 Subject: [PATCH] MSVC (warning) fixes. --- src/AIModel/AIAircraft.cxx | 4 ++++ src/AIModel/AIFlightPlanCreate.cxx | 2 +- src/Airports/simple.cxx | 22 ++++++++++++++-------- src/FDM/YASim/Gear.hpp | 2 +- src/FDM/YASim/Hook.hpp | 2 +- src/FDM/YASim/Launchbar.hpp | 2 +- src/Traffic/TrafficMgr.cxx | 2 ++ 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index da2159b21..80c0879d3 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -33,6 +33,10 @@ #include #include #include +#ifdef _MSC_VER +# include +# define finite _finite +#endif SG_USING_STD(string); diff --git a/src/AIModel/AIFlightPlanCreate.cxx b/src/AIModel/AIFlightPlanCreate.cxx index f800f52ca..f5455effe 100644 --- a/src/AIModel/AIFlightPlanCreate.cxx +++ b/src/AIModel/AIFlightPlanCreate.cxx @@ -18,7 +18,7 @@ * * **************************************************************************/ -#include +#include "AIFlightPlan.hxx" #include #include diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 5c74391b4..6c1e71194 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -28,7 +28,11 @@ # include #endif +#ifdef _MSC_VER +# define _USE_MATH_DEFINES +#endif #include +#include #include #include @@ -45,7 +49,7 @@ #include "simple.hxx" -SG_USING_NAMESPACE(std); +SG_USING_STD(sort); /****************************************************************************** * ScheduleTime @@ -192,6 +196,7 @@ RunwayGroup& RunwayGroup:: operator= (const RunwayGroup &other) choice[0] = other.choice[0]; choice[1] = other.choice[1]; nrActive = other.nrActive; + return *this; } void RunwayGroup::setActive(string aptId, @@ -399,6 +404,7 @@ ScheduleTime *FGRunwayPreference::getSchedule(const char *trafficType) if (!(strcmp(trafficType, "mil"))) { return &milTimes; } + return 0; } RunwayGroup *FGRunwayPreference::getGroup(const string groupName) @@ -620,16 +626,16 @@ FGAirport::FGAirport(const FGAirport& other) _elevation = other._elevation; _name = other._name; _has_metar = other._has_metar; - for (FGParkingVecConstIterator i= other.parkings.begin(); i != other.parkings.end(); i++) - parkings.push_back(*(i)); + for (FGParkingVecConstIterator ip= other.parkings.begin(); ip != other.parkings.end(); ip++) + parkings.push_back(*(ip)); rwyPrefs = other.rwyPrefs; lastUpdate = other.lastUpdate; - stringVecConstIterator i; - for (i = other.landing.begin(); i != other.landing.end(); i++) - landing.push_back(*i); - for (i = other.takeoff.begin(); i != other.takeoff.end(); i++) - takeoff.push_back(*i); + stringVecConstIterator il; + for (il = other.landing.begin(); il != other.landing.end(); il++) + landing.push_back(*il); + for (il = other.takeoff.begin(); il != other.takeoff.end(); il++) + takeoff.push_back(*il); lastUpdate = other.lastUpdate; for (int i = 0; i < 10; i++) { diff --git a/src/FDM/YASim/Gear.hpp b/src/FDM/YASim/Gear.hpp index dc9a4ed35..a042d26e5 100644 --- a/src/FDM/YASim/Gear.hpp +++ b/src/FDM/YASim/Gear.hpp @@ -4,7 +4,7 @@ namespace yasim { class RigidBody; -class State; +struct State; // A landing gear has the following parameters: // diff --git a/src/FDM/YASim/Hook.hpp b/src/FDM/YASim/Hook.hpp index 591798722..028a86680 100644 --- a/src/FDM/YASim/Hook.hpp +++ b/src/FDM/YASim/Hook.hpp @@ -5,7 +5,7 @@ namespace yasim { class Ground; class RigidBody; -class State; +struct State; // A landing hook has the following parameters: // diff --git a/src/FDM/YASim/Launchbar.hpp b/src/FDM/YASim/Launchbar.hpp index dcdcb8a71..06b7bfab7 100644 --- a/src/FDM/YASim/Launchbar.hpp +++ b/src/FDM/YASim/Launchbar.hpp @@ -5,7 +5,7 @@ namespace yasim { class Ground; class RigidBody; -class State; +struct State; // A launchbar has the following parameters: // diff --git a/src/Traffic/TrafficMgr.cxx b/src/Traffic/TrafficMgr.cxx index cf2fa5980..b1265bffc 100644 --- a/src/Traffic/TrafficMgr.cxx +++ b/src/Traffic/TrafficMgr.cxx @@ -41,6 +41,7 @@ #include #include +#include #include @@ -63,6 +64,7 @@ #include "TrafficMgr.hxx" +SG_USING_STD(sort); /****************************************************************************** * TrafficManager -- 2.39.5