]> git.mxchange.org Git - flightgear.git/commitdiff
Convert some char* return types to string
authordaveluff <daveluff>
Fri, 19 Mar 2004 13:46:15 +0000 (13:46 +0000)
committerdaveluff <daveluff>
Fri, 19 Mar 2004 13:46:15 +0000 (13:46 +0000)
src/ATC/ATC.hxx
src/ATC/ATCDialog.cxx
src/ATC/ATCmgr.cxx

index 1bbbd846e37d89b44050d55c3f2eda16e48bebd0..c6c689a8d77138df00524d9d0a51397f03c0af12 100644 (file)
@@ -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:
        
index d3548985e3b19f6e697d038ef40635689ce70b39..3946898f65eb261984b91ace0ebb65e734062abe 100644 (file)
@@ -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()];
index 8daf2e6becdeec34f67aa0cd735cffa85cb43dca..3a4719772edcc4a8ad41b164044d16ff8590a0ab 100644 (file)
@@ -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);
                }