summaryrefslogtreecommitdiff
path: root/usr.bin/sort
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-04-28 07:50:45 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-04-28 07:50:45 +0000
commit3b8f08459569bf0faa21473e5cec2491e95c9349 (patch)
tree80f45dd81ca716bcd7ca9674581e1fc40b93cd34 /usr.bin/sort
parent9d2ab4a62d6733c45958627ac113bdbd818d1e2a (diff)
parentb2ba55951383498f252746f618d513139da06e8e (diff)
downloadsrc-test-3b8f08459569bf0faa21473e5cec2491e95c9349.tar.gz
src-test-3b8f08459569bf0faa21473e5cec2491e95c9349.zip
Merge head
Notes
Notes: svn path=/projects/bmake/; revision=265044
Diffstat (limited to 'usr.bin/sort')
-rw-r--r--usr.bin/sort/Makefile4
-rw-r--r--usr.bin/sort/bwstring.h8
-rw-r--r--usr.bin/sort/coll.h2
-rw-r--r--usr.bin/sort/file.h6
-rw-r--r--usr.bin/sort/mem.h2
-rw-r--r--usr.bin/sort/radixsort.c8
-rw-r--r--usr.bin/sort/radixsort.h2
-rw-r--r--usr.bin/sort/sort.1.in6
-rw-r--r--usr.bin/sort/sort.h4
-rw-r--r--usr.bin/sort/vsort.h2
10 files changed, 22 insertions, 22 deletions
diff --git a/usr.bin/sort/Makefile b/usr.bin/sort/Makefile
index ea68c4503e63c..3b257c2236a75 100644
--- a/usr.bin/sort/Makefile
+++ b/usr.bin/sort/Makefile
@@ -11,7 +11,7 @@ sort.1: sort.1.in
CLEANFILES+= sort.1
-.if defined(WITH_THREADS)
+.if ${MK_SORT_THREADS} != "no"
CFLAGS+= -DSORT_THREADS
LDFLAGS+= -lpthread -lmd
MAN_SUB+= -e 's|%%THREADS%%||g'
@@ -20,7 +20,7 @@ LDFLAGS+= -lmd
MAN_SUB+= -e 's|%%THREADS%%|\.\\"|g'
.endif
-.if !defined(WITHOUT_NLS)
+.if ${MK_NLS} != "no"
NLS+= hu_HU.ISO8859-2
NLSSRCFILES= ${NLS:S@$@.msg@}
MAN_SUB+= -e 's|%%NLS%%||g'
diff --git a/usr.bin/sort/bwstring.h b/usr.bin/sort/bwstring.h
index 93098f370e0c0..7402ec683a845 100644
--- a/usr.bin/sort/bwstring.h
+++ b/usr.bin/sort/bwstring.h
@@ -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 iter)
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);
diff --git a/usr.bin/sort/coll.h b/usr.bin/sort/coll.h
index 9299742670410..9a70b8eaaba93 100644
--- a/usr.bin/sort/coll.h
+++ b/usr.bin/sort/coll.h
@@ -28,7 +28,7 @@
*/
#if !defined(__COLL_H__)
-#define __COLL_H__
+#define __COLL_H__
#include "bwstring.h"
#include "sort.h"
diff --git a/usr.bin/sort/file.h b/usr.bin/sort/file.h
index ae33a2a7e9d3a..7037d87486f83 100644
--- a/usr.bin/sort/file.h
+++ b/usr.bin/sort/file.h
@@ -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.
diff --git a/usr.bin/sort/mem.h b/usr.bin/sort/mem.h
index 44eb5449a1d3c..36671e32d2418 100644
--- a/usr.bin/sort/mem.h
+++ b/usr.bin/sort/mem.h
@@ -28,7 +28,7 @@
*/
#if !defined(__SORT_MEM_H__)
-#define __SORT_MEM_H__
+#define __SORT_MEM_H__
#include <errno.h>
#include <stdbool.h>
diff --git a/usr.bin/sort/radixsort.c b/usr.bin/sort/radixsort.c
index fde2b6f886235..f6cf6ac1a040f 100644
--- a/usr.bin/sort/radixsort.c
+++ b/usr.bin/sort/radixsort.c
@@ -171,6 +171,8 @@ pop_ls_st(void)
return (sl);
}
+#if defined(SORT_THREADS)
+
/*
* Pop sort level from the stack (multi-threaded style)
*/
@@ -180,9 +182,7 @@ pop_ls_mt(void)
struct level_stack *saved_ls;
struct sort_level *sl;
-#if defined(SORT_THREADS)
pthread_mutex_lock(&g_ls_mutex);
-#endif
if (g_ls) {
sl = g_ls->sl;
@@ -193,15 +193,15 @@ pop_ls_mt(void)
saved_ls = NULL;
}
-#if defined(SORT_THREADS)
pthread_mutex_unlock(&g_ls_mutex);
-#endif
sort_free(saved_ls);
return (sl);
}
+#endif /* defined(SORT_THREADS) */
+
static void
add_to_sublevel(struct sort_level *sl, struct sort_list_item *item, size_t indx)
{
diff --git a/usr.bin/sort/radixsort.h b/usr.bin/sort/radixsort.h
index ff881a3f8d1fb..87437285dbf5b 100644
--- a/usr.bin/sort/radixsort.h
+++ b/usr.bin/sort/radixsort.h
@@ -28,7 +28,7 @@
*/
#if !defined(__SORT_RADIX_H__)
-#define __SORT_RADIX_H__
+#define __SORT_RADIX_H__
#include "coll.h"
#include "sort.h"
diff --git a/usr.bin/sort/sort.1.in b/usr.bin/sort/sort.1.in
index 887621f2c5e1d..11330fb414ec7 100644
--- a/usr.bin/sort/sort.1.in
+++ b/usr.bin/sort/sort.1.in
@@ -147,7 +147,7 @@ specifications, they apply globally to all sort keys.
When attached to a specific key (see
.Fl k ) ,
the ordering options override all global ordering options for
-the key they are attahced to.
+the key they are attached to.
.Bl -tag -width indent
.It Fl b, Fl Fl ignore-leading-blanks
Ignore leading blank characters when comparing lines.
@@ -194,7 +194,7 @@ This is a random permutation of the inputs except that
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 and versions (leading
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:
diff --git a/usr.bin/sort/sort.h b/usr.bin/sort/sort.h
index e339ff729b253..41dd60e77014c 100644
--- a/usr.bin/sort/sort.h
+++ b/usr.bin/sort/sort.h
@@ -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
diff --git a/usr.bin/sort/vsort.h b/usr.bin/sort/vsort.h
index 17f58e59c1607..5f9db7404387c 100644
--- a/usr.bin/sort/vsort.h
+++ b/usr.bin/sort/vsort.h
@@ -28,7 +28,7 @@
*/
#ifndef _VSORT_H_
-#define _VSORT_H_
+#define _VSORT_H_
#include "bwstring.h"