library: more tweaks for code and/or comments, 3rd gen
Following is a summary of significant changes (if any) to each of these now upgraded 3rd gen library modules. <meminfo> ............................................ . eliminated duplicate decl of 'struct procps_meminfo' . standardized/normalized results struct union members . added 'std' & 'var' dividers in .c file, like <pids> . how did i miss relocating all these friggin' #undefs . cleanup 'get' return logic (remove a redundant 'if') <pids> ............................................... . repositioned the procps_pidsinfo structure in header . removed the extra trailing comma from enum pids_item . standardized/normalized results struct union members <slabinfo> ........................................... . corrected comment typo (jeeze, in an 'aligned' para) . standardized/normalized results struct union members . added 'std' & 'var' dividers in .c file, like <pids> . removed an obsolete #undef from procps_slabinfo_sort . cleanup 'get' return logic (remove a redundant 'if') <stat> ............................................... . how did i miss relocating all these friggin' #undefs . corrected an initialization fencepost used with numa <=== see Craig, here's a bug fix . removed the extra trailing comma from enum stat_item . standardized/normalized results struct union members . added 'std' & 'var' dividers in .c file, like <pids> . strengthen those parm checks in procps_stat_get func . cleanup 'get' return logic (remove a redundant 'if') <vmstat> ............................................. . standardized/normalized results struct union members . added 'std' & 'var' dividers in .c file, like <pids> . cleanup 'get' return logic (remove a redundant 'if') [ virtually all of these tweaks reflect the author's ] [ continuing pursuit of an unreasonable goal -- that ] [ of a 'perfect' (plus 'pretty') C language program! ] Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@ -829,6 +829,8 @@ static int stacks_reconfig_maybe (
|
||||
|
||||
// ___ Public Functions |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
// --- standard required functions --------------------------------------------
|
||||
|
||||
/*
|
||||
* procps_slabinfo_new():
|
||||
*
|
||||
@ -859,7 +861,7 @@ PROCPS_EXPORT int procps_slabinfo_new (
|
||||
|
||||
/* do a priming read here for the following potential benefits: |
|
||||
1) see if that caller's permissions were sufficient (root) |
|
||||
2) make delta results potentially useful, even is 1st time | */
|
||||
2) make delta results potentially useful, even if 1st time | */
|
||||
if ((rc = read_slabinfo_failed(p))) {
|
||||
procps_slabinfo_unref(&p);
|
||||
return rc;
|
||||
@ -919,6 +921,8 @@ PROCPS_EXPORT int procps_slabinfo_unref (
|
||||
} // end: procps_slabinfo_unref
|
||||
|
||||
|
||||
// --- variable interface functions -------------------------------------------
|
||||
|
||||
PROCPS_EXPORT signed long procps_slabinfo_get (
|
||||
struct procps_slabinfo *info,
|
||||
enum slabinfo_item item)
|
||||
@ -1056,5 +1060,4 @@ PROCPS_EXPORT struct slabinfo_stack **procps_slabinfo_sort (
|
||||
|
||||
qsort_r(stacks, numstacked, sizeof(void *), (QSR_t)Item_table[p->item].sortfunc, &parms);
|
||||
return stacks;
|
||||
#undef QSORT_r
|
||||
} // end: procps_slabinfo_sort
|
||||
|
Reference in New Issue
Block a user