From fe75e26ab64dab88762230db0797e765507b73ac Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Mon, 11 Mar 2013 00:00:00 -0600 Subject: [PATCH] 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 --- COPYING.LIB | 2 +- .../howto-uClibc-buildroot-compilation.txt | 4 +- contrib/tmp-junk.c | 4 +- contrib/utmp.c | 12 +++--- free.1 | 2 +- include/nls.h | 2 +- include/strutils.h | 2 +- include/xalloc.h | 2 +- lib/strutils.c | 2 +- pgrep.1 | 6 +-- pgrep.c | 6 +-- proc/COPYING | 2 +- proc/devname.c | 2 +- proc/escape.c | 34 +++++++-------- proc/ksym.c | 2 +- proc/slab.c | 20 ++++----- proc/sysinfo.c | 42 +++++++++---------- proc/version.c | 2 +- ps/ps.1 | 4 +- slabtop.1 | 2 +- sysctl.8 | 2 +- testsuite/Makefile.am | 2 +- w.c | 4 +- 23 files changed, 81 insertions(+), 81 deletions(-) diff --git a/COPYING.LIB b/COPYING.LIB index 5bc8fb2c..a042de4c 100644 --- a/COPYING.LIB +++ b/COPYING.LIB @@ -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/Documentation/howto-uClibc-buildroot-compilation.txt b/Documentation/howto-uClibc-buildroot-compilation.txt index e66af0e5..0ca9e26c 100644 --- a/Documentation/howto-uClibc-buildroot-compilation.txt +++ b/Documentation/howto-uClibc-buildroot-compilation.txt @@ -9,7 +9,7 @@ buildroot git clone. Once the apply merge is done you need to run 'make menuconfig', choose Package Selection for the target --->, [*] Show packages that -are also provided by busybox && System tools ---> [*] procps-ng. +are also provided by busybox && System tools ---> [*] procps-ng. If you do not want to configure anything else save, exit and make. Notice that you almost certainly want to PROCPS_NG_VERSION @@ -80,6 +80,6 @@ index 0000000..0249b07 + +$(eval $(call AUTOTARGETS)) +$(eval $(call AUTOTARGETS,host)) --- +-- 1.7.10 diff --git a/contrib/tmp-junk.c b/contrib/tmp-junk.c index 06f4da82..21885b49 100644 --- a/contrib/tmp-junk.c +++ b/contrib/tmp-junk.c @@ -441,7 +441,7 @@ char *argv[]; } else { - /* + /* * Check out the next process * If we can't open it, use info from this process, * so we have to check out cmdline first. @@ -665,7 +665,7 @@ char *tty; if (idle >= (60 * 60 * 48)) /* more than two days */ sprintf (give, "%2ludays", idle / (60 * 60 * 24)); else - sprintf (give, " %2lu:%02u", idle / (60 * 60), + sprintf (give, " %2lu:%02u", idle / (60 * 60), (unsigned) ((idle / 60) % 60)); } else diff --git a/contrib/utmp.c b/contrib/utmp.c index 933a31e0..dc196d92 100644 --- a/contrib/utmp.c +++ b/contrib/utmp.c @@ -1,17 +1,17 @@ /* * utmp.c - utmp printing command * Copyright (C) Albert Cahalan - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * 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 @@ -65,7 +65,7 @@ int main (int argc, char **argv) { exit(1); } - + if (list) { ut = fopen(UTMP_FILE, "r"); while (fread(&uts, sizeof(uts), 1, ut)) @@ -90,7 +90,7 @@ int main (int argc, char **argv) { if (fix) { ut = fopen(UTMP_FILE, "r"); - while (fread(&uts, sizeof(uts), 1, ut)) + while (fread(&uts, sizeof(uts), 1, ut)) if (((uts.ut_type == USER_PROCESS) && (uts.ut_name[0] != '\000')) || print_all) { /* Display entry in utmp */ @@ -106,7 +106,7 @@ int main (int argc, char **argv) { printf("ut_user: %s\n", user); printf("ut_host: %s\n", host); printf("ut_addr: %d\n\n", uts.ut_addr); - + printf("Modify this record? (y/N): "); fflush(stdout); /* Ask if to delete or no */ if ((ch = getchar()) == 'y' || ch == 'Y') { diff --git a/free.1 b/free.1 index 1e6f415e..f7c2313a 100644 --- a/free.1 +++ b/free.1 @@ -90,7 +90,7 @@ memory information .BR top "(1), .BR vmstat (8). .SH AUTHORS -Written by Brian Edmonds. +Written by Brian Edmonds. .SH "REPORTING BUGS" Please send bug reports to .UR procps@freelists.org diff --git a/include/nls.h b/include/nls.h index fee89b2e..1166b7b7 100644 --- a/include/nls.h +++ b/include/nls.h @@ -1,4 +1,4 @@ -/* +/* * This header was copied from util-linux at fall 2011. */ diff --git a/include/strutils.h b/include/strutils.h index e36048d0..9df33c21 100644 --- a/include/strutils.h +++ b/include/strutils.h @@ -1,4 +1,4 @@ -/* +/* * This header was copied from util-linux at fall 2011. */ diff --git a/include/xalloc.h b/include/xalloc.h index 37bf0efa..8b4d368f 100644 --- a/include/xalloc.h +++ b/include/xalloc.h @@ -1,4 +1,4 @@ -/* +/* * This header was copied from util-linux at fall 2011. */ diff --git a/lib/strutils.c b/lib/strutils.c index 2d63b87e..1b84f8ab 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -1,4 +1,4 @@ -/* +/* * strutils.c - various string routines shared by commands * This file was copied from util-linux at fall 2011. * diff --git a/pgrep.1 b/pgrep.1 index 622cf1c8..f68b35ec 100644 --- a/pgrep.1 +++ b/pgrep.1 @@ -49,7 +49,7 @@ only.) \fB\-c\fR, \fB\-\-count\fR Suppress normal output; instead print a count of matching processes. When count does not match anything, e.g. returns zero, the command will return -non-zero value. +non-zero value. .TP \fB\-d\fR, \fB\-\-delimiter\fR \fIdelimiter\fP Sets the string used to delimit each process ID in the output (by default a @@ -116,8 +116,8 @@ Only match processes whose real user ID is listed. Either the numerical or symbolical value may be used. .TP \fB\-v\fR, \fB\-\-inverse\fR\fR -Negates the matching. This option is usually used in -.BR pgrep 's +Negates the matching. This option is usually used in +.BR pgrep 's context. In .BR pkill 's context the short option is disabled to avoid accidental usage of the option. diff --git a/pgrep.c b/pgrep.c index f08d89f1..4639f40b 100644 --- a/pgrep.c +++ b/pgrep.c @@ -547,7 +547,7 @@ static struct el * select_procs (int *num) xerrx(EXIT_FAILURE, _("internal error")); } } - + memset (&task, 0, sizeof (task)); } closeproc (ptp); @@ -622,7 +622,7 @@ static void parse_opts (int argc, char **argv) /* These options are for pgrep only */ strcat (opts, "lad:v"); } - + strcat (opts, "LF:cfnoxP:g:s:u:U:G:t:?Vh"); while ((opt = getopt_long (argc, argv, opts, longopts, NULL)) != -1) { @@ -810,7 +810,7 @@ int main (int argc, char **argv) continue; xwarn(_("killing pid %ld failed"), procs[i].num); } - if (opt_count) + if (opt_count) fprintf(stdout, "%d\n", num); } else { if (opt_count) { diff --git a/proc/COPYING b/proc/COPYING index 5bc8fb2c..a042de4c 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 f9f1a37c..0066b461 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 #include diff --git a/proc/escape.c b/proc/escape.c index 1b1ca971..68b66e26 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 fe8ff4e8..36ee18a9 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 b0bccaad..709888d4 100644 --- a/proc/slab.c +++ b/proc/slab.c @@ -1,4 +1,4 @@ -/* +/* * slab.c - slab related functions for libproc * * Chris Rivera @@ -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 . 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 \ // : globalstat \ // : cpustat -// +// // slabinfo - version: 2.0 // # name \ // : tunables \ @@ -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 a0c3eb5d..454969d6 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 12bd46a4..262e4934 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); diff --git a/ps/ps.1 b/ps/ps.1 index 0c6c91db..9d3d1ce8 100644 --- a/ps/ps.1 +++ b/ps/ps.1 @@ -804,13 +804,13 @@ if the parent process exits. If the length of the username is greater than the length of the display column, the numeric user ID is displayed instead. .PP -Commands options such as +Commands options such as .B ps \-aux are not recommended as it is a confusion of two different standards. According to the POSIX and UNIX standards, the above command asks to display all processes with a TTY (generally the commands users are running) plus all processes owned by a user named "x". If that user -doesn't exist, then +doesn't exist, then .B ps will assume you really meant "\fBps\fR \fIaux\fR". .SH "PROCESS FLAGS" diff --git a/slabtop.1 b/slabtop.1 index a14d3ae7..6bc9c5df 100644 --- a/slabtop.1 +++ b/slabtop.1 @@ -14,7 +14,7 @@ displays detailed kernel slab cache information in real time. It displays a listing of the top caches sorted by one of the listed sort criteria. It also displays a statistics header filled with slab layer information. .SH OPTIONS -Normal invocation of +Normal invocation of .B slabtop does not require any options. The behavior, however, can be fine-tuned by specifying one or more of the following flags: diff --git a/sysctl.8 b/sysctl.8 index e380db6b..d57ecd18 100644 --- a/sysctl.8 +++ b/sysctl.8 @@ -18,7 +18,7 @@ sysctl \- configure kernel parameters at runtime .SH DESCRIPTION .B sysctl is used to modify kernel parameters at runtime. The parameters available -are those listed under /proc/sys/. Procfs is required for +are those listed under /proc/sys/. Procfs is required for .B sysctl support in Linux. You can use .B sysctl diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 26c863fa..ec756e7e 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -50,4 +50,4 @@ EXTRA_DIST = \ sysctl.test/sysctl_read.exp \ uptime.test/uptime.exp \ vmstat.test/vmstat.exp \ - w.test/w.exp + w.test/w.exp diff --git a/w.c b/w.c index 6352d69f..9e0a043b 100644 --- a/w.c +++ b/w.c @@ -142,12 +142,12 @@ static void print_display_or_interface(const char *restrict host, int len, int r fputc('-', stdout); } } else { /* multiple colons found - it's an IPv6 address */ - + /* search for % (interface separator in case of IPv6 link address) */ while ( (tmp < (host + len)) && (*tmp != '%') && isprint(*tmp) ) tmp++; if (*tmp == '%') { /* interface separator found */ - + /* number of chars till the end of the input field */ len -= (tmp - host);