sort: Cleanup small issues with spaces.
Obtained from: OpenBSD
This commit is contained in:
parent
c2dc6e2aab
commit
f79477ebd5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281123
@ -78,7 +78,7 @@ keys_array_alloc(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate whether we need key hint space
|
* Calculate whether we need key hint space
|
||||||
*/
|
*/
|
||||||
static size_t
|
static size_t
|
||||||
key_hint_size(void)
|
key_hint_size(void)
|
||||||
@ -595,12 +595,12 @@ list_coll(struct sort_list_item **ss1, struct sort_list_item **ss2)
|
|||||||
return (list_coll_offset(ss1, ss2, 0));
|
return (list_coll_offset(ss1, ss2, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LSCDEF(N) \
|
#define LSCDEF(N) \
|
||||||
static int \
|
static int \
|
||||||
list_coll_##N(struct sort_list_item **ss1, struct sort_list_item **ss2) \
|
list_coll_##N(struct sort_list_item **ss1, struct sort_list_item **ss2) \
|
||||||
{ \
|
{ \
|
||||||
\
|
\
|
||||||
return (list_coll_offset(ss1, ss2, N)); \
|
return (list_coll_offset(ss1, ss2, N)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
LSCDEF(1)
|
LSCDEF(1)
|
||||||
|
@ -1127,7 +1127,7 @@ file_headers_merge(size_t fnum, struct file_header **fh, FILE *f_out)
|
|||||||
memset(&lp, 0, sizeof(lp));
|
memset(&lp, 0, sizeof(lp));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* construct the initial sort structure
|
* construct the initial sort structure
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < fnum; i++)
|
for (i = 0; i < fnum; i++)
|
||||||
file_header_list_push(fh[i], fh, i);
|
file_header_list_push(fh[i], fh, i);
|
||||||
|
@ -55,7 +55,7 @@ struct sort_list
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* File reader object
|
* File reader object
|
||||||
*/
|
*/
|
||||||
struct file_reader;
|
struct file_reader;
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ have_sort_left(void)
|
|||||||
* Push sort level to the stack
|
* Push sort level to the stack
|
||||||
*/
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
push_ls(struct sort_level* sl)
|
push_ls(struct sort_level *sl)
|
||||||
{
|
{
|
||||||
struct level_stack *new_ls;
|
struct level_stack *new_ls;
|
||||||
|
|
||||||
@ -231,7 +231,6 @@ add_to_sublevel(struct sort_level *sl, struct sort_list_item *item, size_t indx)
|
|||||||
static inline void
|
static inline void
|
||||||
add_leaf(struct sort_level *sl, struct sort_list_item *item)
|
add_leaf(struct sort_level *sl, struct sort_list_item *item)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (++(sl->leaves_num) > sl->leaves_sz) {
|
if (++(sl->leaves_num) > sl->leaves_sz) {
|
||||||
sl->leaves_sz = sl->leaves_num + 128;
|
sl->leaves_sz = sl->leaves_num + 128;
|
||||||
sl->leaves = sort_realloc(sl->leaves,
|
sl->leaves = sort_realloc(sl->leaves,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.\" $OpenBSD: sort.1,v 1.31 2007/08/21 21:22:37 millert Exp $
|
.\" $OpenBSD: sort.1,v 1.45 2015/03/19 13:51:10 jmc Exp $
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1991, 1993
|
.\" Copyright (c) 1991, 1993
|
||||||
@ -33,7 +33,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" @(#)sort.1 8.1 (Berkeley) 6/6/93
|
.\" @(#)sort.1 8.1 (Berkeley) 6/6/93
|
||||||
.\"
|
.\"
|
||||||
.Dd July 3, 2012
|
.Dd March 19 2015
|
||||||
.Dt SORT 1
|
.Dt SORT 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -160,9 +160,10 @@ before comparison, that is, perform case-independent sorting.
|
|||||||
Sort by general numerical value.
|
Sort by general numerical value.
|
||||||
As opposed to
|
As opposed to
|
||||||
.Fl n ,
|
.Fl n ,
|
||||||
this option handles general floating points, which have a much
|
this option handles general floating points.
|
||||||
permissive format than those allowed by
|
It has a more
|
||||||
. Fl n ,
|
permissive format than that allowed by
|
||||||
|
.Fl n
|
||||||
but it has a significant performance drawback.
|
but it has a significant performance drawback.
|
||||||
.It Fl h, Fl Fl human-numeric-sort, Fl Fl sort=human-numeric
|
.It Fl h, Fl Fl human-numeric-sort, Fl Fl sort=human-numeric
|
||||||
Sort by numerical value, but take into account the SI suffix,
|
Sort by numerical value, but take into account the SI suffix,
|
||||||
@ -247,9 +248,8 @@ can be attached independently to each
|
|||||||
argument of the key specifications.
|
argument of the key specifications.
|
||||||
.Fl b .
|
.Fl b .
|
||||||
.It Xo
|
.It Xo
|
||||||
.Sm off
|
.Fl k Ar field1 Ns Op , Ns Ar field2 ,
|
||||||
.Fl k\ \& Ar field1 Op , Ar field2 , Fl Fl key Ns = Ns Ar field1 Op , Ar field2
|
.Fl Fl key Ns = Ns Ar field1 Ns Op , Ns Ar field2
|
||||||
.Sm on
|
|
||||||
.Xc
|
.Xc
|
||||||
Define a restricted sort key that has the starting position
|
Define a restricted sort key that has the starting position
|
||||||
.Ar field1 ,
|
.Ar field1 ,
|
||||||
@ -334,7 +334,7 @@ standard output.
|
|||||||
%%THREADS%%Default number equals to the number of CPUs.
|
%%THREADS%%Default number equals to the number of CPUs.
|
||||||
.It Fl Fl files0-from Ns = Ns Ar filename
|
.It Fl Fl files0-from Ns = Ns Ar filename
|
||||||
Take the input file list from the file
|
Take the input file list from the file
|
||||||
.Ar filename.
|
.Ar filename .
|
||||||
The file names must be separated by NUL
|
The file names must be separated by NUL
|
||||||
(like the output produced by the command "find ... -print0").
|
(like the output produced by the command "find ... -print0").
|
||||||
.It Fl Fl radixsort
|
.It Fl Fl radixsort
|
||||||
|
@ -40,21 +40,18 @@ __FBSDID("$FreeBSD$");
|
|||||||
static inline bool
|
static inline bool
|
||||||
isdigit_clocale(wchar_t c)
|
isdigit_clocale(wchar_t c)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (c >= L'0' && c <= L'9');
|
return (c >= L'0' && c <= L'9');
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
isalpha_clocale(wchar_t c)
|
isalpha_clocale(wchar_t c)
|
||||||
{
|
{
|
||||||
|
|
||||||
return ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z'));
|
return ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z'));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
isalnum_clocale(wchar_t c)
|
isalnum_clocale(wchar_t c)
|
||||||
{
|
{
|
||||||
|
|
||||||
return ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z') ||
|
return ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z') ||
|
||||||
(c >= L'0' && c <= L'9'));
|
(c >= L'0' && c <= L'9'));
|
||||||
}
|
}
|
||||||
@ -115,7 +112,6 @@ find_suffix(bwstring_iterator si, bwstring_iterator se, size_t *len)
|
|||||||
static inline int
|
static inline int
|
||||||
cmp_chars(wchar_t c1, wchar_t c2)
|
cmp_chars(wchar_t c1, wchar_t c2)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (c1 == c2)
|
if (c1 == c2)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user