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);
// 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>
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());
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';
// 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";
}
break;
}
- airport_atc_map[(string)id] = a;
+ airport_atc_map[id] = a;
return;
} else {
switch(chan) {
#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;
<< rwyno << " passed to GetReverseRunwayNo(...)");
}
}
- return((string)buf);
+ return(buf);
}
// 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("");
sCallsign = MsgHdr->sCallsign;
// Process the player data unless we generated it
- if (m_sCallsign != string(MsgHdr->sCallsign)) {
+ if (m_sCallsign != MsgHdr->sCallsign) {
// Process messages
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;
}
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;
}
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;
}
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);
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);
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;
}
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 );
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 );
}
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 );
}