diff --git a/Lib/Bucket/newbucket.cxx b/Lib/Bucket/newbucket.cxx index bb6f8bb9a..20d980b92 100644 --- a/Lib/Bucket/newbucket.cxx +++ b/Lib/Bucket/newbucket.cxx @@ -28,6 +28,8 @@ #endif +#include + #include #include "newbucket.hxx" diff --git a/Lib/Misc/fgstream.cxx b/Lib/Misc/fgstream.cxx index 3d5a09339..a7203de2c 100644 --- a/Lib/Misc/fgstream.cxx +++ b/Lib/Misc/fgstream.cxx @@ -118,18 +118,29 @@ skipws( istream& in ) { while ( in.get(c) ) { #ifdef __MWERKS__ + // -dw- for unix file compatibility // -clo- this causes problems for unix if ( (c == '\n') || (c == '\r') || (c == '\0') ) { break; - } -#endif + } + + if ( ! isspace( c ) && c != '\n' ) { + // put pack the non-space character + in.putback(c); + break; + } + +#else if ( ! isspace( c ) ) { // put pack the non-space character in.putback(c); break; } + +#endif + } return in; } diff --git a/Lib/XGL/xglUtils.c b/Lib/XGL/xglUtils.c index 56da16522..d781fa23f 100644 --- a/Lib/XGL/xglUtils.c +++ b/Lib/XGL/xglUtils.c @@ -7,7 +7,7 @@ #include #include -#if !defined( __CYGWIN__ ) && !defined( __CYGWIN32__ ) +#if !defined( WIN32 ) # if !defined( HAVE_STL_SGI_PORT ) && !defined( __MWERKS__ ) // Avoid malloc with STLport and MSL # include @@ -28,12 +28,7 @@ int xglTraceOn = TRUE ; -#ifndef WIN32 - FILE *xglTraceFd = stdout ; -#else /* WIN32 */ - /* Bail for now, we just want it to compile I guess */ - FILE *xglTraceFd = NULL; -#endif /* WIN32 */ +FILE *xglTraceFd = NULL; struct GLenumLookup { diff --git a/Simulator/Airports/simple.cxx b/Simulator/Airports/simple.cxx index 1e5d9a694..f9411a198 100644 --- a/Simulator/Airports/simple.cxx +++ b/Simulator/Airports/simple.cxx @@ -27,6 +27,7 @@ #include #include +#include #include #include
@@ -46,13 +47,15 @@ int fgAIRPORTS::load( const string& file ) { fgAIRPORT a; // build the path name to the airport file - string path = current_options.get_fg_root() + "/Airports/" + file; + FGPath path( current_options.get_fg_root() ); + path.append( "Airports" ); + path.append( file ); airports.erase( airports.begin(), airports.end() ); - fg_gzifstream in( path ); - if ( !in ) { - FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path ); + fg_gzifstream in( path.str() ); + if ( !in.is_open() ) { + FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << path.str() ); exit(-1); } @@ -65,14 +68,29 @@ int fgAIRPORTS::load( const string& file ) { */ // read in each line of the file + +#ifdef __MWERKS__ + in >> skipcomment; - while ( ! in.eof() ) - { + char c = 0; + while ( in.get(c) && c != '\0' ) { + in.putback(c); in >> a; airports.insert(a); in >> skipcomment; } +#else + + in >> skipcomment; + while ( ! in.eof() ) { + in >> a; + airports.insert(a); + in >> skipcomment; + } + +#endif + return 1; } diff --git a/Simulator/Cockpit/hud.hxx b/Simulator/Cockpit/hud.hxx index cb1c6afc3..079139e29 100644 --- a/Simulator/Cockpit/hud.hxx +++ b/Simulator/Cockpit/hud.hxx @@ -233,20 +233,10 @@ extern float HUD_matrix[16]; class fgText { private: - char msg[32]; float x, y; + char msg[32]; public: - // note to Norman from Curt. You had two constructors here that - // have defaults values for all parameters. So, if a constructor - // is called with no parameters, which is chosen? For the second, - // I've removed the default value for x which fixes the problem. - // However, it might be best to just delete the second redundant - // constructor, and fix the constructor variable ordering - // throughout the rest of the code. - fgText( char *c = NULL, float x = 0, float y =0 ) - : x(x), y(y) {strncpy(msg,c,32-1);} - - fgText( float x, float y = 0, char *c = NULL ) + fgText( float x = 0, float y = 0, char *c = NULL ) : x(x), y(y) {strncpy(msg,c,32-1);} fgText( const fgText & image ) @@ -441,7 +431,7 @@ class instr_item { // An Abstract Base Class (ABC) } void TextString( char *msg, float x, float y ) { - HUD_TextList.add(fgText(msg, x, y)); + HUD_TextList.add(fgText(x, y, msg)); } int getStringWidth ( char *str ) {