Mercurial > octave
changeset 31845:2da025d5e98d
maint: Use 's_' prefix for static private class variables.
Use 's_' as prefix for static class variables. Where the static variable
is really a constant, use ALL_CAPITALS for name.
* main-window.cc, main-window.h, ft-text-renderer.cc, interpreter.cc,
interpreter.h, __init_fltk__.cc, ov-base.cc, ov-base.h, ov-class.cc,
ov-class.h, ov-classdef.cc, ov-classdef.h, ov-java.cc, ov-java.h, oct-rand.cc,
oct-rand.h, oct-env.cc, oct-env.h, cmd-edit.cc, cmd-edit.h, oct-inttypes.h:
Use 's_' prefix for static private class variables.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 20 Feb 2023 18:06:54 -0800 |
parents | e27744dfb13a |
children | 5f0b8101234e |
files | libgui/src/main-window.cc libgui/src/main-window.h libinterp/corefcn/ft-text-renderer.cc libinterp/corefcn/interpreter.cc libinterp/corefcn/interpreter.h libinterp/dldfcn/__init_fltk__.cc libinterp/octave-value/ov-base.cc libinterp/octave-value/ov-base.h libinterp/octave-value/ov-class.cc libinterp/octave-value/ov-class.h libinterp/octave-value/ov-classdef.cc libinterp/octave-value/ov-classdef.h libinterp/octave-value/ov-java.cc libinterp/octave-value/ov-java.h liboctave/numeric/oct-rand.cc liboctave/numeric/oct-rand.h liboctave/system/oct-env.cc liboctave/system/oct-env.h liboctave/util/cmd-edit.cc liboctave/util/cmd-edit.h liboctave/util/oct-inttypes.h |
diffstat | 21 files changed, 195 insertions(+), 196 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/main-window.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/libgui/src/main-window.cc Mon Feb 20 18:06:54 2023 -0800 @@ -2611,8 +2611,8 @@ m_current_directory_combo_box->setEditable (true); m_current_directory_combo_box->setInsertPolicy (QComboBox::NoInsert); m_current_directory_combo_box->setToolTip (tr ("Enter directory name")); - m_current_directory_combo_box->setMaxVisibleItems (current_directory_max_visible); - m_current_directory_combo_box->setMaxCount (current_directory_max_count); + m_current_directory_combo_box->setMaxVisibleItems (CURRENT_DIRECTORY_MAX_VISIBLE); + m_current_directory_combo_box->setMaxCount (CURRENT_DIRECTORY_MAX_COUNT); QSizePolicy sizePol (QSizePolicy::Preferred, QSizePolicy::Preferred); m_current_directory_combo_box->setSizePolicy (sizePol);
--- a/libgui/src/main-window.h Sun Feb 19 20:11:39 2023 -0800 +++ b/libgui/src/main-window.h Mon Feb 20 18:06:54 2023 -0800 @@ -404,8 +404,8 @@ //! For Toolbars. //!@{ QComboBox *m_current_directory_combo_box; - static const int current_directory_max_visible = 16; - static const int current_directory_max_count = 16; + static const int CURRENT_DIRECTORY_MAX_VISIBLE = 16; + static const int CURRENT_DIRECTORY_MAX_COUNT = 16; QLineEdit *m_current_directory_line_edit; //!@}
--- a/libinterp/corefcn/ft-text-renderer.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/corefcn/ft-text-renderer.cc Mon Feb 20 18:06:54 2023 -0800 @@ -146,9 +146,9 @@ { bool retval = true; - if (! m_instance) + if (! s_instance) { - m_instance = new ft_manager (); + s_instance = new ft_manager (); singleton_cleanup_list::add (cleanup_instance); } @@ -156,28 +156,28 @@ } static void cleanup_instance () - { delete m_instance; m_instance = nullptr; } + { delete s_instance; s_instance = nullptr; } static FT_Face get_font (const std::string& name, const std::string& weight, const std::string& angle, double size, FT_ULong c = 0) { return (instance_ok () - ? m_instance->do_get_font (name, weight, angle, size, c) + ? s_instance->do_get_font (name, weight, angle, size, c) : nullptr); } static octave_map get_system_fonts () { return (instance_ok () - ? m_instance->do_get_system_fonts () + ? s_instance->do_get_system_fonts () : octave_map ()); } static void font_destroyed (FT_Face face) { if (instance_ok ()) - m_instance->do_font_destroyed (face); + s_instance->do_font_destroyed (face); } private: @@ -430,7 +430,7 @@ //-------- - static ft_manager *m_instance; + static ft_manager *s_instance; // Cache the fonts loaded by FreeType. This cache only contains // weak references to the fonts, strong references are only present @@ -442,7 +442,7 @@ bool m_fontconfig_initialized; }; -ft_manager *ft_manager::m_instance = nullptr; +ft_manager *ft_manager::s_instance = nullptr; static void ft_face_destroyed (void *object)
--- a/libinterp/corefcn/interpreter.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/corefcn/interpreter.cc Mon Feb 20 18:06:54 2023 -0800 @@ -463,11 +463,11 @@ // // only one Octave interpreter may be active in any given thread - if (m_instance) + if (s_instance) throw std::runtime_error ("only one Octave interpreter may be active"); - m_instance = this; + s_instance = this; #if defined (OCTAVE_HAVE_WINDOWS_UTF8_LOCALE) // Force a UTF-8 locale on Windows if possible @@ -623,7 +623,7 @@ octave_interpreter_ready = true; } -OCTAVE_THREAD_LOCAL interpreter *interpreter::m_instance = nullptr; +OCTAVE_THREAD_LOCAL interpreter *interpreter::s_instance = nullptr; interpreter::~interpreter () {
--- a/libinterp/corefcn/interpreter.h Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/corefcn/interpreter.h Mon Feb 20 18:06:54 2023 -0800 @@ -544,7 +544,7 @@ bool remove_atexit_fcn (const std::string& fname); - static interpreter * the_interpreter () { return m_instance; } + static interpreter * the_interpreter () { return s_instance; } private: @@ -582,7 +582,7 @@ // replaced by the C++ thread_local keyword. For now, use a macro // to allow experimenting with thread_local storage. - OCTAVE_THREAD_LOCAL static interpreter *m_instance; + OCTAVE_THREAD_LOCAL static interpreter *s_instance; application *m_app_context;
--- a/libinterp/dldfcn/__init_fltk__.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/dldfcn/__init_fltk__.cc Mon Feb 20 18:06:54 2023 -0800 @@ -779,7 +779,7 @@ plot_window (int xx, int yy, int ww, int hh, figure::properties& xfp, bool internal) - : Fl_Window (xx, yy, ww, hh + m_menu_h + m_status_h + 2, "octave"), + : Fl_Window (xx, yy, ww, hh + MENU_H + STATUS_H + 2, "octave"), m_window_label (), m_fp (xfp), m_uimenu (nullptr), m_canvas (nullptr), m_autoscale (nullptr), m_togglegrid (nullptr), m_panzoom (nullptr), m_rotate (nullptr), m_help (nullptr), m_status (nullptr), @@ -789,8 +789,8 @@ // The size of the resize_dummy box also determines the minimum // window size. - m_resize_dummy = new Fl_Box (5 * m_status_h, m_menu_h, - ww - 5 * m_status_h, hh); + m_resize_dummy = new Fl_Box (5 * STATUS_H, MENU_H, + ww - 5 * STATUS_H, hh); // See http://fltk.org/articles.php?L415+I0+T+M1000+P1 // for how resizable works @@ -804,16 +804,16 @@ // windows. Otherwise, the class is just "FLTK" //default_xclass ("Octave"); - m_uimenu = new fltk_uimenu (0, 0, ww, m_menu_h); - m_canvas = new OpenGL_fltk (0, m_menu_h, ww, hh, number ()); + m_uimenu = new fltk_uimenu (0, 0, ww, MENU_H); + m_canvas = new OpenGL_fltk (0, MENU_H, ww, hh, number ()); // The bottom toolbar is a composite of "autoscale", "togglegrid", // "panzoom", "rotate", "help", and "status". // Only "status" should be resized. - int toolbar_y = m_menu_h + hh + 1; - m_status = new Fl_Output (5 * m_status_h, toolbar_y, - ww - 5 * m_status_h, m_status_h, ""); + int toolbar_y = MENU_H + hh + 1; + m_status = new Fl_Output (5 * STATUS_H, toolbar_y, + ww - 5 * STATUS_H, STATUS_H, ""); m_status->textcolor (FL_BLACK); m_status->color (FL_GRAY); @@ -821,23 +821,23 @@ m_status->textsize (10); m_status->box (FL_ENGRAVED_BOX); - m_autoscale = new Fl_Button (0, toolbar_y, m_status_h, m_status_h, "A"); + m_autoscale = new Fl_Button (0, toolbar_y, STATUS_H, STATUS_H, "A"); m_autoscale->callback (button_callback, static_cast<void *> (this)); m_autoscale->tooltip ("Autoscale"); - m_togglegrid = new Fl_Button (m_status_h, toolbar_y, m_status_h, m_status_h, "G"); + m_togglegrid = new Fl_Button (STATUS_H, toolbar_y, STATUS_H, STATUS_H, "G"); m_togglegrid->callback (button_callback, static_cast<void *> (this)); m_togglegrid->tooltip ("Toggle Grid"); - m_panzoom = new Fl_Button (2* m_status_h, toolbar_y, m_status_h, m_status_h, "P"); + m_panzoom = new Fl_Button (2* STATUS_H, toolbar_y, STATUS_H, STATUS_H, "P"); m_panzoom->callback (button_callback, static_cast<void *> (this)); m_panzoom->tooltip ("Mouse Pan/Zoom"); - m_rotate = new Fl_Button (3 * m_status_h, toolbar_y, m_status_h, m_status_h, "R"); + m_rotate = new Fl_Button (3 * STATUS_H, toolbar_y, STATUS_H, STATUS_H, "R"); m_rotate->callback (button_callback, static_cast<void *> (this)); m_rotate->tooltip ("Mouse Rotate"); - m_help = new Fl_Button (4 * m_status_h, toolbar_y, m_status_h, m_status_h, "?"); + m_help = new Fl_Button (4 * STATUS_H, toolbar_y, STATUS_H, STATUS_H, "?"); m_help->callback (button_callback, static_cast<void *> (this)); m_help->tooltip ("Help"); @@ -1018,12 +1018,12 @@ int toolbar_y = m_canvas->h () + menu_dy () + 1; m_autoscale->position (0, toolbar_y); - m_togglegrid->position (m_status_h, toolbar_y); - m_panzoom->position (2 * m_status_h, toolbar_y); - m_rotate->position (3 * m_status_h, toolbar_y); - m_help->position (4 * m_status_h, toolbar_y); - m_status->resize (5 * m_status_h, toolbar_y, - w () - 5 * m_status_h, m_status_h); + m_togglegrid->position (STATUS_H, toolbar_y); + m_panzoom->position (2 * STATUS_H, toolbar_y); + m_rotate->position (3 * STATUS_H, toolbar_y); + m_help->position (4 * STATUS_H, toolbar_y); + m_status->resize (5 * STATUS_H, toolbar_y, + w () - 5 * STATUS_H, STATUS_H); init_sizes (); redraw (); } @@ -1032,7 +1032,7 @@ { Matrix pos = outerpos; pos(1) += menu_dy (); - pos(3) -= menu_dy () + m_status_h + 2; + pos(3) -= menu_dy () + STATUS_H + 2; return pos; } @@ -1040,7 +1040,7 @@ { Matrix outerpos = pos; outerpos(1) -= menu_dy (); - outerpos(3) += menu_dy () + m_status_h + 2; + outerpos(3) += menu_dy () + STATUS_H + 2; return outerpos; } @@ -1078,10 +1078,10 @@ figure::properties& m_fp; // Status area height. - static const int m_status_h = 20; + static const int STATUS_H = 20; // Menu height - static const int m_menu_h = 25; + static const int MENU_H = 25; fltk_uimenu *m_uimenu; @@ -1333,7 +1333,7 @@ int menu_dy () { if (m_uimenu->is_visible ()) - return m_menu_h; + return MENU_H; else return 0; } @@ -1887,8 +1887,8 @@ { bool retval = true; - if (! instance) - instance = new figure_manager (); + if (! s_instance) + s_instance = new figure_manager (); return retval; } @@ -1896,19 +1896,19 @@ static void close_all () { if (instance_ok ()) - instance->do_close_all (); + s_instance->do_close_all (); } static void new_window (figure::properties& fp) { if (instance_ok ()) - instance->do_new_window (fp); + s_instance->do_new_window (fp); } static void delete_window (int idx) { if (instance_ok ()) - instance->do_delete_window (idx); + s_instance->do_delete_window (idx); } static void delete_window (const std::string& idx_str) @@ -1919,13 +1919,13 @@ static void renumber_figure (const std::string& idx_str, double new_number) { if (instance_ok ()) - instance->do_renumber_figure (str2idx (idx_str), new_number); + s_instance->do_renumber_figure (str2idx (idx_str), new_number); } static void toggle_window_visibility (int idx, bool is_visible) { if (instance_ok ()) - instance->do_toggle_window_visibility (idx, is_visible); + s_instance->do_toggle_window_visibility (idx, is_visible); } static void toggle_window_visibility (const std::string& idx_str, @@ -1937,7 +1937,7 @@ static void mark_modified (int idx) { if (instance_ok ()) - instance->do_mark_modified (idx); + s_instance->do_mark_modified (idx); } static void mark_modified (const graphics_handle& gh) @@ -1948,7 +1948,7 @@ static void set_name (int idx) { if (instance_ok ()) - instance->do_set_name (idx); + s_instance->do_set_name (idx); } static void set_name (const std::string& idx_str) @@ -1958,7 +1958,7 @@ static Matrix get_size (int idx) { - return instance_ok () ? instance->do_get_size (idx) : Matrix (); + return instance_ok () ? s_instance->do_get_size (idx) : Matrix (); } static Matrix get_size (const graphics_handle& gh) @@ -1970,14 +1970,14 @@ const std::string& term) { if (instance_ok ()) - instance->do_print (hnd2idx (gh), cmd, term); + s_instance->do_print (hnd2idx (gh), cmd, term); } static uint8NDArray get_pixels (const graphics_handle& gh) { uint8NDArray retval; if (instance_ok ()) - retval = instance->do_get_pixels (hnd2idx (gh)); + retval = s_instance->do_get_pixels (hnd2idx (gh)); return retval; } @@ -1986,38 +1986,38 @@ const graphics_handle& uimenuh, int id) { if (instance_ok ()) - instance->do_uimenu_update (hnd2idx (figh), uimenuh, id); + s_instance->do_uimenu_update (hnd2idx (figh), uimenuh, id); } static void update_canvas (const graphics_handle& gh, const graphics_handle& ca) { if (instance_ok ()) - instance->do_update_canvas (hnd2idx (gh), ca); + s_instance->do_update_canvas (hnd2idx (gh), ca); } static void update_boundingbox (const std::string& fig_idx_str, bool internal) { if (instance_ok ()) - instance->do_update_boundingbox (str2idx (fig_idx_str), internal); + s_instance->do_update_boundingbox (str2idx (fig_idx_str), internal); } static void toggle_menubar_visibility (const std::string& fig_idx_str, bool menubar_is_figure) { if (instance_ok ()) - instance->do_toggle_menubar_visibility (str2idx (fig_idx_str), + s_instance->do_toggle_menubar_visibility (str2idx (fig_idx_str), menubar_is_figure); } private: - static figure_manager *instance; + static figure_manager *s_instance; // Singleton -- hide all of the above. - static int curr_index; + static int s_curr_index; typedef std::map<int, plot_window *> window_map; @@ -2025,7 +2025,7 @@ window_map m_windows; - static std::string fltk_idx_header; + static std::string s_fltk_idx_header; void do_close_all () { @@ -2054,9 +2054,9 @@ pos = fp.get_boundingbox (internal); } - idx2figprops (curr_index, fp); - - m_windows[curr_index++] = new plot_window (pos(0), pos(1), pos(2), pos(3), + idx2figprops (s_curr_index, fp); + + m_windows[s_curr_index++] = new plot_window (pos(0), pos(1), pos(2), pos(3), fp, internal); } } @@ -2196,9 +2196,9 @@ static int str2idx (const caseless_str& clstr) { int ind; - if (clstr.find (fltk_idx_header, 0) == 0) + if (clstr.find (s_fltk_idx_header, 0) == 0) { - std::istringstream istr (clstr.substr (fltk_idx_header.size ())); + std::istringstream istr (clstr.substr (s_fltk_idx_header.size ())); if (istr >> ind) return ind; } @@ -2209,7 +2209,7 @@ void idx2figprops (int idx, figure::properties& fp) { std::ostringstream ind_str; - ind_str << fltk_idx_header << idx; + ind_str << s_fltk_idx_header << idx; fp.set___plot_stream__ (ind_str.str ()); } @@ -2249,10 +2249,10 @@ } }; -figure_manager *figure_manager::instance = nullptr; - -std::string figure_manager::fltk_idx_header="fltk index="; -int figure_manager::curr_index = 1; +figure_manager *figure_manager::s_instance = nullptr; + +std::string figure_manager::s_fltk_idx_header="fltk index="; +int figure_manager::s_curr_index = 1; static bool toolkit_loaded = false;
--- a/libinterp/octave-value/ov-base.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/octave-value/ov-base.cc Mon Feb 20 18:06:54 2023 -0800 @@ -1101,7 +1101,7 @@ warning_with_id ("Octave:load-save-unavailable", "%s: loading %s files not available in this version of Octave", - t_name.c_str (), type); + s_t_name.c_str (), type); } void @@ -1110,7 +1110,7 @@ warning_with_id ("Octave:load-save-unavailable", "%s: saving %s files not available in this version of Octave", - t_name.c_str (), type); + s_t_name.c_str (), type); } void
--- a/libinterp/octave-value/ov-base.h Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/octave-value/ov-base.h Mon Feb 20 18:06:54 2023 -0800 @@ -186,31 +186,31 @@ #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(VIRTUAL) \ public: \ - VIRTUAL int type_id () const { return t_id; } \ - VIRTUAL std::string type_name () const { return t_name; } \ - VIRTUAL std::string class_name () const { return c_name; } \ - static int static_type_id () { return t_id; } \ - static std::string static_type_name () { return t_name; } \ - static std::string static_class_name () { return c_name; } \ + VIRTUAL int type_id () const { return s_t_id; } \ + VIRTUAL std::string type_name () const { return s_t_name; } \ + VIRTUAL std::string class_name () const { return s_c_name; } \ + static int static_type_id () { return s_t_id; } \ + static std::string static_type_name () { return s_t_name; } \ + static std::string static_class_name () { return s_c_name; } \ static void register_type (); \ static void register_type (octave::type_info&); \ \ private: \ - static int t_id; \ - static const std::string t_name; \ - static const std::string c_name; + static int s_t_id; \ + static const std::string s_t_name; \ + static const std::string s_c_name; #define DECLARE_TEMPLATE_OV_TYPEID_SPECIALIZATIONS(cls, type) \ template <> void cls<type>::register_type (); \ template <> void cls<type>::register_type (octave::type_info&); \ - template <> int cls<type>::t_id; \ - template <> const std::string cls<type>::t_name; \ - template <> const std::string cls<type>::c_name; + template <> int cls<type>::s_t_id; \ + template <> const std::string cls<type>::s_t_name; \ + template <> const std::string cls<type>::s_c_name; #define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA_INTERNAL(tspec, t, n, c) \ - tspec int t::t_id (-1); \ - tspec const std::string t::t_name (n); \ - tspec const std::string t::c_name (c); \ + tspec int t::s_t_id (-1); \ + tspec const std::string t::s_t_name (n); \ + tspec const std::string t::s_c_name (c); \ tspec void t::register_type () \ { \ octave::type_info& type_info = octave::__get_type_info__ (); \ @@ -220,7 +220,7 @@ tspec void t::register_type (octave::type_info& ti) \ { \ octave_value v (new t ()); \ - t_id = ti.register_type (t::t_name, t::c_name, v); \ + s_t_id = ti.register_type (t::s_t_name, t::s_c_name, v); \ } #define DEFINE_TEMPLATE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c) \
--- a/libinterp/octave-value/ov-class.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/octave-value/ov-class.cc Mon Feb 20 18:06:54 2023 -0800 @@ -61,14 +61,14 @@ #include "variables.h" -int octave_class::t_id (-1); - -const std::string octave_class::t_name ("class"); +int octave_class::s_t_id (-1); + +const std::string octave_class::s_t_name ("class"); void octave_class::register_type (octave::type_info& ti) { - t_id = ti.register_type (octave_class::t_name, "<unknown>", + s_t_id = ti.register_type (octave_class::s_t_name, "<unknown>", octave_value (new octave_class ())); }
--- a/libinterp/octave-value/ov-class.h Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/octave-value/ov-class.h Mon Feb 20 18:06:54 2023 -0800 @@ -220,19 +220,19 @@ octave_map m_map; public: - int type_id () const { return t_id; } - std::string type_name () const { return t_name; } + int type_id () const { return s_t_id; } + std::string type_name () const { return s_t_name; } std::string class_name () const { return m_c_name; } - static int static_type_id () { return t_id; } - static std::string static_type_name () { return t_name; } + static int static_type_id () { return s_t_id; } + static std::string static_type_name () { return s_t_name; } static std::string static_class_name () { return "<unknown>"; } static OCTINTERP_API void register_type (octave::type_info&); private: - static int t_id; + static int s_t_id; - static const std::string t_name; + static const std::string s_t_name; std::string m_c_name; std::list<std::string> m_parent_list;
--- a/libinterp/octave-value/ov-classdef.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/octave-value/ov-classdef.cc Mon Feb 20 18:06:54 2023 -0800 @@ -57,14 +57,14 @@ return (ctx.ok () && octave::is_superclass (ctx, cls)); } -int octave_classdef::t_id (-1); +int octave_classdef::s_t_id (-1); -const std::string octave_classdef::t_name ("object"); +const std::string octave_classdef::s_t_name ("object"); void octave_classdef::register_type (octave::type_info& ti) { - t_id = ti.register_type (octave_classdef::t_name, "<unknown>", + s_t_id = ti.register_type (octave_classdef::s_t_name, "<unknown>", octave_value (new octave_classdef ())); }
--- a/libinterp/octave-value/ov-classdef.h Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/octave-value/ov-classdef.h Mon Feb 20 18:06:54 2023 -0800 @@ -147,12 +147,12 @@ public: - int type_id () const { return t_id; } - std::string type_name () const { return t_name; } + int type_id () const { return s_t_id; } + std::string type_name () const { return s_t_name; } std::string class_name () const { return m_object.class_name (); } - static int static_type_id () { return t_id; } - static std::string static_type_name () { return t_name; } + static int static_type_id () { return s_t_id; } + static std::string static_type_name () { return s_t_name; } static std::string static_class_name () { return "<unknown>"; } static OCTINTERP_API void register_type (octave::type_info&); @@ -160,9 +160,9 @@ octave::cdef_object m_object; - static int t_id; + static int s_t_id; - static const std::string t_name; + static const std::string s_t_name; }; void install_classdef (octave::interpreter& interp);
--- a/libinterp/octave-value/ov-java.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/octave-value/ov-java.cc Mon Feb 20 18:06:54 2023 -0800 @@ -2146,16 +2146,16 @@ #endif } -int octave_java::t_id (-1); - -const std::string octave_java::t_name ("octave_java"); +int octave_java::s_t_id (-1); + +const std::string octave_java::s_t_name ("octave_java"); void octave_java::register_type (octave::type_info& ti) { #if defined (HAVE_JAVA) - t_id = ti.register_type (octave_java::t_name, "<unknown>", + s_t_id = ti.register_type (octave_java::s_t_name, "<unknown>", octave_value (new octave_java ())); #else
--- a/libinterp/octave-value/ov-java.h Sun Feb 19 20:11:39 2023 -0800 +++ b/libinterp/octave-value/ov-java.h Mon Feb 20 18:06:54 2023 -0800 @@ -180,19 +180,19 @@ public: - int type_id () const { return t_id; } - std::string type_name () const { return t_name; } + int type_id () const { return s_t_id; } + std::string type_name () const { return s_t_name; } std::string class_name () const { return m_java_classname; } - static int static_type_id () { return t_id; } - static std::string static_type_name () { return t_name; } + static int static_type_id () { return s_t_id; } + static std::string static_type_name () { return s_t_name; } static std::string static_class_name () { return "<unknown>"; } static void register_type (octave::type_info&); private: - static int t_id; - static const std::string t_name; + static int s_t_id; + static const std::string s_t_name; }; extern OCTINTERP_API bool Vjava_matrix_autoconversion;
--- a/liboctave/numeric/oct-rand.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/liboctave/numeric/oct-rand.cc Mon Feb 20 18:06:54 2023 -0800 @@ -48,7 +48,7 @@ OCTAVE_BEGIN_NAMESPACE(octave) -rand *rand::m_instance = nullptr; +rand *rand::s_instance = nullptr; rand::rand () : m_current_distribution (uniform_dist), m_use_old_generators (false), @@ -63,9 +63,9 @@ { bool retval = true; - if (! m_instance) + if (! s_instance) { - m_instance = new rand (); + s_instance = new rand (); singleton_cleanup_list::add (cleanup_instance); }
--- a/liboctave/numeric/oct-rand.h Sun Feb 19 20:11:39 2023 -0800 +++ b/liboctave/numeric/oct-rand.h Mon Feb 20 18:06:54 2023 -0800 @@ -57,27 +57,27 @@ static double seed () { return (instance_ok () - ? m_instance->do_seed () : numeric_limits<double>::NaN ()); + ? s_instance->do_seed () : numeric_limits<double>::NaN ()); } // Set the seed. static void seed (double s) { if (instance_ok ()) - m_instance->do_seed (s); + s_instance->do_seed (s); } // Reset the seed. static void reset () { if (instance_ok ()) - m_instance->do_reset (); + s_instance->do_reset (); } // Return the current state. static uint32NDArray state (const std::string& d = "") { - return instance_ok () ? m_instance->do_state (d) : uint32NDArray (); + return instance_ok () ? s_instance->do_state (d) : uint32NDArray (); } // Set the current state/ @@ -85,20 +85,20 @@ const std::string& d = "") { if (instance_ok ()) - m_instance->do_state (s, d); + s_instance->do_state (s, d); } // Reset the current state/ static void reset (const std::string& d) { if (instance_ok ()) - m_instance->do_reset (d); + s_instance->do_reset (d); } // Return the current distribution. static std::string distribution () { - return instance_ok () ? m_instance->do_distribution () : ""; + return instance_ok () ? s_instance->do_distribution () : ""; } // Set the current distribution. May be either "uniform" (the @@ -106,70 +106,70 @@ static void distribution (const std::string& d) { if (instance_ok ()) - m_instance->do_distribution (d); + s_instance->do_distribution (d); } static void uniform_distribution () { if (instance_ok ()) - m_instance->do_uniform_distribution (); + s_instance->do_uniform_distribution (); } static void normal_distribution () { if (instance_ok ()) - m_instance->do_normal_distribution (); + s_instance->do_normal_distribution (); } static void exponential_distribution () { if (instance_ok ()) - m_instance->do_exponential_distribution (); + s_instance->do_exponential_distribution (); } static void poisson_distribution () { if (instance_ok ()) - m_instance->do_poisson_distribution (); + s_instance->do_poisson_distribution (); } static void gamma_distribution () { if (instance_ok ()) - m_instance->do_gamma_distribution (); + s_instance->do_gamma_distribution (); } // Return the next number from the sequence. static double scalar (double a = 1.0) { return (instance_ok () - ? m_instance->do_scalar (a) : numeric_limits<double>::NaN ()); + ? s_instance->do_scalar (a) : numeric_limits<double>::NaN ()); } // Return the next number from the sequence. static float float_scalar (float a = 1.0) { return (instance_ok () - ? m_instance->do_scalar (a) : numeric_limits<float>::NaN ()); + ? s_instance->do_scalar (a) : numeric_limits<float>::NaN ()); } // Return an array of numbers from the sequence. static Array<double> vector (octave_idx_type n, double a = 1.0) { - return instance_ok () ? m_instance->do_vector (n, a) : Array<double> (); + return instance_ok () ? s_instance->do_vector (n, a) : Array<double> (); } // Return an array of numbers from the sequence. static Array<float> float_vector (octave_idx_type n, float a = 1.0) { - return instance_ok () ? m_instance->do_vector (n, a) : Array<float> (); + return instance_ok () ? s_instance->do_vector (n, a) : Array<float> (); } // Return an N-dimensional array of numbers from the sequence, // filled in column major order. static NDArray nd_array (const dim_vector& dims, double a = 1.0) { - return instance_ok () ? m_instance->do_nd_array (dims, a) : NDArray (); + return instance_ok () ? s_instance->do_nd_array (dims, a) : NDArray (); } // Return an N-dimensional array of numbers from the sequence, @@ -177,15 +177,15 @@ static FloatNDArray float_nd_array (const dim_vector& dims, float a = 1.0) { return (instance_ok () - ? m_instance->do_float_nd_array (dims, a) : FloatNDArray ()); + ? s_instance->do_float_nd_array (dims, a) : FloatNDArray ()); } private: - static rand *m_instance; + static rand *s_instance; static void cleanup_instance () - { delete m_instance; m_instance = nullptr; } + { delete s_instance; s_instance = nullptr; } enum {
--- a/liboctave/system/oct-env.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/liboctave/system/oct-env.cc Mon Feb 20 18:06:54 2023 -0800 @@ -83,16 +83,16 @@ do_get_host_name (); } -env *env::m_instance = nullptr; +env *env::s_instance = nullptr; bool env::instance_ok () { bool retval = true; - if (! m_instance) + if (! s_instance) { - m_instance = new env (); + s_instance = new env (); singleton_cleanup_list::add (cleanup_instance); } @@ -103,105 +103,105 @@ env::polite_directory_format (const std::string& name) { return (instance_ok ()) - ? m_instance->do_polite_directory_format (name) : ""; + ? s_instance->do_polite_directory_format (name) : ""; } bool env::absolute_pathname (const std::string& s) { return (instance_ok ()) - ? m_instance->do_absolute_pathname (s) : false; + ? s_instance->do_absolute_pathname (s) : false; } bool env::rooted_relative_pathname (const std::string& s) { return (instance_ok ()) - ? m_instance->do_rooted_relative_pathname (s) : false; + ? s_instance->do_rooted_relative_pathname (s) : false; } std::string env::base_pathname (const std::string& s) { return (instance_ok ()) - ? m_instance->do_base_pathname (s) : ""; + ? s_instance->do_base_pathname (s) : ""; } std::string env::make_absolute (const std::string& s, const std::string& dot_path) { return (instance_ok ()) - ? m_instance->do_make_absolute (s, dot_path) : ""; + ? s_instance->do_make_absolute (s, dot_path) : ""; } std::string env::get_current_directory () { return (instance_ok ()) - ? m_instance->do_getcwd () : ""; + ? s_instance->do_getcwd () : ""; } std::string env::get_home_directory () { return (instance_ok ()) - ? m_instance->do_get_home_directory () : ""; + ? s_instance->do_get_home_directory () : ""; } std::string env::get_temp_directory () { return (instance_ok ()) - ? m_instance->do_get_temp_directory () : ""; + ? s_instance->do_get_temp_directory () : ""; } std::string env::get_user_config_directory () { return (instance_ok ()) - ? m_instance->do_get_user_config_directory () : ""; + ? s_instance->do_get_user_config_directory () : ""; } std::string env::get_user_data_directory () { return (instance_ok ()) - ? m_instance->do_get_user_data_directory () : ""; + ? s_instance->do_get_user_data_directory () : ""; } std::string env::get_program_name () { return (instance_ok ()) - ? m_instance->m_prog_name : ""; + ? s_instance->m_prog_name : ""; } std::string env::get_program_invocation_name () { return (instance_ok ()) - ? m_instance->m_prog_invocation_name : ""; + ? s_instance->m_prog_invocation_name : ""; } void env::set_program_name (const std::string& s) { if (instance_ok ()) - m_instance->do_set_program_name (s); + s_instance->do_set_program_name (s); } std::string env::get_user_name () { return (instance_ok ()) - ? m_instance->do_get_user_name () : ""; + ? s_instance->do_get_user_name () : ""; } std::string env::get_host_name () { return (instance_ok ()) - ? m_instance->do_get_host_name () : ""; + ? s_instance->do_get_host_name () : ""; } std::string @@ -296,7 +296,7 @@ env::getenv (const std::string& name) { return (instance_ok ()) - ? m_instance->do_getenv (name) : ""; + ? s_instance->do_getenv (name) : ""; } void @@ -317,7 +317,7 @@ env::chdir (const std::string& newdir) { return (instance_ok ()) - ? m_instance->do_chdir (newdir) : false; + ? s_instance->do_chdir (newdir) : false; } void
--- a/liboctave/system/oct-env.h Sun Feb 19 20:11:39 2023 -0800 +++ b/liboctave/system/oct-env.h Mon Feb 20 18:06:54 2023 -0800 @@ -130,10 +130,10 @@ void error (const std::string&) const; // The real thing. - static env *m_instance; + static env *s_instance; static void cleanup_instance () - { delete m_instance; m_instance = nullptr; } + { delete s_instance; s_instance = nullptr; } // TRUE means follow symbolic links that point to directories just // as if they are real directories.
--- a/liboctave/util/cmd-edit.cc Sun Feb 19 20:11:39 2023 -0800 +++ b/liboctave/util/cmd-edit.cc Mon Feb 20 18:06:54 2023 -0800 @@ -58,11 +58,11 @@ command_editor *command_editor::s_instance = nullptr; -std::set<command_editor::startup_hook_fcn> command_editor::m_startup_hook_set; +std::set<command_editor::startup_hook_fcn> command_editor::s_startup_hook_set; -std::set<command_editor::pre_input_hook_fcn> command_editor::m_pre_input_hook_set; +std::set<command_editor::pre_input_hook_fcn> command_editor::s_pre_input_hook_set; -std::set<command_editor::event_hook_fcn> command_editor::m_event_hook_set; +std::set<command_editor::event_hook_fcn> command_editor::s_event_hook_set; static mutex event_hook_lock; @@ -1124,7 +1124,7 @@ // Iterate over a copy of the set to avoid problems if a hook // function attempts to remove itself from the startup_hook_set. - std::set<startup_hook_fcn> hook_set = m_startup_hook_set; + std::set<startup_hook_fcn> hook_set = s_startup_hook_set; for (startup_hook_fcn f : hook_set) { @@ -1141,7 +1141,7 @@ // Iterate over copy of the set to avoid problems if a hook function // attempts to remove itself from the pre_input_hook_set. - std::set<pre_input_hook_fcn> hook_set = m_pre_input_hook_set; + std::set<pre_input_hook_fcn> hook_set = s_pre_input_hook_set; for (pre_input_hook_fcn f : hook_set) { @@ -1160,7 +1160,7 @@ event_hook_lock.lock (); - std::set<event_hook_fcn> hook_set (m_event_hook_set); + std::set<event_hook_fcn> hook_set (s_event_hook_set); event_hook_lock.unlock (); @@ -1506,7 +1506,7 @@ { if (instance_ok ()) { - m_startup_hook_set.insert (f); + s_startup_hook_set.insert (f); s_instance->set_startup_hook (startup_handler); } @@ -1517,12 +1517,12 @@ { if (instance_ok ()) { - auto p = m_startup_hook_set.find (f); + auto p = s_startup_hook_set.find (f); - if (p != m_startup_hook_set.end ()) - m_startup_hook_set.erase (p); + if (p != s_startup_hook_set.end ()) + s_startup_hook_set.erase (p); - if (m_startup_hook_set.empty ()) + if (s_startup_hook_set.empty ()) s_instance->restore_startup_hook (); } } @@ -1532,7 +1532,7 @@ { if (instance_ok ()) { - m_pre_input_hook_set.insert (f); + s_pre_input_hook_set.insert (f); s_instance->set_pre_input_hook (pre_input_handler); } @@ -1543,12 +1543,12 @@ { if (instance_ok ()) { - auto p = m_pre_input_hook_set.find (f); + auto p = s_pre_input_hook_set.find (f); - if (p != m_pre_input_hook_set.end ()) - m_pre_input_hook_set.erase (p); + if (p != s_pre_input_hook_set.end ()) + s_pre_input_hook_set.erase (p); - if (m_pre_input_hook_set.empty ()) + if (s_pre_input_hook_set.empty ()) s_instance->restore_pre_input_hook (); } } @@ -1558,7 +1558,7 @@ { autolock guard (event_hook_lock); - m_event_hook_set.insert (f); + s_event_hook_set.insert (f); } void @@ -1566,10 +1566,10 @@ { autolock guard (event_hook_lock); - auto p = m_event_hook_set.find (f); + auto p = s_event_hook_set.find (f); - if (p != m_event_hook_set.end ()) - m_event_hook_set.erase (p); + if (p != s_event_hook_set.end ()) + s_event_hook_set.erase (p); }
--- a/liboctave/util/cmd-edit.h Sun Feb 19 20:11:39 2023 -0800 +++ b/liboctave/util/cmd-edit.h Mon Feb 20 18:06:54 2023 -0800 @@ -227,9 +227,9 @@ static command_editor *s_instance; // the real thing. - static std::set<startup_hook_fcn> m_startup_hook_set; - static std::set<pre_input_hook_fcn> m_pre_input_hook_set; - static std::set<event_hook_fcn> m_event_hook_set; + static std::set<startup_hook_fcn> s_startup_hook_set; + static std::set<pre_input_hook_fcn> s_pre_input_hook_set; + static std::set<event_hook_fcn> s_event_hook_set; protected:
--- a/liboctave/util/oct-inttypes.h Sun Feb 19 20:11:39 2023 -0800 +++ b/liboctave/util/oct-inttypes.h Mon Feb 20 18:06:54 2023 -0800 @@ -109,8 +109,7 @@ #undef OCTAVE_REGISTER_INT_TYPE -// Handles non-homogeneous integer comparisons. Avoids doing useless -// tests. +// Handles non-homogeneous integer comparisons. Avoids doing useless tests. class octave_int_cmp_op { @@ -124,22 +123,22 @@ class prom { // Promote to int? - static const bool pint = (sizeof (T1) < sizeof (int) + static const bool s_pint = (sizeof (T1) < sizeof (int) && sizeof (T2) < sizeof (int)); - static const bool t1sig = std::numeric_limits<T1>::is_signed; - static const bool t2sig = std::numeric_limits<T2>::is_signed; + static const bool s_t1sig = std::numeric_limits<T1>::is_signed; + static const bool s_t2sig = std::numeric_limits<T2>::is_signed; - static const bool psig - = (pint || (sizeof (T2) > sizeof (T1) && t2sig) || t1sig); + static const bool s_psig + = (s_pint || (sizeof (T2) > sizeof (T1) && s_t2sig) || s_t1sig); - static const int psize - = (pint + static const int s_psize + = (s_pint ? sizeof (int) : (sizeof (T2) > sizeof (T1) ? sizeof (T2) : sizeof (T1))); public: - typedef typename query_integer_type<psize, psig>::type type; + typedef typename query_integer_type<s_psize, s_psig>::type type; }; // Implements comparisons between two types of equal size but