changeset 30148:870687a59e96

maint: use "s_" prefix for static variables in class octave_base_value. * ov-base.cc, ov-base.h: Use "s_" prefix for static variables in class octave_base_value.
author Rik <rik@octave.org>
date Thu, 09 Sep 2021 20:12:01 -0700
parents 4f039927308b
children bba8b70c201f
files libinterp/octave-value/ov-base.cc libinterp/octave-value/ov-base.h
diffstat 2 files changed, 17 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-base.cc	Thu Sep 09 20:07:29 2021 -0700
+++ b/libinterp/octave-value/ov-base.cc	Thu Sep 09 20:12:01 2021 -0700
@@ -1343,10 +1343,10 @@
 }
 
 // Current indentation.
-int octave_base_value::curr_print_indent_level = 0;
+int octave_base_value::s_curr_print_indent_level = 0;
 
 // TRUE means we are at the beginning of a line.
-bool octave_base_value::beginning_of_line = true;
+bool octave_base_value::s_beginning_of_line = true;
 
 // Each print() function should call this before printing anything.
 //
@@ -1355,17 +1355,17 @@
 void
 octave_base_value::indent (std::ostream& os) const
 {
-  assert (curr_print_indent_level >= 0);
+  assert (s_curr_print_indent_level >= 0);
 
-  if (beginning_of_line)
+  if (s_beginning_of_line)
     {
       // FIXME: do we need this?
       // os << prefix;
 
-      for (int i = 0; i < curr_print_indent_level; i++)
+      for (int i = 0; i < s_curr_print_indent_level; i++)
         os << ' ';
 
-      beginning_of_line = false;
+      s_beginning_of_line = false;
     }
 }
 
@@ -1376,7 +1376,7 @@
 {
   os << "\n";
 
-  beginning_of_line = true;
+  s_beginning_of_line = true;
 }
 
 // For resetting print state.
@@ -1384,8 +1384,8 @@
 void
 octave_base_value::reset (void) const
 {
-  beginning_of_line = true;
-  curr_print_indent_level = 0;
+  s_beginning_of_line = true;
+  s_curr_print_indent_level = 0;
 }
 
 octave_value
--- a/libinterp/octave-value/ov-base.h	Thu Sep 09 20:07:29 2021 -0700
+++ b/libinterp/octave-value/ov-base.h	Thu Sep 09 20:12:01 2021 -0700
@@ -873,16 +873,16 @@
                   const octave_value& rhs);
 
   void reset_indent_level (void) const
-  { curr_print_indent_level = 0; }
+  { s_curr_print_indent_level = 0; }
 
   void increment_indent_level (void) const
-  { curr_print_indent_level += 2; }
+  { s_curr_print_indent_level += 2; }
 
   void decrement_indent_level (void) const
-  { curr_print_indent_level -= 2; }
+  { s_curr_print_indent_level -= 2; }
 
   int current_print_indent_level (void) const
-  { return curr_print_indent_level; }
+  { return s_curr_print_indent_level; }
 
   OCTINTERP_API void indent (std::ostream& os) const;
 
@@ -905,8 +905,10 @@
 
   OCTINTERP_API void wrong_type_arg_error (void) const;
 
-  static int curr_print_indent_level;
-  static bool beginning_of_line;
+  //--------
+
+  static int s_curr_print_indent_level;
+  static bool s_beginning_of_line;
 
   DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA
 };