From e333080388fe1290ce3dc553046d74928801f257 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 13 Dec 2000 23:02:02 +0000 Subject: [PATCH] MacOS changes contributed by Darrell Walisser (12/13/2000) --- src/FDM/10520d.hxx | 2 +- src/FDM/ADA.hxx | 2 +- src/FDM/LaRCsim/c172_gear.c | 17 ++++++++++------- src/FDM/LaRCsim/uiuc_aero.c | 14 +++++++------- src/FDM/LaRCsimIC.cxx | 6 ++++++ src/FDM/UIUCModel/uiuc_1DdataFileReader.h | 2 ++ src/FDM/UIUCModel/uiuc_2DdataFileReader.h | 2 ++ src/FDM/UIUCModel/uiuc_menu.cpp | 11 ++++++++++- src/FDM/UIUCModel/uiuc_recorder.cpp | 2 ++ src/FDM/UIUCModel/uiuc_warnings_errors.cpp | 6 ++++++ src/Joystick/joystick.cxx | 5 +++++ src/Main/main.cxx | 12 ++++-------- src/Scenery/newcache.hxx | 4 ++-- src/Scenery/tilemgr.cxx | 2 +- src/Scenery/tilemgr.hxx | 2 +- 15 files changed, 60 insertions(+), 29 deletions(-) diff --git a/src/FDM/10520d.hxx b/src/FDM/10520d.hxx index 954c6e436..2b2c23889 100644 --- a/src/FDM/10520d.hxx +++ b/src/FDM/10520d.hxx @@ -139,4 +139,4 @@ public: }; -#endif _10520D_HXX_ +#endif // _10520D_HXX_ diff --git a/src/FDM/ADA.hxx b/src/FDM/ADA.hxx index 7ba2e9f0f..2ca68464b 100644 --- a/src/FDM/ADA.hxx +++ b/src/FDM/ADA.hxx @@ -23,7 +23,7 @@ #include -#include "flight.hxx" +#include class FGADA: public FGInterface { diff --git a/src/FDM/LaRCsim/c172_gear.c b/src/FDM/LaRCsim/c172_gear.c index 39c7164ae..353a5683c 100644 --- a/src/FDM/LaRCsim/c172_gear.c +++ b/src/FDM/LaRCsim/c172_gear.c @@ -36,6 +36,9 @@ $Header$ $Log$ +Revision 1.18 2000/12/13 22:02:02 curt +MacOS changes contributed by Darrell Walisser (12/13/2000) + Revision 1.17 2000/09/14 15:36:25 curt Tweaks to ground steering sensitivity. @@ -95,47 +98,47 @@ Updates from Tony. #define HEIGHT_AGL_WHEEL d_wheel_rwy_local_v[2] -static sub3( DATA v1[], DATA v2[], DATA result[] ) +static void sub3( DATA v1[], DATA v2[], DATA result[] ) { result[0] = v1[0] - v2[0]; result[1] = v1[1] - v2[1]; result[2] = v1[2] - v2[2]; } -static add3( DATA v1[], DATA v2[], DATA result[] ) +static void add3( DATA v1[], DATA v2[], DATA result[] ) { result[0] = v1[0] + v2[0]; result[1] = v1[1] + v2[1]; result[2] = v1[2] + v2[2]; } -static cross3( DATA v1[], DATA v2[], DATA result[] ) +static void cross3( DATA v1[], DATA v2[], DATA result[] ) { result[0] = v1[1]*v2[2] - v1[2]*v2[1]; result[1] = v1[2]*v2[0] - v1[0]*v2[2]; result[2] = v1[0]*v2[1] - v1[1]*v2[0]; } -static multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] ) +static void multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] ) { result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2]; result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2]; result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2]; } -static mult3x3by3( DATA m[][3], DATA v[], DATA result[] ) +static void mult3x3by3( DATA m[][3], DATA v[], DATA result[] ) { result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2]; result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2]; result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2]; } -static clear3( DATA v[] ) +static void clear3( DATA v[] ) { v[0] = 0.; v[1] = 0.; v[2] = 0.; } -c172_gear() +void c172_gear() { char rcsid[] = "$Id$"; #define NUM_WHEELS 4 diff --git a/src/FDM/LaRCsim/uiuc_aero.c b/src/FDM/LaRCsim/uiuc_aero.c index e33c3b8c1..2aec73867 100644 --- a/src/FDM/LaRCsim/uiuc_aero.c +++ b/src/FDM/LaRCsim/uiuc_aero.c @@ -81,47 +81,47 @@ void uiuc_engine( SCALAR dt, int Initialize ) * added later and the choice of the gear model could be specified at * runtime. * ***********************************************************************/ -static sub3( DATA v1[], DATA v2[], DATA result[] ) +static void sub3( DATA v1[], DATA v2[], DATA result[] ) { result[0] = v1[0] - v2[0]; result[1] = v1[1] - v2[1]; result[2] = v1[2] - v2[2]; } -static add3( DATA v1[], DATA v2[], DATA result[] ) +static void add3( DATA v1[], DATA v2[], DATA result[] ) { result[0] = v1[0] + v2[0]; result[1] = v1[1] + v2[1]; result[2] = v1[2] + v2[2]; } -static cross3( DATA v1[], DATA v2[], DATA result[] ) +static void cross3( DATA v1[], DATA v2[], DATA result[] ) { result[0] = v1[1]*v2[2] - v1[2]*v2[1]; result[1] = v1[2]*v2[0] - v1[0]*v2[2]; result[2] = v1[0]*v2[1] - v1[1]*v2[0]; } -static multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] ) +static void multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] ) { result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2]; result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2]; result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2]; } -static mult3x3by3( DATA m[][3], DATA v[], DATA result[] ) +static void mult3x3by3( DATA m[][3], DATA v[], DATA result[] ) { result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2]; result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2]; result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2]; } -static clear3( DATA v[] ) +static void clear3( DATA v[] ) { v[0] = 0.; v[1] = 0.; v[2] = 0.; } -uiuc_gear() +void uiuc_gear() { char rcsid[] = "$Id$"; diff --git a/src/FDM/LaRCsimIC.cxx b/src/FDM/LaRCsimIC.cxx index 872106d07..e525b4333 100644 --- a/src/FDM/LaRCsimIC.cxx +++ b/src/FDM/LaRCsimIC.cxx @@ -25,6 +25,8 @@ */ +#include + #include #include @@ -36,6 +38,10 @@ #include #include +FG_USING_STD(cout); +FG_USING_STD(endl); + + LaRCsimIC::LaRCsimIC(void) { vt=vtg=vw=vc=ve=0; mach=0; diff --git a/src/FDM/UIUCModel/uiuc_1DdataFileReader.h b/src/FDM/UIUCModel/uiuc_1DdataFileReader.h index 09973ce74..f566933a8 100644 --- a/src/FDM/UIUCModel/uiuc_1DdataFileReader.h +++ b/src/FDM/UIUCModel/uiuc_1DdataFileReader.h @@ -8,6 +8,8 @@ #include "uiuc_parsefile.h" #include "uiuc_aircraft.h" +FG_USING_STD(istrstream); + 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 86a2324df..dea205d92 100644 --- a/src/FDM/UIUCModel/uiuc_2DdataFileReader.h +++ b/src/FDM/UIUCModel/uiuc_2DdataFileReader.h @@ -8,6 +8,8 @@ #include "uiuc_parsefile.h" #include "uiuc_aircraft.h" +FG_USING_STD(istrstream); + void uiuc_2DdataFileReader( string file_name, double x[100][100], double y[100], diff --git a/src/FDM/UIUCModel/uiuc_menu.cpp b/src/FDM/UIUCModel/uiuc_menu.cpp index 016321056..a59cd3f4b 100644 --- a/src/FDM/UIUCModel/uiuc_menu.cpp +++ b/src/FDM/UIUCModel/uiuc_menu.cpp @@ -91,12 +91,21 @@ #include -#include "uiuc_menu.h" +#if defined( __MWERKS__ ) +// -dw- optimizer chokes (big-time) trying to optimize humongous +// loop/switch statements +#pragma optimization_level 0 +#endif + +#include #include +#include "uiuc_menu.h" + FG_USING_STD(cerr); FG_USING_STD(cout); FG_USING_STD(endl); +FG_USING_STD(exit); bool check_float(string &token) { diff --git a/src/FDM/UIUCModel/uiuc_recorder.cpp b/src/FDM/UIUCModel/uiuc_recorder.cpp index f5a5998cf..91329fa4e 100644 --- a/src/FDM/UIUCModel/uiuc_recorder.cpp +++ b/src/FDM/UIUCModel/uiuc_recorder.cpp @@ -72,6 +72,8 @@ #include "uiuc_recorder.h" +FG_USING_STD(endl); // -dw + void uiuc_recorder( double dt ) { stack command_list; diff --git a/src/FDM/UIUCModel/uiuc_warnings_errors.cpp b/src/FDM/UIUCModel/uiuc_warnings_errors.cpp index e6b015ebf..516bd7698 100644 --- a/src/FDM/UIUCModel/uiuc_warnings_errors.cpp +++ b/src/FDM/UIUCModel/uiuc_warnings_errors.cpp @@ -74,8 +74,14 @@ for information. USA or view http://www.gnu.org/copyleft/gpl.html. **********************************************************************/ +#include + #include "uiuc_warnings_errors.h" +FG_USING_STD (cerr); +FG_USING_STD (endl); +FG_USING_STD (exit); + void uiuc_warnings_errors(int errorCode, string line) { switch (errorCode) diff --git a/src/Joystick/joystick.cxx b/src/Joystick/joystick.cxx index 37e451fa3..17f0b203e 100644 --- a/src/Joystick/joystick.cxx +++ b/src/Joystick/joystick.cxx @@ -113,8 +113,13 @@ struct button { struct joystick { virtual ~joystick () { delete js; +#ifndef macintosh delete axes; delete buttons; +#else + delete[] axes; + delete[] buttons; +#endif } int naxes; int nbuttons; diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 52584307e..899a57499 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -123,12 +123,8 @@ int objc=0; #include "keyboard.hxx" #include "splash.hxx" -// -dw- use custom sioux settings so I can see output window #ifdef macintosh -# ifndef FG_NDEBUG -# include // settings for output window -# endif -# include +# include // -dw- for command line dialog #endif @@ -452,7 +448,7 @@ void fgRenderFrame( void ) { // ssg does to set up the model view matrix glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - ssgSetCamera( (sgMat4)globals->get_current_view()->get_VIEW() ); + ssgSetCamera( (sgVec4 *)globals->get_current_view()->get_VIEW() ); // set the opengl state to known default values default_state->force(); @@ -1274,7 +1270,7 @@ int fgGlutInit( int *argc, char **argv ) { general.set_glVersion( (char *)glGetString ( GL_VERSION ) ); FG_LOG( FG_GENERAL, FG_INFO, general.get_glRenderer() ); - int tmp; + GLint tmp; glGetIntegerv( GL_MAX_TEXTURE_SIZE, &tmp ); general.set_glMaxTexSize( tmp ); FG_LOG ( FG_GENERAL, FG_INFO, "Max texture size = " << tmp ); @@ -1685,7 +1681,7 @@ void fgLoadDCS(void) { char c; while ( ! in.eof() ) { - in >> skipws; + in >> ::skipws; if ( in.get( c ) && c == '#' ) { in >> skipeol; diff --git a/src/Scenery/newcache.hxx b/src/Scenery/newcache.hxx index 20272b983..68632a237 100644 --- a/src/Scenery/newcache.hxx +++ b/src/Scenery/newcache.hxx @@ -68,7 +68,7 @@ class FGNewCache { tile_map_iterator current; // Free a tile cache entry - void FGNewCache::entry_free( long cache_index ); + void entry_free( long cache_index ); public: @@ -85,7 +85,7 @@ public: bool exists( const SGBucket& b ); // Ensure at least one entry is free in the cache - void FGNewCache::make_space(); + void make_space(); // Fill in a tile cache entry with real data for the specified bucket void fill_in( const SGBucket& b ); diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 5bc82ddbc..08a6c0e37 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -313,7 +313,7 @@ int FGTileMgr::update( double lon, double lat ) { } if ( state == Running ) { - if( current_bucket != previous_bucket) { + if ( !(current_bucket == previous_bucket) ) { // We've moved to a new bucket, we need to schedule any // needed tiles for loading. schedule_needed(); diff --git a/src/Scenery/tilemgr.hxx b/src/Scenery/tilemgr.hxx index 97b4bf3fc..05d6748a8 100644 --- a/src/Scenery/tilemgr.hxx +++ b/src/Scenery/tilemgr.hxx @@ -84,7 +84,7 @@ private: void load_tile( const SGBucket& b ); // schedule a needed buckets for loading - void FGTileMgr::schedule_needed(); + void schedule_needed(); // see comment at prep_ssg_nodes() void prep_ssg_node( int idx );