Fix a problem where older IRIX compilers needed a typecast for certain opperations
This commit is contained in:
parent
cd4263f333
commit
0e370e6e28
12 changed files with 23 additions and 20 deletions
|
@ -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);
|
||||
|
|
|
@ -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 <simgear/compiler.h>
|
||||
|
||||
#include <simgear/structure/commands.hxx>
|
||||
|
||||
#include <Main/globals.hxx>
|
||||
|
@ -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';
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -126,7 +126,7 @@ static string GetReverseRunwayNo(string rwyno) {
|
|||
<< rwyno << " passed to GetReverseRunwayNo(...)");
|
||||
}
|
||||
}
|
||||
return((string)buf);
|
||||
return(buf);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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("");
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ void HttpdChannel::foundTerminator (void) {
|
|||
if ( child->nChildren() > 0 ) {
|
||||
line += "<B><A HREF=\"";
|
||||
line += request;
|
||||
if ( request.substr(request.length() - 1, 1) != (string)"/" ) {
|
||||
if ( request.substr(request.length() - 1, 1) != "/" ) {
|
||||
line += "/";
|
||||
}
|
||||
line += urlEncode(name);
|
||||
|
@ -213,7 +213,7 @@ void HttpdChannel::foundTerminator (void) {
|
|||
line += name;
|
||||
line += "</B> <A HREF=\"";
|
||||
line += request;
|
||||
if ( request.substr(request.length() - 1, 1) != (string)"/" ) {
|
||||
if ( request.substr(request.length() - 1, 1) != "/" ) {
|
||||
line += "/";
|
||||
}
|
||||
line += urlEncode(name);
|
||||
|
|
|
@ -430,7 +430,7 @@ bool FGNMEA::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;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ FGElectricalSupplier::FGElectricalSupplier ( SGPropertyNode *node ) {
|
|||
for ( i = 0; i < node->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 );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue