From 4d25095e76b3a39ba3e1ae2c6aeb7c971c06ab07 Mon Sep 17 00:00:00 2001 From: daveluff Date: Fri, 19 Mar 2004 13:46:15 +0000 Subject: [PATCH] Convert some char* return types to string --- src/ATC/ATC.hxx | 8 ++++---- src/ATC/ATCDialog.cxx | 2 +- src/ATC/ATCmgr.cxx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ATC/ATC.hxx b/src/ATC/ATC.hxx index 1bbbd846e..c6c689a8d 100644 --- a/src/ATC/ATC.hxx +++ b/src/ATC/ATC.hxx @@ -169,10 +169,10 @@ public: inline void set_freq(const int fq) {freq = fq;} inline int get_range() const { return range; } inline void set_range(const int rg) {range = rg;} - inline const char* get_ident() { return ident.c_str(); } - inline void set_ident(const string id) {ident = id;} - inline const char* get_name() {return name.c_str();} - inline void set_name(const string nm) {name = nm;} + inline string get_ident() { return ident; } + inline void set_ident(const string id) { ident = id; } + inline string get_name() { return name; } + inline void set_name(const string nm) { name = nm; } protected: diff --git a/src/ATC/ATCDialog.cxx b/src/ATC/ATCDialog.cxx index d3548985e..3946898f6 100644 --- a/src/ATC/ATCDialog.cxx +++ b/src/ATC/ATCDialog.cxx @@ -399,7 +399,7 @@ void FGATCDialog::PopupCallback() { } else if(atcptr->GetType() == TOWER) { //cout << "TOWER " << endl; //cout << "ident is " << atcptr->get_ident() << endl; - atcmentry_vec_type atcmlist = (available_dialog[TOWER])[(string)atcptr->get_ident()]; + atcmentry_vec_type atcmlist = (available_dialog[TOWER])[atcptr->get_ident()]; if(atcmlist.size()) { //cout << "Doing callback...\n"; ATCMenuEntry a = atcmlist[atcDialogCommunicationOptions->getValue()]; diff --git a/src/ATC/ATCmgr.cxx b/src/ATC/ATCmgr.cxx index 8daf2e6be..3a4719772 100644 --- a/src/ATC/ATCmgr.cxx +++ b/src/ATC/ATCmgr.cxx @@ -373,7 +373,7 @@ void FGATCMgr::RemoveFromList(string id, atc_type tp) { while(it != atc_list.end()) { //cout << "type = " << (*it)->GetType() << '\n'; //cout << "Ident = " << (*it)->get_ident() << '\n'; - if( (!strcmp((*it)->get_ident(), id.c_str())) + if( ((*it)->get_ident() == id) && ((*it)->GetType() == tp) ) { //Before removing it stop it transmitting!! //cout << "OBLITERATING FROM LIST!!!\n"; @@ -396,7 +396,7 @@ FGATC* FGATCMgr::FindInList(string id, atc_type tp) { //cout << "Entering FindInList for " << id << ' ' << tp << endl; atc_list_iterator it = atc_list.begin(); while(it != atc_list.end()) { - if( (!strcmp((*it)->get_ident(), id.c_str())) + if( ((*it)->get_ident() == id) && ((*it)->GetType() == tp) ) { return(*it); } -- 2.39.5