changeset 30124:041dbcd1f93b

maint: use "m_" prefix for member variables in class procbuf. * oct-procbuf.cc, oct-procbuf.h: use "m_" prefix for member variables in class procbuf.
author Rik <rik@octave.org>
date Mon, 06 Sep 2021 11:30:45 -0700
parents fa65184b7c76
children 8dd5da409418
files libinterp/corefcn/oct-procbuf.cc libinterp/corefcn/oct-procbuf.h
diffstat 2 files changed, 27 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/oct-procbuf.cc	Mon Sep 06 11:06:00 2021 -0700
+++ b/libinterp/corefcn/oct-procbuf.cc	Mon Sep 06 11:30:45 2021 -0700
@@ -90,9 +90,9 @@
 
   // Oops... popen doesn't return the associated pid, so fake it for now
 
-  proc_pid = 1;
+  m_proc_pid = 1;
 
-  open_p = true;
+  m_open_p = true;
 
   if (mode & std::ios::out)
     ::setvbuf (f, nullptr, _IOLBF, BUFSIZ);
@@ -124,9 +124,9 @@
       child_end = pipe_fds[0];
     }
 
-  proc_pid = ::fork ();
+  m_proc_pid = ::fork ();
 
-  if (proc_pid == 0)
+  if (m_proc_pid == 0)
     {
       octave_close_wrapper (parent_end);
 
@@ -146,7 +146,7 @@
               fp = nullptr;
             }
 
-          procbuf_list = procbuf_list->next;
+          procbuf_list = procbuf_list->m_next;
         }
 
       execl (SHELL_PATH, "sh", "-c", command, static_cast<void *> (nullptr));
@@ -156,7 +156,7 @@
 
   octave_close_wrapper (child_end);
 
-  if (proc_pid < 0)
+  if (m_proc_pid < 0)
     {
       octave_close_wrapper (parent_end);
       return nullptr;
@@ -167,9 +167,9 @@
   if (mode & std::ios::out)
     ::setvbuf (f, nullptr, _IOLBF, BUFSIZ);
 
-  open_p = true;
+  m_open_p = true;
 
-  next = procbuf_list;
+  m_next = procbuf_list;
   procbuf_list = this;
 
   return this;
@@ -188,11 +188,11 @@
 
   if (f)
     {
-      wstatus = octave::pclose (f);
+      m_wstatus = octave::pclose (f);
       f = 0;
     }
 
-  open_p = false;
+  m_open_p = false;
 
   return this;
 
@@ -206,11 +206,11 @@
 
       for (procbuf **ptr = &procbuf_list;
            *ptr != nullptr;
-           ptr = &(*ptr)->next)
+           ptr = &(*ptr)->m_next)
         {
           if (*ptr == this)
             {
-              *ptr = (*ptr)->next;
+              *ptr = (*ptr)->m_next;
               status = 0;
               break;
             }
@@ -222,7 +222,7 @@
 
           do
             {
-              wait_pid = octave::sys::waitpid (proc_pid, &wstatus, 0);
+              wait_pid = octave::sys::waitpid (m_proc_pid, &m_wstatus, 0);
             }
           while (wait_pid == -1 && errno == EINTR);
         }
@@ -230,7 +230,7 @@
       f = nullptr;
     }
 
-  open_p = false;
+  m_open_p = false;
 
   return this;
 
--- a/libinterp/corefcn/oct-procbuf.h	Mon Sep 06 11:06:00 2021 -0700
+++ b/libinterp/corefcn/oct-procbuf.h	Mon Sep 06 11:30:45 2021 -0700
@@ -43,12 +43,14 @@
 public:
 
   procbuf (void)
-    : c_file_ptr_buf (nullptr), wstatus (-1), open_p (false), proc_pid (-1),
-      next (nullptr) { }
+    : c_file_ptr_buf (nullptr), m_wstatus (-1), m_open_p (false),
+      m_proc_pid (-1), m_next (nullptr)
+  { }
 
   procbuf (const char *command, int mode)
-    : c_file_ptr_buf (nullptr), wstatus (-1), open_p (false), proc_pid (-1),
-      next (nullptr) { open (command, mode); }
+    : c_file_ptr_buf (nullptr), m_wstatus (-1), m_open_p (false),
+      m_proc_pid (-1), m_next (nullptr)
+  { open (command, mode); }
 
   // No copying!
 
@@ -62,21 +64,21 @@
 
   procbuf * close (void);
 
-  int wait_status (void) const { return wstatus; }
+  int wait_status (void) const { return m_wstatus; }
 
-  bool is_open (void) const { return open_p; }
+  bool is_open (void) const { return m_open_p; }
 
-  pid_t pid (void) const { return proc_pid; }
+  pid_t pid (void) const { return m_proc_pid; }
 
 protected:
 
-  int wstatus;
+  int m_wstatus;
 
-  bool open_p;
+  bool m_open_p;
 
-  pid_t proc_pid;
+  pid_t m_proc_pid;
 
-  procbuf *next;
+  procbuf *m_next;
 };
 
 OCTAVE_NAMESPACE_END