#include <simgear/compiler.h>
#include <simgear/structure/exception.hxx>
#include <simgear/debug/logstream.hxx>
+#include <simgear/timing/sg_time.hxx>
#include <math.h> // rint()
#include <stdio.h>
static bool
add_channel( const string& type, const string& channel_str ) {
+ // This check is neccessary to prevent fgviewer from segfaulting when given
+ // weird options. (It doesn't run the full initailization)
+ if(!globals->get_channel_options_list())
+ {
+ SG_LOG(SG_GENERAL, SG_ALERT, "Option " << type << "=" << channel_str
+ << " ignored.");
+ return false;
+ }
SG_LOG(SG_GENERAL, SG_INFO, "Channel string = " << channel_str );
globals->get_channel_options_list()->push_back( type + "," + channel_str );
return true;
}
break;
case OPTION_CHANNEL:
+ // XXX return value of add_channel should be checked?
if ( pt->has_param && !arg_value.empty() ) {
add_channel( pt->option, arg_value );
} else if ( !pt->has_param && arg_value.empty() ) {
cout << endl << "No. Device" << endl;
vector <const char*>devices = smgr.get_available_devices();
- for (int i=0; i<devices.size(); i++) {
+ for (vector <const char*>::size_type i=0; i<devices.size(); i++) {
cout << i << ". \"" << devices[i] << "\"" << endl;
}
devices.clear();