summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorgabor <gabor@FreeBSD.org>2012-05-14 10:06:49 +0000
committergabor <gabor@FreeBSD.org>2012-05-14 10:06:49 +0000
commit1b903beae46f0ebb015f7c9324d69568f36e1471 (patch)
tree4dba7dc792e90030a3020b473382f379d3ef60a5 /usr.bin
parent9b268b4b63983d914b00a2bd364c80367028161f (diff)
downloadFreeBSD-src-1b903beae46f0ebb015f7c9324d69568f36e1471.zip
FreeBSD-src-1b903beae46f0ebb015f7c9324d69568f36e1471.tar.gz
- Eliminate initializations if global variables. Compilers are not
required to optimize these so it may result in larger binary size. Pointed out by: kib
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/sort/bwstring.c6
-rw-r--r--usr.bin/sort/coll.c2
-rw-r--r--usr.bin/sort/file.c2
-rw-r--r--usr.bin/sort/radixsort.c6
-rw-r--r--usr.bin/sort/sort.c18
5 files changed, 17 insertions, 17 deletions
diff --git a/usr.bin/sort/bwstring.c b/usr.bin/sort/bwstring.c
index 20587de..9ebeb10 100644
--- a/usr.bin/sort/bwstring.c
+++ b/usr.bin/sort/bwstring.c
@@ -41,10 +41,10 @@ __FBSDID("$FreeBSD$");
#include "bwstring.h"
#include "sort.h"
-bool byte_sort = false;
+bool byte_sort;
-static wchar_t **wmonths = NULL;
-static unsigned char **cmonths = NULL;
+static wchar_t **wmonths;
+static unsigned char **cmonths;
/* initialise months */
diff --git a/usr.bin/sort/coll.c b/usr.bin/sort/coll.c
index 0a341e4..6d2d293 100644
--- a/usr.bin/sort/coll.c
+++ b/usr.bin/sort/coll.c
@@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$");
#include "coll.h"
#include "vsort.h"
-struct key_specs *keys = NULL;
+struct key_specs *keys;
size_t keys_num = 0;
wchar_t symbol_decimal_point = L'.';
diff --git a/usr.bin/sort/file.c b/usr.bin/sort/file.c
index 9cfcef4..9afa4b2 100644
--- a/usr.bin/sort/file.c
+++ b/usr.bin/sort/file.c
@@ -54,7 +54,7 @@ unsigned long long free_memory = 1000000;
unsigned long long available_free_memory = 1000000;
const char *tmpdir = "/var/tmp";
-const char* compress_program = NULL;
+const char *compress_program;
size_t max_open_files = 16;
diff --git a/usr.bin/sort/radixsort.c b/usr.bin/sort/radixsort.c
index 5d0dea7..6fa2d3a 100644
--- a/usr.bin/sort/radixsort.c
+++ b/usr.bin/sort/radixsort.c
@@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$");
#define SMALL_NODE(sl) ((sl)->tosort_num < 5)
/* are we sorting in reverse order ? */
-static bool reverse_sort = false;
+static bool reverse_sort;
/* sort sub-levels array size */
static const size_t slsz = 256 * sizeof(struct sort_level*);
@@ -77,14 +77,14 @@ struct level_stack {
struct sort_level *sl;
};
-static struct level_stack *g_ls = NULL;
+static struct level_stack *g_ls;
#if defined(SORT_THREADS)
/* stack guarding mutex */
static pthread_mutex_t g_ls_mutex;
/* counter: how many items are left */
-static size_t sort_left = 0;
+static size_t sort_left;
/* guarding mutex */
static pthread_mutex_t sort_left_mutex;
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c
index c0b87ba..6bd7b38 100644
--- a/usr.bin/sort/sort.c
+++ b/usr.bin/sort/sort.c
@@ -62,10 +62,10 @@ nl_catd catalog;
#define DEFAULT_RANDOM_SORT_SEED_FILE ("/dev/random")
#define MAX_DEFAULT_RANDOM_SEED_DATA_SIZE (1024)
-static bool need_random = false;
-static const char* random_source = DEFAULT_RANDOM_SORT_SEED_FILE;
-static const void* random_seed = NULL;
-static size_t random_seed_size = 0;
+static bool need_random;
+static const char *random_source = DEFAULT_RANDOM_SORT_SEED_FILE;
+static const void *random_seed;
+static size_t random_seed_size;
MD5_CTX md5_ctx;
@@ -98,26 +98,26 @@ const char *nlsstr[] = { "",
struct sort_opts sort_opts_vals;
-bool debug_sort = false;
-bool need_hint = false;
+bool debug_sort;
+bool need_hint;
#if defined(SORT_THREADS)
size_t ncpu = 1;
size_t nthreads = 1;
#endif
-static bool gnusort_numeric_compatibility = false;
+static bool gnusort_numeric_compatibility;
static struct sort_mods default_sort_mods_object;
struct sort_mods * const default_sort_mods = &default_sort_mods_object;
-static bool print_symbols_on_debug = false;
+static bool print_symbols_on_debug;
/*
* Arguments from file (when file0-from option is used:
*/
static int argc_from_file0 = -1;
-static char **argv_from_file0 = NULL;
+static char **argv_from_file0;
/*
* Placeholder symbols for options which have no single-character equivalent
OpenPOWER on IntegriCloud