From 0e370e6e28dca1722faf2432a1e8e14d0780b212 Mon Sep 17 00:00:00 2001 From: ehofman Date: Thu, 16 Oct 2003 14:14:03 +0000 Subject: [PATCH] Fix a problem where older IRIX compilers needed a typecast for certain opperations --- src/ATC/AILocalTraffic.cxx | 2 +- src/ATC/ATCDialog.cxx | 7 +++++-- src/ATC/ATCmgr.cxx | 8 ++++---- src/ATC/atis.cxx | 2 +- src/Airports/runways.cxx | 2 +- src/Instrumentation/adf.cxx | 2 +- src/MultiPlayer/multiplayrxmgr.cxx | 4 ++-- src/Network/atlas.cxx | 2 +- src/Network/garmin.cxx | 2 +- src/Network/httpd.cxx | 4 ++-- src/Network/nmea.cxx | 2 +- src/Systems/electrical.cxx | 6 +++--- 12 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/ATC/AILocalTraffic.cxx b/src/ATC/AILocalTraffic.cxx index 8d58ee35f..f9a5669d5 100644 --- a/src/ATC/AILocalTraffic.cxx +++ b/src/ATC/AILocalTraffic.cxx @@ -168,7 +168,7 @@ bool FGAILocalTraffic::Init(string ICAO, OperatingState initialState, PatternLeg AirportATC a; if(ATC->GetAirportATCDetails(airportID, &a)) { 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) { // Something has gone wrong - abort or carry on with un-towered operation? return(false); diff --git a/src/ATC/ATCDialog.cxx b/src/ATC/ATCDialog.cxx index c6fcb1f4f..22e886f2e 100644 --- a/src/ATC/ATCDialog.cxx +++ b/src/ATC/ATCDialog.cxx @@ -18,6 +18,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#include + #include #include
@@ -337,7 +339,7 @@ void FGATCDialog::DoDialog() { string dum; sprintf( buf, "%i", kk+1 ); buf[1] = '\0'; - dum = (string)(buf); + dum = buf; mentry[kk] = dum + ". " + current->menuentry; optList[kk] = new char[strlen(mentry[kk].c_str()) + 1]; strcpy(optList[kk], mentry[kk].c_str()); @@ -523,7 +525,8 @@ void FGATCDialog::FreqDisplay(string ident) { if((*itr).ident == ident) { if((*itr).type != INVALID) { 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 // Hack alert! if(buf[5] == '3') buf[5] = '2'; diff --git a/src/ATC/ATCmgr.cxx b/src/ATC/ATCmgr.cxx index acdf63d14..4c8c87ce5 100644 --- a/src/ATC/ATCmgr.cxx +++ b/src/ATC/ATCmgr.cxx @@ -270,13 +270,13 @@ bool FGATCMgr::CommRegisterAirport(string ident, int chan, atc_type tp) { // Note that chan is zero based. 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); - if(airport_atc_map.find((string)id) != airport_atc_map.end()) { - AirportATC* a = airport_atc_map[(string)id]; + if(airport_atc_map.find(id) != airport_atc_map.end()) { + AirportATC* a = airport_atc_map[id]; //cout << "In CommRemoveFromList, a->ground_freq = " << a->ground_freq << endl; 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 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) { case 0: //cout << "chan 1\n"; @@ -302,7 +302,7 @@ void FGATCMgr::CommRemoveFromList(const char* id, atc_type tp, int chan) { } break; } - airport_atc_map[(string)id] = a; + airport_atc_map[id] = a; return; } else { switch(chan) { diff --git a/src/ATC/atis.cxx b/src/ATC/atis.cxx index 6c09990b2..4c56b23a4 100644 --- a/src/ATC/atis.cxx +++ b/src/ATC/atis.cxx @@ -261,7 +261,7 @@ void FGATIS::UpdateTransmission() { #endif 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 += ConvertRwyNumToSpokenString(atoi(rwy_no.c_str())); //cout << "in atis.cxx, r.rwy_no = " << rwy_no << " r.id = " << r->id << " r.heading = " << r->heading << endl; diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index 856c3e5dc..503f298f4 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -126,7 +126,7 @@ static string GetReverseRunwayNo(string rwyno) { << rwyno << " passed to GetReverseRunwayNo(...)"); } } - return((string)buf); + return(buf); } diff --git a/src/Instrumentation/adf.cxx b/src/Instrumentation/adf.cxx index dcd1a66ce..0ecda901c 100644 --- a/src/Instrumentation/adf.cxx +++ b/src/Instrumentation/adf.cxx @@ -114,7 +114,7 @@ ADF::update (double delta_time_sec) // If it's off, don't bother. 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); _ident_node->setStringValue(""); diff --git a/src/MultiPlayer/multiplayrxmgr.cxx b/src/MultiPlayer/multiplayrxmgr.cxx index 33f5f1aa6..fdc58ba99 100644 --- a/src/MultiPlayer/multiplayrxmgr.cxx +++ b/src/MultiPlayer/multiplayrxmgr.cxx @@ -243,7 +243,7 @@ void FGMultiplayRxMgr::ProcessData(void) { sCallsign = MsgHdr->sCallsign; // Process the player data unless we generated it - if (m_sCallsign != string(MsgHdr->sCallsign)) { + if (m_sCallsign != MsgHdr->sCallsign) { // Process messages @@ -283,7 +283,7 @@ void FGMultiplayRxMgr::ProcessData(void) { if (m_Player[iPlayerCnt] == NULL) { 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]->Open(string(sIpAddress), iPort, string(sCallsign), string(sModelName), false); + m_Player[iPlayerCnt]->Open(sIpAddress, iPort, sCallsign, sModelName, false); m_Player[iPlayerCnt]->SetPosition(PosMsg->PlayerPos); bActivePlayer = true; } diff --git a/src/Network/atlas.cxx b/src/Network/atlas.cxx index 6e7b63de0..2df07d557 100644 --- a/src/Network/atlas.cxx +++ b/src/Network/atlas.cxx @@ -446,7 +446,7 @@ bool FGAtlas::parse_message() { string alt_units = msg.substr(begin, end - begin); begin = end + 1; - if ( alt_units != (string)"F" ) { + if ( alt_units != "F" ) { altitude *= SG_METER_TO_FEET; } diff --git a/src/Network/garmin.cxx b/src/Network/garmin.cxx index 590a92fda..bd7046823 100644 --- a/src/Network/garmin.cxx +++ b/src/Network/garmin.cxx @@ -326,7 +326,7 @@ bool FGGarmin::parse_message() { string alt_units = msg.substr(begin, end - begin); begin = end + 1; - if ( alt_units != (string)"F" && alt_units != (string)"f" ) { + if ( alt_units != "F" && alt_units != "f" ) { altitude *= SG_METER_TO_FEET; } diff --git a/src/Network/httpd.cxx b/src/Network/httpd.cxx index 94a5a9532..318c69f2a 100644 --- a/src/Network/httpd.cxx +++ b/src/Network/httpd.cxx @@ -199,7 +199,7 @@ void HttpdChannel::foundTerminator (void) { if ( child->nChildren() > 0 ) { line += "nChildren(); ++i ) { SGPropertyNode *child = node->getChild(i); // cout << " scanning: " << child->getName() << endl; - if ( (string)child->getName() == "prop" ) { + if ( child->getName() == "prop" ) { string prop = child->getStringValue(); // cout << " Adding prop = " << prop << endl; add_prop( prop ); @@ -107,7 +107,7 @@ FGElectricalBus::FGElectricalBus ( SGPropertyNode *node ) { int i; for ( i = 0; i < node->nChildren(); ++i ) { SGPropertyNode *child = node->getChild(i); - if ( (string)child->getName() == "prop" ) { + if ( child->getName() == "prop" ) { string prop = child->getStringValue(); add_prop( prop ); } @@ -122,7 +122,7 @@ FGElectricalOutput::FGElectricalOutput ( SGPropertyNode *node ) { int i; for ( i = 0; i < node->nChildren(); ++i ) { SGPropertyNode *child = node->getChild(i); - if ( (string)child->getName() == "prop" ) { + if ( child->getName() == "prop" ) { string prop = child->getStringValue(); add_prop( prop ); }