- Eliminate initializations if global variables. Compilers are not
required to optimize these so it may result in larger binary size. Pointed out by: kib
This commit is contained in:
parent
131a228a6d
commit
ce1e997f54
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=235435
@ -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 */
|
||||
|
||||
|
@ -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'.';
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 bool need_random;
|
||||
static const char *random_source = DEFAULT_RANDOM_SORT_SEED_FILE;
|
||||
static const void* random_seed = NULL;
|
||||
static size_t random_seed_size = 0;
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user