# HG changeset patch # User Rik # Date 1631245083 25200 # Node ID b7727b8533d82e1a9c5e782d07d91ad8529a50b7 # Parent 037feca709126a6822889013c64a454ae4a17a84 maint: use "m_" prefix for member variables in class octave_errno. * oct-errno.h, oct-errno.in.cc: Use "m_" prefix for member variables in class octave_errno. diff -r 037feca70912 -r b7727b8533d8 libinterp/corefcn/oct-errno.h --- a/libinterp/corefcn/oct-errno.h Thu Sep 09 20:35:40 2021 -0700 +++ b/libinterp/corefcn/oct-errno.h Thu Sep 09 20:38:03 2021 -0700 @@ -47,7 +47,8 @@ static bool instance_ok (void); - static void cleanup_instance (void) { delete instance; instance = nullptr; } + static void cleanup_instance (void) + { delete s_instance; s_instance = nullptr; } static int lookup (const std::string& name); @@ -64,13 +65,16 @@ private: - std::map errno_tbl; - - static octave_errno *instance; - int do_lookup (const std::string& name); octave_scalar_map do_list (void); + + //-------- + + std::map m_errno_tbl; + + static octave_errno *s_instance; + }; #endif diff -r 037feca70912 -r b7727b8533d8 libinterp/corefcn/oct-errno.in.cc --- a/libinterp/corefcn/oct-errno.in.cc Thu Sep 09 20:35:40 2021 -0700 +++ b/libinterp/corefcn/oct-errno.in.cc Thu Sep 09 20:38:03 2021 -0700 @@ -37,7 +37,7 @@ #include "oct-map.h" #include "error.h" -octave_errno *octave_errno::instance = nullptr; +octave_errno *octave_errno::s_instance = nullptr; octave_errno::octave_errno (void) { @@ -287,7 +287,7 @@ while (ptr->name) { - errno_tbl[ptr->name] = ptr->value; + m_errno_tbl[ptr->name] = ptr->value; ptr++; } } @@ -297,9 +297,9 @@ { bool retval = true; - if (! instance) + if (! s_instance) { - instance = new octave_errno (); + s_instance = new octave_errno (); singleton_cleanup_list::add (cleanup_instance); } @@ -309,19 +309,19 @@ int octave_errno::lookup (const std::string& name) { - return (instance_ok ()) ? instance->do_lookup (name) : -1; + return (instance_ok ()) ? s_instance->do_lookup (name) : -1; } octave_scalar_map octave_errno::list (void) { - return (instance_ok ()) ? instance->do_list () : octave_scalar_map (); + return (instance_ok ()) ? s_instance->do_list () : octave_scalar_map (); } int octave_errno::do_lookup (const std::string& name) { - return (errno_tbl.find (name) != errno_tbl.end ()) ? errno_tbl[name] : -1; + return (m_errno_tbl.find (name) != m_errno_tbl.end ()) ? m_errno_tbl[name] : -1; } octave_scalar_map @@ -329,7 +329,7 @@ { octave_scalar_map retval; - for (const auto& p : errno_tbl) + for (const auto& p : m_errno_tbl) { retval.assign (p.first, p.second); }