changeset 30063:a8c61e096c68

maint: clean up some variable renamings in cset bffdbda91d28 * child-list.cc, child-list.h: Don't use "m_" prefix within function prototypes or for function parameters.
author Rik <rik@octave.org>
date Sun, 29 Aug 2021 19:59:28 -0700
parents 7215f2324c8a
children 0d32dcc699cd
files liboctave/system/child-list.cc liboctave/system/child-list.h
diffstat 2 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/system/child-list.cc	Sun Aug 29 19:58:26 2021 -0700
+++ b/liboctave/system/child-list.cc	Sun Aug 29 19:59:28 2021 -0700
@@ -45,14 +45,14 @@
     pid_t val;
   };
 
-  void child_list::remove (pid_t m_pid)
+  void child_list::remove (pid_t pid)
   {
-    m_list.remove_if (pid_equal (m_pid));
+    m_list.remove_if (pid_equal (pid));
   }
 
-  void child_list::child_list::insert (pid_t m_pid, child::child_event_handler f)
+  void child_list::child_list::insert (pid_t pid, child::child_event_handler f)
   {
-    m_list.append (child (m_pid, f));
+    m_list.append (child (pid, f));
   }
 
   void child_list::reap (void)
@@ -77,11 +77,11 @@
           }
       }
 
-    // ??
+    // Remove PIDs that have completed above.
     remove (-1);
   }
 
-  // Wait on our children and record any changes in their m_status.
+  // Wait on our children and record any changes in their status.
 
   bool child_list::wait (void)
   {
@@ -89,17 +89,17 @@
 
     for (auto& oc : m_list)
       {
-        pid_t m_pid = oc.m_pid;
+        pid_t pid = oc.m_pid;
 
-        if (m_pid > 0)
+        if (pid > 0)
           {
-            int m_status;
+            int status;
 
-            if (sys::waitpid (m_pid, &m_status, sys::wnohang ()) > 0)
+            if (sys::waitpid (pid, &status, sys::wnohang ()) > 0)
               {
                 oc.m_have_status = 1;
 
-                oc.m_status = m_status;
+                oc.m_status = status;
 
                 retval = true;
 
--- a/liboctave/system/child-list.h	Sun Aug 29 19:58:26 2021 -0700
+++ b/liboctave/system/child-list.h	Sun Aug 29 19:59:28 2021 -0700
@@ -48,8 +48,8 @@
 
     typedef bool (*child_event_handler) (pid_t, int);
 
-    child (pid_t id = -1, child_event_handler f = nullptr)
-      : m_pid (id), m_handler (f), m_have_status (0), m_status (0)
+    child (pid_t pid = -1, child_event_handler f = nullptr)
+      : m_pid (pid), m_handler (f), m_have_status (0), m_status (0)
     { }
 
     child (const child&) = default;
@@ -58,7 +58,7 @@
 
     ~child (void) = default;
 
-    // The process id of this child.
+    // The process ID of this child.
     pid_t m_pid;
 
     // The function we call if an event happens for this child.
@@ -78,9 +78,9 @@
 
     child_list (void) { }
 
-    void insert (pid_t m_pid, child::child_event_handler f);
+    void insert (pid_t pid, child::child_event_handler f);
 
-    void remove (pid_t m_pid);
+    void remove (pid_t pid);
 
     void reap (void);