Date: Wed, 30 Apr 2014 20:39:09 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265160 - in stable/10/usr.bin: grep grep/regex patch printf sort Message-ID: <201404302039.s3UKd9JV039364@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Wed Apr 30 20:39:08 2014 New Revision: 265160 URL: http://svnweb.freebsd.org/changeset/base/265160 Log: MFC r264581, r264744: Various style(9) fixes and typos in printf, grep, sort and patch. #define should be followed by a tab. Modified: stable/10/usr.bin/grep/grep.c stable/10/usr.bin/grep/grep.h stable/10/usr.bin/grep/regex/tre-fastmatch.c stable/10/usr.bin/patch/common.h stable/10/usr.bin/patch/pch.h stable/10/usr.bin/printf/printf.c stable/10/usr.bin/sort/bwstring.h stable/10/usr.bin/sort/coll.h stable/10/usr.bin/sort/file.h stable/10/usr.bin/sort/mem.h stable/10/usr.bin/sort/radixsort.h stable/10/usr.bin/sort/sort.1.in stable/10/usr.bin/sort/sort.h stable/10/usr.bin/sort/vsort.h Modified: stable/10/usr.bin/grep/grep.c ============================================================================== --- stable/10/usr.bin/grep/grep.c Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/grep/grep.c Wed Apr 30 20:39:08 2014 (r265160) @@ -311,7 +311,7 @@ read_patterns(const char *fn) fclose(f); return; } - while ((line = fgetln(f, &len)) != NULL) + while ((line = fgetln(f, &len)) != NULL) add_pattern(line, line[0] == '\n' ? 0 : len); if (ferror(f)) err(2, "%s", fn); Modified: stable/10/usr.bin/grep/grep.h ============================================================================== --- stable/10/usr.bin/grep/grep.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/grep/grep.h Wed Apr 30 20:39:08 2014 (r265160) @@ -39,48 +39,48 @@ #include "fastmatch.h" #ifdef WITHOUT_NLS -#define getstr(n) errstr[n] +#define getstr(n) errstr[n] #else #include <nl_types.h> extern nl_catd catalog; -#define getstr(n) catgets(catalog, 1, n, errstr[n]) +#define getstr(n) catgets(catalog, 1, n, errstr[n]) #endif extern const char *errstr[]; -#define VERSION "2.5.1-FreeBSD" +#define VERSION "2.5.1-FreeBSD" -#define GREP_FIXED 0 -#define GREP_BASIC 1 -#define GREP_EXTENDED 2 - -#define BINFILE_BIN 0 -#define BINFILE_SKIP 1 -#define BINFILE_TEXT 2 - -#define FILE_STDIO 0 -#define FILE_MMAP 1 -#define FILE_GZIP 2 -#define FILE_BZIP 3 -#define FILE_XZ 4 -#define FILE_LZMA 5 - -#define DIR_READ 0 -#define DIR_SKIP 1 -#define DIR_RECURSE 2 - -#define DEV_READ 0 -#define DEV_SKIP 1 - -#define LINK_READ 0 -#define LINK_EXPLICIT 1 -#define LINK_SKIP 2 +#define GREP_FIXED 0 +#define GREP_BASIC 1 +#define GREP_EXTENDED 2 + +#define BINFILE_BIN 0 +#define BINFILE_SKIP 1 +#define BINFILE_TEXT 2 + +#define FILE_STDIO 0 +#define FILE_MMAP 1 +#define FILE_GZIP 2 +#define FILE_BZIP 3 +#define FILE_XZ 4 +#define FILE_LZMA 5 + +#define DIR_READ 0 +#define DIR_SKIP 1 +#define DIR_RECURSE 2 + +#define DEV_READ 0 +#define DEV_SKIP 1 + +#define LINK_READ 0 +#define LINK_EXPLICIT 1 +#define LINK_SKIP 2 -#define EXCL_PAT 0 -#define INCL_PAT 1 +#define EXCL_PAT 0 +#define INCL_PAT 1 -#define MAX_LINE_MATCHES 32 +#define MAX_LINE_MATCHES 32 struct file { int fd; @@ -129,7 +129,7 @@ extern regex_t *er_pattern, *r_pattern; extern fastmatch_t *fg_pattern; /* For regex errors */ -#define RE_ERROR_BUF 512 +#define RE_ERROR_BUF 512 extern char re_error[RE_ERROR_BUF + 1]; /* Seems big enough */ /* util.c */ Modified: stable/10/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- stable/10/usr.bin/grep/regex/tre-fastmatch.c Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/grep/regex/tre-fastmatch.c Wed Apr 30 20:39:08 2014 (r265160) @@ -444,7 +444,7 @@ static int fastcmp(const fastmatch_t *fg } /* - * Copies the pattern pat having lenght n to p and stores + * Copies the pattern pat having length n to p and stores * the size in l. */ #define SAVE_PATTERN(src, srclen, dst, dstlen) \ Modified: stable/10/usr.bin/patch/common.h ============================================================================== --- stable/10/usr.bin/patch/common.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/patch/common.h Wed Apr 30 20:39:08 2014 (r265160) @@ -32,32 +32,32 @@ #include <stdbool.h> #include <stdint.h> -#define DEBUGGING +#define DEBUGGING /* constants */ -#define MAXHUNKSIZE 200000 /* is this enough lines? */ -#define INITHUNKMAX 125 /* initial dynamic allocation size */ -#define INITLINELEN 4096 -#define BUFFERSIZE 4096 - -#define SCCSPREFIX "s." -#define GET "get -e %s" -#define SCCSDIFF "get -p %s | diff - %s >/dev/null" - -#define RCSSUFFIX ",v" -#define CHECKOUT "co -l %s" -#define RCSDIFF "rcsdiff %s > /dev/null" +#define MAXHUNKSIZE 200000 /* is this enough lines? */ +#define INITHUNKMAX 125 /* initial dynamic allocation size */ +#define INITLINELEN 4096 +#define BUFFERSIZE 4096 + +#define SCCSPREFIX "s." +#define GET "get -e %s" +#define SCCSDIFF "get -p %s | diff - %s >/dev/null" + +#define RCSSUFFIX ",v" +#define CHECKOUT "co -l %s" +#define RCSDIFF "rcsdiff %s > /dev/null" -#define ORIGEXT ".orig" -#define REJEXT ".rej" +#define ORIGEXT ".orig" +#define REJEXT ".rej" /* handy definitions */ -#define strNE(s1,s2) (strcmp(s1, s2)) -#define strEQ(s1,s2) (!strcmp(s1, s2)) -#define strnNE(s1,s2,l) (strncmp(s1, s2, l)) -#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) +#define strNE(s1,s2) (strcmp(s1, s2)) +#define strEQ(s1,s2) (!strcmp(s1, s2)) +#define strnNE(s1,s2,l) (strncmp(s1, s2, l)) +#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) /* typedefs */ @@ -73,7 +73,7 @@ extern size_t buf_size; /* size of gener extern bool using_plan_a; /* try to keep everything in memory */ extern bool out_of_mem; /* ran out of memory in plan a */ -#define MAXFILEC 2 +#define MAXFILEC 2 extern char *filearg[MAXFILEC]; extern bool ok_to_create_file; @@ -105,11 +105,11 @@ extern bool warn_on_invalid_line; extern bool last_line_missing_eol; -#define CONTEXT_DIFF 1 -#define NORMAL_DIFF 2 -#define ED_DIFF 3 -#define NEW_CONTEXT_DIFF 4 -#define UNI_DIFF 5 +#define CONTEXT_DIFF 1 +#define NORMAL_DIFF 2 +#define ED_DIFF 3 +#define NEW_CONTEXT_DIFF 4 +#define UNI_DIFF 5 extern int diff_type; extern char *revision; /* prerequisite revision, if any */ Modified: stable/10/usr.bin/patch/pch.h ============================================================================== --- stable/10/usr.bin/patch/pch.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/patch/pch.h Wed Apr 30 20:39:08 2014 (r265160) @@ -27,10 +27,10 @@ * $FreeBSD$ */ -#define OLD_FILE 0 -#define NEW_FILE 1 -#define INDEX_FILE 2 -#define MAX_FILE 3 +#define OLD_FILE 0 +#define NEW_FILE 1 +#define INDEX_FILE 2 +#define MAX_FILE 3 struct file_name { char *path; Modified: stable/10/usr.bin/printf/printf.c ============================================================================== --- stable/10/usr.bin/printf/printf.c Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/printf/printf.c Wed Apr 30 20:39:08 2014 (r265160) @@ -61,13 +61,13 @@ static const char rcsid[] = #include <wchar.h> #ifdef SHELL -#define main printfcmd +#define main printfcmd #include "bltin/bltin.h" #include "error.h" #include "options.h" #endif -#define PF(f, func) do { \ +#define PF(f, func) do { \ char *b = NULL; \ if (havewidth) \ if (haveprec) \ Modified: stable/10/usr.bin/sort/bwstring.h ============================================================================== --- stable/10/usr.bin/sort/bwstring.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/bwstring.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__BWSTRING_H__) -#define __BWSTRING_H__ +#define __BWSTRING_H__ #include <stdbool.h> #include <stdio.h> @@ -41,7 +41,7 @@ extern bool byte_sort; /* wchar_t is of 4 bytes: */ -#define SIZEOF_WCHAR_STRING(LEN) ((LEN)*sizeof(wchar_t)) +#define SIZEOF_WCHAR_STRING(LEN) ((LEN)*sizeof(wchar_t)) /* * Binary "wide" string @@ -64,7 +64,7 @@ struct reader_buffer typedef void *bwstring_iterator; -#define BWSLEN(s) ((s)->len) +#define BWSLEN(s) ((s)->len) struct bwstring *bwsalloc(size_t sz); @@ -135,7 +135,7 @@ bws_get_iter_value(bwstring_iterator ite int bws_iterator_cmp(bwstring_iterator iter1, bwstring_iterator iter2, size_t len); -#define BWS_GET(bws, pos) ((MB_CUR_MAX == 1) ? ((bws)->data.cstr[(pos)]) : (bws)->data.wstr[(pos)]) +#define BWS_GET(bws, pos) ((MB_CUR_MAX == 1) ? ((bws)->data.cstr[(pos)]) : (bws)->data.wstr[(pos)]) void initialise_months(void); Modified: stable/10/usr.bin/sort/coll.h ============================================================================== --- stable/10/usr.bin/sort/coll.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/coll.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__COLL_H__) -#define __COLL_H__ +#define __COLL_H__ #include "bwstring.h" #include "sort.h" Modified: stable/10/usr.bin/sort/file.h ============================================================================== --- stable/10/usr.bin/sort/file.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/file.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__SORT_FILE_H__) -#define __SORT_FILE_H__ +#define __SORT_FILE_H__ #include "coll.h" #include "sort.h" @@ -39,8 +39,8 @@ #define SORT_HEAPSORT 3 #define SORT_RADIXSORT 4 -#define DEFAULT_SORT_ALGORITHM SORT_HEAPSORT -#define DEFAULT_SORT_FUNC heapsort +#define DEFAULT_SORT_ALGORITHM SORT_HEAPSORT +#define DEFAULT_SORT_FUNC heapsort /* * List of data to be sorted. Modified: stable/10/usr.bin/sort/mem.h ============================================================================== --- stable/10/usr.bin/sort/mem.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/mem.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__SORT_MEM_H__) -#define __SORT_MEM_H__ +#define __SORT_MEM_H__ #include <errno.h> #include <stdbool.h> Modified: stable/10/usr.bin/sort/radixsort.h ============================================================================== --- stable/10/usr.bin/sort/radixsort.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/radixsort.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__SORT_RADIX_H__) -#define __SORT_RADIX_H__ +#define __SORT_RADIX_H__ #include "coll.h" #include "sort.h" Modified: stable/10/usr.bin/sort/sort.1.in ============================================================================== --- stable/10/usr.bin/sort/sort.1.in Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/sort.1.in Wed Apr 30 20:39:08 2014 (r265160) @@ -194,7 +194,7 @@ This is a random permutation of the inpu the equal keys sort together. It is implemented by hashing the input keys and sorting the hash values. -The hash function is choosen randomly. +The hash function is chosen randomly. The hash function is randomized by .Cm /dev/random content, or by file content if it is specified by @@ -212,7 +212,7 @@ The files are compared by their prefixes zeros are ignored in version numbers, see example below). If an input string does not match the pattern, then it is compared using the byte compare function. -All string comparisions are performed in C locale, the locale +All string comparisons are performed in C locale, the locale environment setting is ignored. .Bl -tag -width indent .It Example: Modified: stable/10/usr.bin/sort/sort.h ============================================================================== --- stable/10/usr.bin/sort/sort.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/sort.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #if !defined(__BSD_SORT_H__) -#define __BSD_SORT_H__ +#define __BSD_SORT_H__ #include <errno.h> #include <stdbool.h> @@ -53,7 +53,7 @@ extern nl_catd catalog; extern const char *nlsstr[]; #if defined(SORT_THREADS) -#define MT_SORT_THRESHOLD (10000) +#define MT_SORT_THRESHOLD (10000) extern unsigned int ncpu; extern size_t nthreads; #endif Modified: stable/10/usr.bin/sort/vsort.h ============================================================================== --- stable/10/usr.bin/sort/vsort.h Wed Apr 30 19:44:31 2014 (r265159) +++ stable/10/usr.bin/sort/vsort.h Wed Apr 30 20:39:08 2014 (r265160) @@ -28,7 +28,7 @@ */ #ifndef _VSORT_H_ -#define _VSORT_H_ +#define _VSORT_H_ #include "bwstring.h"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404302039.s3UKd9JV039364>