Mathias Frhlich:
I stumbled across two memory errors with two wrong const references to std::string. As I fixed that, I also moved aircraft_dir which is only used from UIUC into UIUC. With that uiuc_aircraftdir.h is empty and can be removed.
This commit is contained in:
parent
54127f7601
commit
e769f42f3b
7 changed files with 4 additions and 116 deletions
|
@ -9,7 +9,7 @@ libUIUCModel_a_SOURCES = \
|
|||
uiuc_2Dinterpolation.cpp uiuc_2Dinterpolation.h \
|
||||
uiuc_3Dinterpolation.cpp uiuc_3Dinterpolation.h \
|
||||
uiuc_aerodeflections.cpp uiuc_aerodeflections.h \
|
||||
uiuc_aircraftdir.h uiuc_aircraft.h \
|
||||
uiuc_aircraft.h \
|
||||
uiuc_alh_ap.cpp uiuc_alh_ap.h \
|
||||
uiuc_auto_pilot.cpp uiuc_auto_pilot.h \
|
||||
uiuc_betaprobe.cpp uiuc_betaprobe.h \
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
/**********************************************************************
|
||||
|
||||
FILENAME: uiuc_aircraftdir.h
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
DESCRIPTION: Stores the name of the aircraft directory to be used
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
STATUS: alpha version
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
REFERENCES:
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
HISTORY: 02/22/2000 initial release
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
AUTHOR(S): Bipin Sehgal <bsehgal@uiuc.edu>
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
VARIABLES:
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
INPUTS: *
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
OUTPUTS: *
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
CALLED BY: *
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
CALLS TO: *
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
COPYRIGHT: (C) 2000 by Michael Selig
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA or view http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#ifndef _AIRCRAFTDIR_H_
|
||||
#define _AIRCRAFTDIR_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
string aircraft_dir;
|
||||
#define aircraft_dir aircraftdir_->aircraft_dir
|
||||
|
||||
} AIRCRAFTDIR;
|
||||
|
||||
extern AIRCRAFTDIR *aircraftdir_; // usually defined in the first program that includes uiuc_aircraft.h
|
||||
|
||||
#endif // endif _AIRCRAFTDIR_H
|
|
@ -89,7 +89,6 @@
|
|||
#include <Main/fg_props.hxx>
|
||||
|
||||
#include "uiuc_aircraft.h"
|
||||
#include "uiuc_aircraftdir.h"
|
||||
#include "uiuc_coefficients.h"
|
||||
#include "uiuc_getwind.h"
|
||||
#include "uiuc_engine.h"
|
||||
|
@ -120,7 +119,6 @@ extern "C" void uiuc_network_recv_routine();
|
|||
extern "C" void uiuc_network_send_routine();
|
||||
|
||||
AIRCRAFT *aircraft_ = new AIRCRAFT;
|
||||
AIRCRAFTDIR *aircraftdir_ = new AIRCRAFTDIR;
|
||||
|
||||
// SendArray testarray(4950);
|
||||
|
||||
|
@ -321,7 +319,7 @@ void uiuc_init_aeromodel ()
|
|||
// Initializes the UIUC aircraft model.
|
||||
// Called once from uiuc_init_2_wrapper
|
||||
SGPath path(globals->get_fg_root());
|
||||
path.append(aircraft_dir);
|
||||
path.append(fgGetString("/sim/aircraft-dir"));
|
||||
path.append("aircraft.dat");
|
||||
cout << "We are using "<< path.str() << endl;
|
||||
uiuc_initializemaps(); // Initialize the <string,int> maps
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
#include <simgear/timing/lowleveltime.h>
|
||||
|
||||
#include <Aircraft/aircraft.hxx>
|
||||
#include <FDM/UIUCModel/uiuc_aircraftdir.h>
|
||||
#include <Airports/apt_loader.hxx>
|
||||
#include <Airports/runways.hxx>
|
||||
#include <Airports/simple.hxx>
|
||||
|
@ -1304,8 +1303,7 @@ void fgInitFDM() {
|
|||
}
|
||||
|
||||
double dt = 1.0 / fgGetInt("/sim/model-hz");
|
||||
aircraft_dir = fgGetString("/sim/aircraft-dir");
|
||||
const string &model = fgGetString("/sim/flight-model");
|
||||
string model = fgGetString("/sim/flight-model");
|
||||
|
||||
try {
|
||||
if ( model == "larcsim" ) {
|
||||
|
@ -1466,7 +1464,7 @@ void fgInitTimeOffset() {
|
|||
|
||||
// Okay, we now have several possible scenarios
|
||||
int offset = fgGetInt("/sim/startup/time-offset");
|
||||
const string &offset_type = fgGetString("/sim/startup/time-offset-type");
|
||||
string offset_type = fgGetString("/sim/startup/time-offset-type");
|
||||
|
||||
int warp = 0;
|
||||
if ( offset_type == "real" ) {
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include <ATC/ATCdisplay.hxx>
|
||||
#include <Aircraft/aircraft.hxx>
|
||||
#include <Time/tmp.hxx>
|
||||
#include <FDM/UIUCModel/uiuc_aircraftdir.h>
|
||||
#include <Environment/environment.hxx>
|
||||
|
||||
#include <GUI/gui.h>
|
||||
|
@ -238,26 +237,6 @@ setFreeze (bool f)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the current aircraft directory (UIUC) as a string.
|
||||
*/
|
||||
static const char *
|
||||
getAircraftDir ()
|
||||
{
|
||||
return aircraft_dir.c_str();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the current aircraft directory (UIUC).
|
||||
*/
|
||||
static void
|
||||
setAircraftDir (const char * dir)
|
||||
{
|
||||
aircraft_dir = dir;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the number of milliseconds elapsed since simulation started.
|
||||
*/
|
||||
|
@ -477,7 +456,6 @@ FGProperties::bind ()
|
|||
fgTie("/sim/logging/priority", getLoggingPriority, setLoggingPriority);
|
||||
fgTie("/sim/logging/classes", getLoggingClasses, setLoggingClasses);
|
||||
fgTie("/sim/freeze/master", getFreeze, setFreeze);
|
||||
fgTie("/sim/aircraft-dir", getAircraftDir, setAircraftDir);
|
||||
|
||||
fgTie("/sim/time/elapsed-sec", getElapsedTime_sec);
|
||||
fgTie("/sim/time/gmt", getDateString, setDateString);
|
||||
|
@ -506,7 +484,6 @@ FGProperties::unbind ()
|
|||
fgUntie("/sim/logging/priority");
|
||||
fgUntie("/sim/logging/classes");
|
||||
fgUntie("/sim/freeze/master");
|
||||
fgUntie("/sim/aircraft-dir");
|
||||
|
||||
fgUntie("/sim/time/elapsed-sec");
|
||||
fgUntie("/sim/time/gmt");
|
||||
|
|
|
@ -65,7 +65,6 @@
|
|||
#include <Sound/beacon.hxx>
|
||||
#include <Sound/morse.hxx>
|
||||
#include <FDM/flight.hxx>
|
||||
#include <FDM/UIUCModel/uiuc_aircraftdir.h>
|
||||
// #include <FDM/ADA.hxx>
|
||||
#include <ATC/ATCdisplay.hxx>
|
||||
#include <ATC/ATCmgr.hxx>
|
||||
|
@ -962,9 +961,6 @@ bool fgMainInit( int argc, char **argv ) {
|
|||
|
||||
sgUseDisplayList = fgGetBool( "/sim/rendering/use-display-list", true );
|
||||
|
||||
// Initialize the Aircraft directory to "" (UIUC)
|
||||
aircraft_dir = "";
|
||||
|
||||
// Load the configuration parameters. (Command line options
|
||||
// overrides config file options. Config file options override
|
||||
// defaults.)
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
// #include <Airports/simple.hxx>
|
||||
// #include <Cockpit/cockpit.hxx>
|
||||
// #include <FDM/flight.hxx>
|
||||
// #include <FDM/UIUCModel/uiuc_aircraftdir.h>
|
||||
|
||||
#include <Autopilot/route_mgr.hxx>
|
||||
#include <GUI/gui.h>
|
||||
|
|
Loading…
Reference in a new issue