# HG changeset patch # User Rik # Date 1631200732 25200 # Node ID 45c45295a84a877457650d3ada1efbee2a8c695a # Parent a4d1c080e445c52987c965db84db992dd4b1324e maint: use "m_" prefix for member variables in class package_info. * load-path.cc, load-path.h: Use "m_" prefix for member variables in class package_info. diff -r a4d1c080e445 -r 45c45295a84a libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Thu Sep 09 10:08:12 2021 -0400 +++ b/libinterp/corefcn/load-path.cc Thu Sep 09 08:18:52 2021 -0700 @@ -1572,16 +1572,16 @@ { std::string dir_name = di.abs_dir_name; - auto s = std::find (dir_list.begin (), dir_list.end (), dir_name); - - if (s != dir_list.end ()) + auto s = std::find (m_dir_list.begin (), m_dir_list.end (), dir_name); + + if (s != m_dir_list.end ()) { - dir_list.erase (s); + m_dir_list.erase (s); if (at_end) - dir_list.push_back (dir_name); + m_dir_list.push_back (dir_name); else - dir_list.push_front (dir_name); + m_dir_list.push_front (dir_name); } move_fcn_map (dir_name, di.fcn_files, at_end); @@ -1598,7 +1598,7 @@ string_vector fcn_files = di.fcn_files; - dir_list.remove (dir); + m_dir_list.remove (dir); remove_fcn_map (dir, fcn_files); @@ -1614,11 +1614,11 @@ << (m_package_name.empty () ? "" : m_package_name) << "\n\n"; - for (const auto& dir : dir_list) + for (const auto& dir : m_dir_list) os << dir << "\n"; os << "\n"; - for (const auto& dir_fnlst : private_fcn_map) + for (const auto& dir_fnlst : m_private_fcn_map) { os << "\n*** private functions in " << sys::file_ops::concat (dir_fnlst.first, "private") @@ -1629,7 +1629,7 @@ #if defined (DEBUG_LOAD_PATH) - for (const auto& nm_filst : fcn_map) + for (const auto& nm_filst : m_fcn_map) { os << nm_filst.first << ":\n"; @@ -1645,13 +1645,13 @@ } } - for (const auto& cls_fnmap : method_map) + for (const auto& cls_fnmap : m_method_map) { os << "CLASS " << cls_fnmap.first << ":\n"; const fcn_map_type& fm = cls_fnmap.second; - for (const auto& nm_fnlst : fcn_map) + for (const auto& nm_fnlst : m_fcn_map) { os << " " << nm_fnlst.first << ":\n"; @@ -1700,9 +1700,9 @@ { dir_name = ""; - const_fcn_map_iterator p = fcn_map.find (fcn); - - if (p != fcn_map.end ()) + const_fcn_map_iterator p = m_fcn_map.find (fcn); + + if (p != m_fcn_map.end ()) { const file_info_list_type& file_info_list = p->second; @@ -1734,9 +1734,9 @@ // update (); - const_private_fcn_map_iterator q = private_fcn_map.find (dir); - - if (q != private_fcn_map.end ()) + const_private_fcn_map_iterator q = m_private_fcn_map.find (dir); + + if (q != m_private_fcn_map.end ()) { const dir_info::fcn_file_map_type& fcn_file_map = q->second; @@ -1768,9 +1768,9 @@ dir_name = ""; - const_method_map_iterator q = method_map.find (class_name); - - if (q != method_map.end ()) + const_method_map_iterator q = m_method_map.find (class_name); + + if (q != m_method_map.end ()) { const fcn_map_type& m = q->second; @@ -1808,9 +1808,9 @@ // update (); - const_method_map_iterator mtd_map_it = method_map.find (class_name); - - if (mtd_map_it != method_map.end ()) + const_method_map_iterator mtd_map_it = m_method_map.find (class_name); + + if (mtd_map_it != m_method_map.end ()) { for (const auto& nm_filst : mtd_map_it->second) retval.push_back (nm_filst.first); @@ -1826,7 +1826,7 @@ load_path::package_info::overloads (const std::string& meth, std::list& l) const { - for (const auto& cls_fnmap : method_map) + for (const auto& cls_fnmap : m_method_map) { const fcn_map_type& m = cls_fnmap.second; @@ -1845,13 +1845,13 @@ string_vector load_path::package_info::fcn_names (void) const { - std::size_t len = fcn_map.size (); + std::size_t len = m_fcn_map.size (); string_vector retval (len); octave_idx_type count = 0; - for (const auto& nm_filst : fcn_map) + for (const auto& nm_filst : m_fcn_map) retval[count++] = nm_filst.first; return retval; @@ -1882,7 +1882,7 @@ ext = fname.substr (pos); } - file_info_list_type& file_info_list = fcn_map[base]; + file_info_list_type& file_info_list = m_fcn_map[base]; auto p = file_info_list.begin (); @@ -1969,7 +1969,7 @@ dir_info::fcn_file_map_type private_file_map = di.private_file_map; if (! private_file_map.empty ()) - private_fcn_map[di.abs_dir_name] = private_file_map; + m_private_fcn_map[di.abs_dir_name] = private_file_map; } void @@ -1984,7 +1984,7 @@ { std::string class_name = cls_ci.first; - fcn_map_type& fm = method_map[class_name]; + fcn_map_type& fm = m_method_map[class_name]; std::string full_dir_name = sys::file_ops::concat (dir_name, '@' + class_name); @@ -2032,7 +2032,7 @@ dir_info::fcn_file_map_type private_file_map = ci.private_file_map; if (! private_file_map.empty ()) - private_fcn_map[full_dir_name] = private_file_map; + m_private_fcn_map[full_dir_name] = private_file_map; } } @@ -2057,7 +2057,7 @@ ext = fname.substr (pos); } - file_info_list_type& file_info_list = fcn_map[base]; + file_info_list_type& file_info_list = m_fcn_map[base]; if (file_info_list.size () == 1) continue; @@ -2089,7 +2089,7 @@ load_path::package_info::move_method_map (const std::string& dir_name, bool at_end) { - for (auto& cls_fnmap : method_map) + for (auto& cls_fnmap : m_method_map) { std::string class_name = cls_fnmap.first; @@ -2149,7 +2149,7 @@ ext = fname.substr (pos); } - file_info_list_type& file_info_list = fcn_map[base]; + file_info_list_type& file_info_list = m_fcn_map[base]; for (auto fi_it = file_info_list.begin (); fi_it != file_info_list.end (); @@ -2160,7 +2160,7 @@ file_info_list.erase (fi_it); if (file_info_list.empty ()) - fcn_map.erase (fname); + m_fcn_map.erase (fname); break; } @@ -2171,16 +2171,16 @@ void load_path::package_info::remove_private_fcn_map (const std::string& dir) { - auto p = private_fcn_map.find (dir); - - if (p != private_fcn_map.end ()) - private_fcn_map.erase (p); + auto p = m_private_fcn_map.find (dir); + + if (p != m_private_fcn_map.end ()) + m_private_fcn_map.erase (p); } void load_path::package_info::remove_method_map (const std::string& dir) { - for (auto& cls_fnmap : method_map) + for (auto& cls_fnmap : m_method_map) { std::string class_name = cls_fnmap.first; diff -r a4d1c080e445 -r 45c45295a84a libinterp/corefcn/load-path.h --- a/libinterp/corefcn/load-path.h Thu Sep 09 10:08:12 2021 -0400 +++ b/libinterp/corefcn/load-path.h Thu Sep 09 08:18:52 2021 -0700 @@ -393,14 +393,14 @@ public: package_info (const std::string& package_name = "") - : m_package_name (package_name), dir_list (), fcn_map (), - private_fcn_map (), - method_map () + : m_package_name (package_name), m_dir_list (), m_fcn_map (), + m_private_fcn_map (), + m_method_map () { } package_info (const package_info& l) - : m_package_name (l.m_package_name), dir_list (l.dir_list), - private_fcn_map (l.private_fcn_map), method_map (l.method_map) + : m_package_name (l.m_package_name), m_dir_list (l.m_dir_list), + m_private_fcn_map (l.m_private_fcn_map), m_method_map (l.m_method_map) { } ~package_info (void) = default; @@ -410,10 +410,10 @@ if (&l != this) { m_package_name = l.m_package_name; - dir_list = l.dir_list; - fcn_map = l.fcn_map; - private_fcn_map = l.private_fcn_map; - method_map = l.method_map; + m_dir_list = l.m_dir_list; + m_fcn_map = l.m_fcn_map; + m_private_fcn_map = l.m_private_fcn_map; + m_method_map = l.m_method_map; } return *this; @@ -422,9 +422,9 @@ void add (const dir_info& di, bool at_end, bool updating) { if (at_end) - dir_list.push_back (di.dir_name); + m_dir_list.push_back (di.dir_name); else - dir_list.push_front (di.dir_name); + m_dir_list.push_front (di.dir_name); add_to_fcn_map (di, at_end, updating); @@ -439,13 +439,13 @@ void clear (void) { - dir_list.clear (); + m_dir_list.clear (); - fcn_map.clear (); + m_fcn_map.clear (); - private_fcn_map.clear (); + m_private_fcn_map.clear (); - method_map.clear (); + m_method_map.clear (); } void display (std::ostream& out) const; @@ -499,13 +499,13 @@ std::string m_package_name; - std::list dir_list; + std::list m_dir_list; - fcn_map_type fcn_map; + fcn_map_type m_fcn_map; - private_fcn_map_type private_fcn_map; + private_fcn_map_type m_private_fcn_map; - method_map_type method_map; + method_map_type m_method_map; }; //