diff options
author | Jim Warner <james.warner@comcast.net> | 2016-07-07 00:00:00 -0500 |
---|---|---|
committer | Craig Small <csmall@enc.com.au> | 2016-07-09 12:48:28 +1000 |
commit | 9bea1b2def1843da9f4e04135a26e0f561c0baf2 (patch) | |
tree | 9db51e51c00e74dfb7ee368958c1ca053be4508c | |
parent | a6115bfff4e91766d7295658d864d391cb9d73da (diff) | |
download | procps-ng-9bea1b2def1843da9f4e04135a26e0f561c0baf2.tar.gz |
library: the overlooked twerks (oops, tweaks), 3rd gen
Yes, all of these changes are strictly cosmetic. It is
likely symptomatic of some deep-seated character flaw.
[ or, it might be because of a certain pride in this ]
[ new library and the desire to make it even better! ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
-rw-r--r-- | proc/meminfo.c | 2 | ||||
-rw-r--r-- | proc/pids.c | 15 | ||||
-rw-r--r-- | proc/slabinfo.c | 6 | ||||
-rw-r--r-- | proc/vmstat.c | 2 |
4 files changed, 13 insertions, 12 deletions
diff --git a/proc/meminfo.c b/proc/meminfo.c index 302c2c6..0a7b405 100644 --- a/proc/meminfo.c +++ b/proc/meminfo.c @@ -386,8 +386,8 @@ static inline void cleanup_stack ( static inline void cleanup_stacks_all ( struct procps_meminfo *info) { - int i; struct stacks_extent *ext = info->extents; + int i; while (ext) { for (i = 0; ext->stacks[i]; i++) diff --git a/proc/pids.c b/proc/pids.c index 0e36ed1..0881c66 100644 --- a/proc/pids.c +++ b/proc/pids.c @@ -263,7 +263,7 @@ setDECL(WCHAN_NAME) { (void)I; R->result.str = strdup(lookup_wchan(P->tid)); } // ___ Free Storage Support ||||||||||||||||||||||||||||||||||||||||||||||||||| -#define freNAME(e) free_results_ ## e +#define freNAME(t) free_results_ ## t static void freNAME(str) (struct pids_result *R) { if (R->result.str) free(R->result.str); @@ -365,7 +365,7 @@ typedef void (*FRE_t)(struct pids_result *); typedef int (*QSR_t)(const void *, const void *, void *); #define RS(e) (SET_t)setNAME(e) -#define FF(e) (FRE_t)freNAME(e) +#define FF(t) (FRE_t)freNAME(t) #define QS(t) (QSR_t)srtNAME(t) /* @@ -505,7 +505,8 @@ static struct { { NULL, 0, NULL, NULL, 0 } }; - // next MUST be kept in sync with highest value enum + /* please note, + * this enum MUST be 1 greater than the highest value of any enum */ enum pids_item PROCPS_PIDS_logical_end = PROCPS_PIDS_WCHAN_NAME + 1; #undef setNAME @@ -590,7 +591,8 @@ static inline HST_t *histget ( while (-1 < V) { if (Hr(PHist_sav[V].pid) == pid) return &Hr(PHist_sav[V]); - V = Hr(PHist_sav[V].lnk); } + V = Hr(PHist_sav[V].lnk); + } return NULL; } // end: histget @@ -869,7 +871,7 @@ static void itemize_stacks_all ( ext = ext->next; }; info->dirty_stacks = 0; -} +} // end: itemize_stacks_all static inline int items_check_failed ( @@ -950,7 +952,6 @@ static inline int oldproc_open ( if (NULL == (*this = openproc(flags, ids, num))) return 0; } - return 1; } // end: oldproc_open @@ -1437,7 +1438,7 @@ PROCPS_EXPORT struct pids_fetch *procps_pids_select ( /* * procps_pids_sort(): * - * Sort stacks anchored in the passed pids_stack pointers array + * Sort stacks anchored in the passed stack pointers array * based on the designated sort enumerator and specified order. * * Returns those same addresses sorted. diff --git a/proc/slabinfo.c b/proc/slabinfo.c index 7633ad7..85f03c5 100644 --- a/proc/slabinfo.c +++ b/proc/slabinfo.c @@ -536,8 +536,8 @@ static inline void cleanup_stack ( static inline void cleanup_stacks_all ( struct ext_support *this) { - int i; struct stacks_extent *ext = this->extents; + int i; while (ext) { for (i = 0; ext->stacks[i]; i++) @@ -958,8 +958,8 @@ PROCPS_EXPORT struct slabinfo_stack *procps_slabinfo_select ( /* * procps_slabinfo_sort(): * - * Sort stacks anchored as 'heads' in the passed slabinfo_stack pointers - * array based on the designated sort enumerator. + * Sort stacks anchored in the passed stack pointers array + * based on the designated sort enumerator and specified order. * * Returns those same addresses sorted. * diff --git a/proc/vmstat.c b/proc/vmstat.c index e9b4506..7d0012e 100644 --- a/proc/vmstat.c +++ b/proc/vmstat.c @@ -751,8 +751,8 @@ static inline void cleanup_stack ( static inline void cleanup_stacks_all ( struct procps_vmstat *info) { - int i; struct stacks_extent *ext = info->extents; + int i; while (ext) { for (i = 0; ext->stacks[i]; i++) |