1
0
Fork 0

Fix a problem where older IRIX compilers needed a typecast for certain opperations

This commit is contained in:
ehofman 2003-10-16 14:14:03 +00:00
parent cd4263f333
commit 0e370e6e28
12 changed files with 23 additions and 20 deletions

View file

@ -168,7 +168,7 @@ bool FGAILocalTraffic::Init(string ICAO, OperatingState initialState, PatternLeg
AirportATC a; AirportATC a;
if(ATC->GetAirportATCDetails(airportID, &a)) { if(ATC->GetAirportATCDetails(airportID, &a)) {
if(a.tower_freq) { // Has a tower if(a.tower_freq) { // Has a tower
tower = (FGTower*)ATC->GetATCPointer((string)airportID, TOWER); // Maybe need some error checking here tower = (FGTower*)ATC->GetATCPointer(airportID, TOWER); // Maybe need some error checking here
if(tower == NULL) { if(tower == NULL) {
// Something has gone wrong - abort or carry on with un-towered operation? // Something has gone wrong - abort or carry on with un-towered operation?
return(false); return(false);

View file

@ -18,6 +18,8 @@
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <simgear/compiler.h>
#include <simgear/structure/commands.hxx> #include <simgear/structure/commands.hxx>
#include <Main/globals.hxx> #include <Main/globals.hxx>
@ -337,7 +339,7 @@ void FGATCDialog::DoDialog() {
string dum; string dum;
sprintf( buf, "%i", kk+1 ); sprintf( buf, "%i", kk+1 );
buf[1] = '\0'; buf[1] = '\0';
dum = (string)(buf); dum = buf;
mentry[kk] = dum + ". " + current->menuentry; mentry[kk] = dum + ". " + current->menuentry;
optList[kk] = new char[strlen(mentry[kk].c_str()) + 1]; optList[kk] = new char[strlen(mentry[kk].c_str()) + 1];
strcpy(optList[kk], mentry[kk].c_str()); strcpy(optList[kk], mentry[kk].c_str());
@ -523,7 +525,8 @@ void FGATCDialog::FreqDisplay(string ident) {
if((*itr).ident == ident) { if((*itr).ident == ident) {
if((*itr).type != INVALID) { if((*itr).type != INVALID) {
ostr << (*itr).type; ostr << (*itr).type;
freqs[n] = ostr.str() + " - "; freqs[n] = ostr.str();
freqs[n].append(" - ");
sprintf(buf, "%.2f", ((*itr).freq / 100.0)); // Convert from KHz to MHz sprintf(buf, "%.2f", ((*itr).freq / 100.0)); // Convert from KHz to MHz
// Hack alert! // Hack alert!
if(buf[5] == '3') buf[5] = '2'; if(buf[5] == '3') buf[5] = '2';

View file

@ -270,13 +270,13 @@ bool FGATCMgr::CommRegisterAirport(string ident, int chan, atc_type tp) {
// Note that chan is zero based. // Note that chan is zero based.
void FGATCMgr::CommRemoveFromList(const char* id, atc_type tp, int chan) { void FGATCMgr::CommRemoveFromList(const char* id, atc_type tp, int chan) {
SG_LOG(SG_ATC, SG_BULK, "CommRemoveFromList called for airport " << id << " " << tp << " by channel " << chan); SG_LOG(SG_ATC, SG_BULK, "CommRemoveFromList called for airport " << id << " " << tp << " by channel " << chan);
if(airport_atc_map.find((string)id) != airport_atc_map.end()) { if(airport_atc_map.find(id) != airport_atc_map.end()) {
AirportATC* a = airport_atc_map[(string)id]; AirportATC* a = airport_atc_map[id];
//cout << "In CommRemoveFromList, a->ground_freq = " << a->ground_freq << endl; //cout << "In CommRemoveFromList, a->ground_freq = " << a->ground_freq << endl;
if(a->set_by_AI && tp != ATIS) { if(a->set_by_AI && tp != ATIS) {
// Set by AI, so don't remove simply because user isn't tuned in any more - just stop displaying // Set by AI, so don't remove simply because user isn't tuned in any more - just stop displaying
SG_LOG(SG_ATC, SG_BULK, "In CommRemoveFromList, service was set by AI\n"); SG_LOG(SG_ATC, SG_BULK, "In CommRemoveFromList, service was set by AI\n");
FGATC* aptr = GetATCPointer((string)id, tp); FGATC* aptr = GetATCPointer(id, tp);
switch(chan) { switch(chan) {
case 0: case 0:
//cout << "chan 1\n"; //cout << "chan 1\n";
@ -302,7 +302,7 @@ void FGATCMgr::CommRemoveFromList(const char* id, atc_type tp, int chan) {
} }
break; break;
} }
airport_atc_map[(string)id] = a; airport_atc_map[id] = a;
return; return;
} else { } else {
switch(chan) { switch(chan) {

View file

@ -261,7 +261,7 @@ void FGATIS::UpdateTransmission() {
#endif #endif
string rwy_no = globals->get_runways()->search(ident, int(hdg)); string rwy_no = globals->get_runways()->search(ident, int(hdg));
if(rwy_no != (string)"NN") { if(rwy_no != "NN") {
transmission += " / Landing_and_departing_runway "; transmission += " / Landing_and_departing_runway ";
transmission += ConvertRwyNumToSpokenString(atoi(rwy_no.c_str())); transmission += ConvertRwyNumToSpokenString(atoi(rwy_no.c_str()));
//cout << "in atis.cxx, r.rwy_no = " << rwy_no << " r.id = " << r->id << " r.heading = " << r->heading << endl; //cout << "in atis.cxx, r.rwy_no = " << rwy_no << " r.id = " << r->id << " r.heading = " << r->heading << endl;

View file

@ -126,7 +126,7 @@ static string GetReverseRunwayNo(string rwyno) {
<< rwyno << " passed to GetReverseRunwayNo(...)"); << rwyno << " passed to GetReverseRunwayNo(...)");
} }
} }
return((string)buf); return(buf);
} }

View file

@ -114,7 +114,7 @@ ADF::update (double delta_time_sec)
// If it's off, don't bother. // If it's off, don't bother.
string mode = _mode_node->getStringValue(); string mode = _mode_node->getStringValue();
if (!_transmitter_valid || (mode != string("bfo") && mode != string("adf"))) if (!_transmitter_valid || (mode != "bfo" && mode != "adf"))
{ {
set_bearing(delta_time_sec, 90); set_bearing(delta_time_sec, 90);
_ident_node->setStringValue(""); _ident_node->setStringValue("");

View file

@ -243,7 +243,7 @@ void FGMultiplayRxMgr::ProcessData(void) {
sCallsign = MsgHdr->sCallsign; sCallsign = MsgHdr->sCallsign;
// Process the player data unless we generated it // Process the player data unless we generated it
if (m_sCallsign != string(MsgHdr->sCallsign)) { if (m_sCallsign != MsgHdr->sCallsign) {
// Process messages // Process messages
@ -283,7 +283,7 @@ void FGMultiplayRxMgr::ProcessData(void) {
if (m_Player[iPlayerCnt] == NULL) { if (m_Player[iPlayerCnt] == NULL) {
SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayRxMgr::ProcessRxData - Add new player. IP: " << sIpAddress << ", Call: " << sCallsign << ", model: " << sModelName ); SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayRxMgr::ProcessRxData - Add new player. IP: " << sIpAddress << ", Call: " << sCallsign << ", model: " << sModelName );
m_Player[iPlayerCnt] = new MPPlayer; m_Player[iPlayerCnt] = new MPPlayer;
m_Player[iPlayerCnt]->Open(string(sIpAddress), iPort, string(sCallsign), string(sModelName), false); m_Player[iPlayerCnt]->Open(sIpAddress, iPort, sCallsign, sModelName, false);
m_Player[iPlayerCnt]->SetPosition(PosMsg->PlayerPos); m_Player[iPlayerCnt]->SetPosition(PosMsg->PlayerPos);
bActivePlayer = true; bActivePlayer = true;
} }

View file

@ -446,7 +446,7 @@ bool FGAtlas::parse_message() {
string alt_units = msg.substr(begin, end - begin); string alt_units = msg.substr(begin, end - begin);
begin = end + 1; begin = end + 1;
if ( alt_units != (string)"F" ) { if ( alt_units != "F" ) {
altitude *= SG_METER_TO_FEET; altitude *= SG_METER_TO_FEET;
} }

View file

@ -326,7 +326,7 @@ bool FGGarmin::parse_message() {
string alt_units = msg.substr(begin, end - begin); string alt_units = msg.substr(begin, end - begin);
begin = end + 1; begin = end + 1;
if ( alt_units != (string)"F" && alt_units != (string)"f" ) { if ( alt_units != "F" && alt_units != "f" ) {
altitude *= SG_METER_TO_FEET; altitude *= SG_METER_TO_FEET;
} }

View file

@ -199,7 +199,7 @@ void HttpdChannel::foundTerminator (void) {
if ( child->nChildren() > 0 ) { if ( child->nChildren() > 0 ) {
line += "<B><A HREF=\""; line += "<B><A HREF=\"";
line += request; line += request;
if ( request.substr(request.length() - 1, 1) != (string)"/" ) { if ( request.substr(request.length() - 1, 1) != "/" ) {
line += "/"; line += "/";
} }
line += urlEncode(name); line += urlEncode(name);
@ -213,7 +213,7 @@ void HttpdChannel::foundTerminator (void) {
line += name; line += name;
line += "</B> <A HREF=\""; line += "</B> <A HREF=\"";
line += request; line += request;
if ( request.substr(request.length() - 1, 1) != (string)"/" ) { if ( request.substr(request.length() - 1, 1) != "/" ) {
line += "/"; line += "/";
} }
line += urlEncode(name); line += urlEncode(name);

View file

@ -430,7 +430,7 @@ bool FGNMEA::parse_message() {
string alt_units = msg.substr(begin, end - begin); string alt_units = msg.substr(begin, end - begin);
begin = end + 1; begin = end + 1;
if ( alt_units != (string)"F" ) { if ( alt_units != "F" ) {
altitude *= SG_METER_TO_FEET; altitude *= SG_METER_TO_FEET;
} }

View file

@ -62,7 +62,7 @@ FGElectricalSupplier::FGElectricalSupplier ( SGPropertyNode *node ) {
for ( i = 0; i < node->nChildren(); ++i ) { for ( i = 0; i < node->nChildren(); ++i ) {
SGPropertyNode *child = node->getChild(i); SGPropertyNode *child = node->getChild(i);
// cout << " scanning: " << child->getName() << endl; // cout << " scanning: " << child->getName() << endl;
if ( (string)child->getName() == "prop" ) { if ( child->getName() == "prop" ) {
string prop = child->getStringValue(); string prop = child->getStringValue();
// cout << " Adding prop = " << prop << endl; // cout << " Adding prop = " << prop << endl;
add_prop( prop ); add_prop( prop );
@ -107,7 +107,7 @@ FGElectricalBus::FGElectricalBus ( SGPropertyNode *node ) {
int i; int i;
for ( i = 0; i < node->nChildren(); ++i ) { for ( i = 0; i < node->nChildren(); ++i ) {
SGPropertyNode *child = node->getChild(i); SGPropertyNode *child = node->getChild(i);
if ( (string)child->getName() == "prop" ) { if ( child->getName() == "prop" ) {
string prop = child->getStringValue(); string prop = child->getStringValue();
add_prop( prop ); add_prop( prop );
} }
@ -122,7 +122,7 @@ FGElectricalOutput::FGElectricalOutput ( SGPropertyNode *node ) {
int i; int i;
for ( i = 0; i < node->nChildren(); ++i ) { for ( i = 0; i < node->nChildren(); ++i ) {
SGPropertyNode *child = node->getChild(i); SGPropertyNode *child = node->getChild(i);
if ( (string)child->getName() == "prop" ) { if ( child->getName() == "prop" ) {
string prop = child->getStringValue(); string prop = child->getStringValue();
add_prop( prop ); add_prop( prop );
} }