From 24e9bb6ce84e524457f4d918be3943e61a219795 Mon Sep 17 00:00:00 2001 From: daveluff Date: Fri, 2 Dec 2005 22:52:09 +0000 Subject: [PATCH] Alex Romosan: Pass strings by reference not value --- src/Instrumentation/KLN89/kln89.cxx | 2 +- src/Instrumentation/KLN89/kln89.hxx | 2 +- src/Instrumentation/KLN89/kln89_page.cxx | 6 +++--- src/Instrumentation/KLN89/kln89_page.hxx | 6 +++--- src/Instrumentation/KLN89/kln89_page_apt.cxx | 2 +- src/Instrumentation/KLN89/kln89_page_apt.hxx | 2 +- src/Instrumentation/KLN89/kln89_page_dir.cxx | 4 ++-- src/Instrumentation/KLN89/kln89_page_dir.hxx | 2 +- src/Instrumentation/KLN89/kln89_page_fpl.hxx | 2 +- src/Instrumentation/KLN89/kln89_page_int.cxx | 2 +- src/Instrumentation/KLN89/kln89_page_int.hxx | 2 +- src/Instrumentation/KLN89/kln89_page_ndb.cxx | 2 +- src/Instrumentation/KLN89/kln89_page_ndb.hxx | 2 +- src/Instrumentation/KLN89/kln89_page_vor.cxx | 2 +- src/Instrumentation/KLN89/kln89_page_vor.hxx | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Instrumentation/KLN89/kln89.cxx b/src/Instrumentation/KLN89/kln89.cxx index e66115bcb..78a817f9e 100644 --- a/src/Instrumentation/KLN89/kln89.cxx +++ b/src/Instrumentation/KLN89/kln89.cxx @@ -908,7 +908,7 @@ void KLN89::DrawMapQuad(int x1, int y1, int x2, int y2, bool invert) { // Draw an airport or waypoint label on the moving map // Specify position by the map pixel co-ordinate of the left or right, bottom, of the *visible* portion of the label. // The black background quad will automatically overlap this by 1 pixel. -void KLN89::DrawLabel(string s, int x1, int y1, bool right_align) { +void KLN89::DrawLabel(const string& s, int x1, int y1, bool right_align) { MapToInstrument(x1, y1); if(!right_align) { for(unsigned int i=0; iDtoInitiate(_id); } -} \ No newline at end of file +} diff --git a/src/Instrumentation/KLN89/kln89_page_dir.hxx b/src/Instrumentation/KLN89/kln89_page_dir.hxx index ec31df4aa..cee3b3f62 100644 --- a/src/Instrumentation/KLN89/kln89_page_dir.hxx +++ b/src/Instrumentation/KLN89/kln89_page_dir.hxx @@ -34,7 +34,7 @@ public: void Update(double dt); - void SetId(string s); + void SetId(const string& s); void ClrPressed(); void EntPressed(); diff --git a/src/Instrumentation/KLN89/kln89_page_fpl.hxx b/src/Instrumentation/KLN89/kln89_page_fpl.hxx index a571e16d6..f4c8a7804 100644 --- a/src/Instrumentation/KLN89/kln89_page_fpl.hxx +++ b/src/Instrumentation/KLN89/kln89_page_fpl.hxx @@ -48,7 +48,7 @@ public: // Override the base class GetId function to return the waypoint ID under the cursor // on FPL0 page, if there is one and the cursor is on. // Otherwise return an empty string. - inline string GetId() { return(_fp0SelWpId); } + inline const string& GetId() { return(_fp0SelWpId); } private: int _fpMode; // 0 = Dis, 1 = Dtk diff --git a/src/Instrumentation/KLN89/kln89_page_int.cxx b/src/Instrumentation/KLN89/kln89_page_int.cxx index e765cffc7..cf46bf142 100644 --- a/src/Instrumentation/KLN89/kln89_page_int.cxx +++ b/src/Instrumentation/KLN89/kln89_page_int.cxx @@ -159,7 +159,7 @@ void KLN89IntPage::Update(double dt) { KLN89Page::Update(dt); } -void KLN89IntPage::SetId(string s) { +void KLN89IntPage::SetId(const string& s) { _last_int_id = _int_id; _save_int_id = _int_id; _int_id = s; diff --git a/src/Instrumentation/KLN89/kln89_page_int.hxx b/src/Instrumentation/KLN89/kln89_page_int.hxx index f8b8dc7a2..df0ee52d3 100644 --- a/src/Instrumentation/KLN89/kln89_page_int.hxx +++ b/src/Instrumentation/KLN89/kln89_page_int.hxx @@ -40,7 +40,7 @@ public: void Knob2Left1(); void Knob2Right1(); - void SetId(string s); + void SetId(const string& s); private: string _int_id; diff --git a/src/Instrumentation/KLN89/kln89_page_ndb.cxx b/src/Instrumentation/KLN89/kln89_page_ndb.cxx index 44698954b..9d460bf0e 100644 --- a/src/Instrumentation/KLN89/kln89_page_ndb.cxx +++ b/src/Instrumentation/KLN89/kln89_page_ndb.cxx @@ -123,7 +123,7 @@ void KLN89NDBPage::Update(double dt) { KLN89Page::Update(dt); } -void KLN89NDBPage::SetId(string s) { +void KLN89NDBPage::SetId(const string& s) { _last_ndb_id = _ndb_id; _save_ndb_id = _ndb_id; _ndb_id = s; diff --git a/src/Instrumentation/KLN89/kln89_page_ndb.hxx b/src/Instrumentation/KLN89/kln89_page_ndb.hxx index 373844dd8..ca21353cd 100644 --- a/src/Instrumentation/KLN89/kln89_page_ndb.hxx +++ b/src/Instrumentation/KLN89/kln89_page_ndb.hxx @@ -40,7 +40,7 @@ public: void Knob2Left1(); void Knob2Right1(); - void SetId(string s); + void SetId(const string& s); private: string _ndb_id; diff --git a/src/Instrumentation/KLN89/kln89_page_vor.cxx b/src/Instrumentation/KLN89/kln89_page_vor.cxx index 3456c6e80..3a1c5938a 100644 --- a/src/Instrumentation/KLN89/kln89_page_vor.cxx +++ b/src/Instrumentation/KLN89/kln89_page_vor.cxx @@ -135,7 +135,7 @@ void KLN89VorPage::Update(double dt) { KLN89Page::Update(dt); } -void KLN89VorPage::SetId(string s) { +void KLN89VorPage::SetId(const string& s) { _last_vor_id = _vor_id; _save_vor_id = _vor_id; _vor_id = s; diff --git a/src/Instrumentation/KLN89/kln89_page_vor.hxx b/src/Instrumentation/KLN89/kln89_page_vor.hxx index a9fc412f2..c73ded848 100644 --- a/src/Instrumentation/KLN89/kln89_page_vor.hxx +++ b/src/Instrumentation/KLN89/kln89_page_vor.hxx @@ -40,7 +40,7 @@ public: void Knob2Left1(); void Knob2Right1(); - void SetId(string s); + void SetId(const string& s); private: string _vor_id; -- 2.39.5