summaryrefslogtreecommitdiff
path: root/proc
diff options
context:
space:
mode:
authorJim Warner <james.warner@comcast.net>2013-03-11 00:00:00 -0600
committerJaromir Capik <jcapik@redhat.com>2013-03-14 12:36:47 +0100
commitfe75e26ab64dab88762230db0797e765507b73ac (patch)
tree2a84c4c9800528ed15b712032ab9ba88d49fe77c /proc
parent7b708ca334a82ee25a729a2b63d2230c4944601c (diff)
downloadprocps-ng-fe75e26ab64dab88762230db0797e765507b73ac.tar.gz
miscellaneous: clean up trailing whitespace throughout
The entire tree's polluted with inappropriate trailing whitespace. This commit rids our environment of all of those useless keystrokes. Unfortunately, it sure ain't a permanent solution and requires every contributor to instruct their editor(s) to prevent or eliminate them. Plus it's strongly recommended we all insert something like what's shown below to our '.gitconfig' file so as to provide at least some warnings when we try to apply any patches (git am) that do contain the #@!%& things! References(s): ~/.gitconfig excerpt --------------------------------- [core] whitespace = trailing-space, space-before-tab, blank-at-eof [apply] whitespace = warn --------------------------------- ~/.gitconfig excerpt Signed-off-by: Jim Warner <james.warner@comcast.net>
Diffstat (limited to 'proc')
-rw-r--r--proc/COPYING2
-rw-r--r--proc/devname.c2
-rw-r--r--proc/escape.c34
-rw-r--r--proc/ksym.c2
-rw-r--r--proc/slab.c20
-rw-r--r--proc/sysinfo.c42
-rw-r--r--proc/version.c2
7 files changed, 52 insertions, 52 deletions
diff --git a/proc/COPYING b/proc/COPYING
index 5bc8fb2..a042de4 100644
--- a/proc/COPYING
+++ b/proc/COPYING
@@ -133,7 +133,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
-
+
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
diff --git a/proc/devname.c b/proc/devname.c
index f9f1a37..0066b46 100644
--- a/proc/devname.c
+++ b/proc/devname.c
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ */
#include <stdio.h>
#include <stdlib.h>
diff --git a/proc/escape.c b/proc/escape.c
index 1b1ca97..68b66e2 100644
--- a/proc/escape.c
+++ b/proc/escape.c
@@ -37,26 +37,26 @@ static int escape_str_utf8(char *restrict dst, const char *restrict src, int buf
int my_cells = 0;
int my_bytes = 0;
mbstate_t s;
-
+
memset(&s, 0, sizeof (s));
-
+
for(;;) {
wchar_t wc;
int len = 0;
-
- if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
+
+ if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
break;
-
+
if (!(len = mbrtowc (&wc, src, MB_CUR_MAX, &s)))
/* 'str' contains \0 */
break;
-
+
if (len < 0) {
/* invalid multibyte sequence -- zeroize state */
memset (&s, 0, sizeof (s));
*(dst++) = '?';
src++;
- my_cells++;
+ my_cells++;
my_bytes++;
} else if (!iswprint(wc)) {
@@ -64,14 +64,14 @@ static int escape_str_utf8(char *restrict dst, const char *restrict src, int buf
*(dst++) = '?';
src+=len;
my_cells++;
- my_bytes++;
-
+ my_bytes++;
+
} else {
- /* multibyte - printable */
+ /* multibyte - printable */
int wlen = wcwidth(wc);
if (wlen==0) {
- // invisible multibyte -- we don't ignore it, because some terminal
+ // invisible multibyte -- we don't ignore it, because some terminal
// interpret it wrong and more safe is replace it with '?'
*(dst++) = '?';
src+=len;
@@ -103,7 +103,7 @@ static int escape_str_utf8(char *restrict dst, const char *restrict src, int buf
*dst = '\0';
// fprintf(stderr, "maxcells: %d, my_cells; %d\n", *maxcells, my_cells);
-
+
*maxcells -= my_cells;
return my_bytes; // bytes of text, excluding the NUL
}
@@ -124,10 +124,10 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m
"????????????????????????????????"
"????????????????????????????????"
"????????????????????????????????";
-
+
#if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__))
static int utf_init=0;
-
+
if(utf_init==0){
/* first call -- check if UTF stuff is usable */
char *enc = nl_langinfo(CODESET);
@@ -138,11 +138,11 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m
return escape_str_utf8(dst, src, bufsize, maxcells);
}
#endif
-
+
if(bufsize > *maxcells+1) bufsize=*maxcells+1; // FIXME: assumes 8-bit locale
for(;;){
- if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
+ if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
break;
c = (unsigned char) *(src++);
if(!c) break;
@@ -152,7 +152,7 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m
*(dst++) = c;
}
*dst = '\0';
-
+
*maxcells -= my_cells;
return my_bytes; // bytes of text, excluding the NUL
}
diff --git a/proc/ksym.c b/proc/ksym.c
index fe8ff4e..36ee18a 100644
--- a/proc/ksym.c
+++ b/proc/ksym.c
@@ -271,7 +271,7 @@ open_again:
continue;
}
if(done>0 && done<(ssize_t)room-total-1){
- total += done;
+ total += done;
continue; /* OK, we read some. Go do more. */
}
fprintf(stderr,"%ld can't happen\n", (long)done);
diff --git a/proc/slab.c b/proc/slab.c
index b0bccaa..709888d 100644
--- a/proc/slab.c
+++ b/proc/slab.c
@@ -1,4 +1,4 @@
-/*
+/*
* slab.c - slab related functions for libproc
*
* Chris Rivera <cmrivera@ufl.edu>
@@ -62,7 +62,7 @@ static struct slab_info *get_slabnode(void)
/*
* slab_badname_detect - return true if current slab was declared with
- * whitespaces for instance
+ * whitespaces for instance
* FIXME :Other cases ?
*/
@@ -72,9 +72,9 @@ static int slab_badname_detect(const char *restrict buffer)
while (*buffer){
if((*buffer)==' ')
numberarea=1;
- if(isalpha(*buffer)&&numberarea)
+ if(isalpha(*buffer)&&numberarea)
return 1;
- buffer++;
+ buffer++;
}
return 0;
}
@@ -101,7 +101,7 @@ void free_slabinfo(struct slab_info *list)
}
// parse_slabinfo20 - actual parse routine for slabinfo 2.x (2.6 kernels)
-// Note: difference between 2.0 and 2.1 is in the ": globalstat" part where version 2.1
+// Note: difference between 2.0 and 2.1 is in the ": globalstat" part where version 2.1
// has extra column <nodeallocs>. We don't use ": globalstat" part in both versions.
//
// Formats (we don't use "statistics" extensions)
@@ -117,7 +117,7 @@ void free_slabinfo(struct slab_info *list)
// : slabdata <active_slabs> <num_slabs> <sharedavail> \
// : globalstat <listallocs> <maxobjs> <grown> <reaped> <error> <maxfreeable> <freelimit> <nodeallocs> \
// : cpustat <allochit> <allocmiss> <freehit> <freemiss>
-//
+//
// slabinfo - version: 2.0
// # name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> \
// : tunables <batchcount> <limit> <sharedfactor> \
@@ -158,8 +158,8 @@ static int parse_slabinfo20(struct slab_info **list, struct slab_stat *stats,
assigned = sscanf(buffer, "%" STRINGIFY(SLAB_INFO_NAME_LEN)
"s %d %d %d %d %d : tunables %*d %*d %*d : \
- slabdata %d %d %*d", curr->name,
- &curr->nr_active_objs, &curr->nr_objs,
+ slabdata %d %d %*d", curr->name,
+ &curr->nr_active_objs, &curr->nr_objs,
&curr->obj_size, &curr->objs_per_slab,
&curr->pages_per_slab, &curr->nr_active_slabs,
&curr->nr_slabs);
@@ -244,7 +244,7 @@ static int parse_slabinfo11(struct slab_info **list, struct slab_stat *stats,
if (assigned < 6) {
fprintf(stderr, "unrecognizable data in your slabinfo version 1.1\n\r");
if(slab_badname_detect(buffer))
- fprintf(stderr, "Found an error in cache name at line %s\n", buffer);
+ fprintf(stderr, "Found an error in cache name at line %s\n", buffer);
curr = NULL;
break;
}
@@ -264,7 +264,7 @@ static int parse_slabinfo11(struct slab_info **list, struct slab_stat *stats,
if (curr->obj_size)
curr->objs_per_slab = curr->pages_per_slab *
- page_size / curr->obj_size;
+ page_size / curr->obj_size;
stats->nr_objs += curr->nr_objs;
stats->nr_active_objs += curr->nr_active_objs;
diff --git a/proc/sysinfo.c b/proc/sysinfo.c
index a0c3eb5..454969d 100644
--- a/proc/sysinfo.c
+++ b/proc/sysinfo.c
@@ -269,7 +269,7 @@ static void init_libproc(void){
cpuinfo();
#ifdef __linux__
- if(linux_version_code > LINUX_VERSION(2, 4, 0)){
+ if(linux_version_code > LINUX_VERSION(2, 4, 0)){
Hertz = find_elf_note(AT_CLKTCK);
if(Hertz!=NOTE_NOT_FOUND) return;
fputs("2.4+ kernel w/o ELF notes? -- report this\n", stderr);
@@ -360,7 +360,7 @@ void eight_cpu_numbers(double *restrict uret, double *restrict nret, double *res
void loadavg(double *restrict av1, double *restrict av5, double *restrict av15) {
double avg_1=0, avg_5=0, avg_15=0;
char *savelocale;
-
+
FILE_TO_BUF(LOADAVG_FILE,loadavg_fd);
savelocale = strdup(setlocale(LC_NUMERIC, NULL));
setlocale(LC_NUMERIC, "C");
@@ -447,7 +447,7 @@ void getstat(jiff *restrict cuse, jiff *restrict cice, jiff *restrict csys, jiff
if(fd == -1) crash("/proc/stat");
}
read(fd,buff,BUFFSIZE-1);
- *intr = 0;
+ *intr = 0;
*ciow = 0; /* not separated out until the 2.5.41 kernel */
*cxxx = 0; /* not separated out until the 2.6.0-test4 kernel */
*cyyy = 0; /* not separated out until the 2.6.0-test4 kernel */
@@ -719,21 +719,21 @@ unsigned long vm_pageoutrun; // times kswapd ran page reclaim
unsigned long vm_allocstall; // times a page allocator ran direct reclaim
unsigned long vm_pgrotated; // pages rotated to the tail of the LRU for immediate reclaim
// seen on a 2.6.8-rc1 kernel, apparently replacing old fields
-static unsigned long vm_pgalloc_dma; //
-static unsigned long vm_pgalloc_high; //
-static unsigned long vm_pgalloc_normal; //
-static unsigned long vm_pgrefill_dma; //
-static unsigned long vm_pgrefill_high; //
-static unsigned long vm_pgrefill_normal; //
-static unsigned long vm_pgscan_direct_dma; //
-static unsigned long vm_pgscan_direct_high; //
-static unsigned long vm_pgscan_direct_normal; //
-static unsigned long vm_pgscan_kswapd_dma; //
-static unsigned long vm_pgscan_kswapd_high; //
-static unsigned long vm_pgscan_kswapd_normal; //
-static unsigned long vm_pgsteal_dma; //
-static unsigned long vm_pgsteal_high; //
-static unsigned long vm_pgsteal_normal; //
+static unsigned long vm_pgalloc_dma; //
+static unsigned long vm_pgalloc_high; //
+static unsigned long vm_pgalloc_normal; //
+static unsigned long vm_pgrefill_dma; //
+static unsigned long vm_pgrefill_high; //
+static unsigned long vm_pgrefill_normal; //
+static unsigned long vm_pgscan_direct_dma; //
+static unsigned long vm_pgscan_direct_high; //
+static unsigned long vm_pgscan_direct_normal; //
+static unsigned long vm_pgscan_kswapd_dma; //
+static unsigned long vm_pgscan_kswapd_high; //
+static unsigned long vm_pgscan_kswapd_normal; //
+static unsigned long vm_pgsteal_dma; //
+static unsigned long vm_pgsteal_high; //
+static unsigned long vm_pgsteal_normal; //
// seen on a 2.6.8-rc1 kernel
static unsigned long vm_kswapd_inodesteal; //
static unsigned long vm_nr_unstable; //
@@ -887,7 +887,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
*disks = NULL;
*partitions = NULL;
- buff[BUFFSIZE-1] = 0;
+ buff[BUFFSIZE-1] = 0;
fd = fopen("/proc/diskstats", "rb");
if(!fd) crash("/proc/diskstats");
@@ -932,7 +932,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
&(*partitions)[cPartition].requested_writes
);
(*partitions)[cPartition++].parent_disk = cDisk-1;
- (*disks)[cDisk-1].partitions++;
+ (*disks)[cDisk-1].partitions++;
}
}
@@ -945,7 +945,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
unsigned int getslabinfo (struct slab_cache **slab){
FILE* fd;
int cSlab = 0;
- buff[BUFFSIZE-1] = 0;
+ buff[BUFFSIZE-1] = 0;
*slab = NULL;
fd = fopen("/proc/slabinfo", "rb");
if(!fd) crash("/proc/slabinfo");
diff --git a/proc/version.c b/proc/version.c
index 12bd46a..262e493 100644
--- a/proc/version.c
+++ b/proc/version.c
@@ -45,7 +45,7 @@ void init_Linux_version(void) {
#ifdef __linux__
static struct utsname uts;
-
+
if (uname(&uts) == -1) /* failure implies impending death */
exit(1);