# HG changeset patch # User Rik # Date 1629937732 25200 # Node ID bffdbda91d28ee2cae8d3d27d9d1019e0a6a7bec # Parent 35a58caf1ab9a0cebca6ea5113a5c2681bd1cd48 maint: use "m_" prefix for member variables in child, child_list classes * ODESFunc.h: Use "m_" prefix for member variables. * child-list.cc, child-list.h: use "m_" prefix for member variables in child, child_list classes. diff -r 35a58caf1ab9 -r bffdbda91d28 liboctave/system/child-list.cc --- a/liboctave/system/child-list.cc Wed Aug 25 15:56:02 2021 -0700 +++ b/liboctave/system/child-list.cc Wed Aug 25 17:28:52 2021 -0700 @@ -38,21 +38,21 @@ pid_equal (pid_t v) : val (v) { } - bool operator () (const child& oc) const { return oc.pid == val; } + bool operator () (const child& oc) const { return oc.m_pid == val; } private: pid_t val; }; - void child_list::remove (pid_t pid) + void child_list::remove (pid_t m_pid) { - m_list.remove_if (pid_equal (pid)); + m_list.remove_if (pid_equal (m_pid)); } - void child_list::child_list::insert (pid_t pid, child::child_event_handler f) + void child_list::child_list::insert (pid_t m_pid, child::child_event_handler f) { - m_list.append (child (pid, f)); + m_list.append (child (m_pid, f)); } void child_list::reap (void) @@ -66,14 +66,14 @@ // child_list::remove), so we increment the iterator // here. - if (oc.have_status) + if (oc.m_have_status) { - oc.have_status = 0; + oc.m_have_status = 0; - child::child_event_handler f = oc.handler; + child::child_event_handler f = oc.m_handler; - if (f && f (oc.pid, oc.status)) - oc.pid = -1; + if (f && f (oc.m_pid, oc.m_status)) + oc.m_pid = -1; } } @@ -81,7 +81,7 @@ remove (-1); } - // Wait on our children and record any changes in their status. + // Wait on our children and record any changes in their m_status. bool child_list::wait (void) { @@ -89,17 +89,17 @@ for (auto& oc : m_list) { - pid_t pid = oc.pid; + pid_t m_pid = oc.m_pid; - if (pid > 0) + if (m_pid > 0) { - int status; + int m_status; - if (sys::waitpid (pid, &status, sys::wnohang ()) > 0) + if (sys::waitpid (m_pid, &m_status, sys::wnohang ()) > 0) { - oc.have_status = 1; + oc.m_have_status = 1; - oc.status = status; + oc.m_status = m_status; retval = true; diff -r 35a58caf1ab9 -r bffdbda91d28 liboctave/system/child-list.h --- a/liboctave/system/child-list.h Wed Aug 25 15:56:02 2021 -0700 +++ b/liboctave/system/child-list.h Wed Aug 25 17:28:52 2021 -0700 @@ -49,7 +49,7 @@ typedef bool (*child_event_handler) (pid_t, int); child (pid_t id = -1, child_event_handler f = nullptr) - : pid (id), handler (f), have_status (0), status (0) + : m_pid (id), m_handler (f), m_have_status (0), m_status (0) { } child (const child&) = default; @@ -59,17 +59,17 @@ ~child (void) = default; // The process id of this child. - pid_t pid; + pid_t m_pid; // The function we call if an event happens for this child. - child_event_handler handler; + child_event_handler m_handler; // Nonzero if this child has stopped or terminated. - sig_atomic_t have_status; + sig_atomic_t m_have_status; - // The status of this child; 0 if running, otherwise a status value + // The m_status of this child; 0 if running, otherwise a m_status value // from waitpid. - int status; + int m_status; }; class OCTAVE_API child_list @@ -78,9 +78,9 @@ child_list (void) { } - void insert (pid_t pid, child::child_event_handler f); + void insert (pid_t m_pid, child::child_event_handler f); - void remove (pid_t pid); + void remove (pid_t m_pid); void reap (void);