remove unnecessary initializations

[jc: I needed to hand merge the changes to the updated codebase,
 so the result needs to be checked.]

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
David Rientjes 2006-08-15 10:23:48 -07:00 коммит произвёл Junio C Hamano
Родитель c9c3470aec
Коммит 96f1e58f52
42 изменённых файлов: 163 добавлений и 163 удалений

Просмотреть файл

@ -56,9 +56,9 @@ struct patch {
static void get_blob(struct commit *commit);
/* Only used for statistics */
static int num_get_patch = 0;
static int num_commits = 0;
static int patch_time = 0;
static int num_get_patch;
static int num_commits;
static int patch_time;
struct blame_diff_state {
struct xdiff_emit_state xm;

Просмотреть файл

@ -28,18 +28,18 @@ static int prefix_length = -1;
static int newfd = -1;
static int p_value = 1;
static int allow_binary_replacement = 0;
static int check_index = 0;
static int write_index = 0;
static int cached = 0;
static int diffstat = 0;
static int numstat = 0;
static int summary = 0;
static int check = 0;
static int allow_binary_replacement;
static int check_index;
static int write_index;
static int cached;
static int diffstat;
static int numstat;
static int summary;
static int check;
static int apply = 1;
static int apply_in_reverse = 0;
static int no_add = 0;
static int show_index_info = 0;
static int apply_in_reverse;
static int no_add;
static int show_index_info;
static int line_termination = '\n';
static unsigned long p_context = -1;
static const char apply_usage[] =
@ -51,10 +51,10 @@ static enum whitespace_eol {
error_on_whitespace,
strip_whitespace,
} new_whitespace = warn_on_whitespace;
static int whitespace_error = 0;
static int whitespace_error;
static int squelch_whitespace_errors = 5;
static int applied_after_stripping = 0;
static const char *patch_input_file = NULL;
static int applied_after_stripping;
static const char *patch_input_file;
static void parse_whitespace_option(const char *option)
{

Просмотреть файл

@ -8,7 +8,7 @@
static const char *fmt_merge_msg_usage =
"git-fmt-merge-msg [--summary] [--no-summary] [--file <file>]";
static int merge_summary = 0;
static int merge_summary;
static int fmt_merge_msg_config(const char *key, const char *value)
{

Просмотреть файл

@ -12,21 +12,22 @@
#include "dir.h"
#include "builtin.h"
static int abbrev = 0;
static int show_deleted = 0;
static int show_cached = 0;
static int show_others = 0;
static int show_stage = 0;
static int show_unmerged = 0;
static int show_modified = 0;
static int show_killed = 0;
static int show_valid_bit = 0;
static int abbrev;
static int show_deleted;
static int show_cached;
static int show_others;
static int show_stage;
static int show_unmerged;
static int show_modified;
static int show_killed;
static int show_valid_bit;
static int line_terminator = '\n';
static int prefix_len = 0, prefix_offset = 0;
static const char **pathspec = NULL;
static int error_unmatch = 0;
static char *ps_matched = NULL;
static int prefix_len;
static int prefix_offset;
static const char **pathspec;
static int error_unmatch;
static char *ps_matched;
static const char *tag_cached = "";
static const char *tag_unmerged = "";

Просмотреть файл

@ -14,10 +14,10 @@ static int line_termination = '\n';
#define LS_TREE_ONLY 2
#define LS_SHOW_TREES 4
#define LS_NAME_ONLY 8
static int abbrev = 0;
static int ls_options = 0;
static int abbrev;
static int ls_options;
static const char **pathspec;
static int chomp_prefix = 0;
static int chomp_prefix;
static const char *ls_tree_prefix;
static const char ls_tree_usage[] =

Просмотреть файл

@ -16,8 +16,8 @@
static FILE *cmitmsg, *patchfile, *fin, *fout;
static int keep_subject = 0;
static const char *metainfo_charset = NULL;
static int keep_subject;
static const char *metainfo_charset;
static char line[1000];
static char date[1000];
static char name[1000];
@ -31,7 +31,7 @@ static char charset[256];
static char multipart_boundary[1000];
static int multipart_boundary_len;
static int patch_lines = 0;
static int patch_lines;
static char *sanity_check(char *name, char *email)
{

Просмотреть файл

@ -75,7 +75,7 @@ copy_data:
}
}
static int tags_only = 0;
static int tags_only;
static int name_ref(const char *path, const unsigned char *sha1)
{

Просмотреть файл

@ -53,17 +53,17 @@ struct object_entry {
*/
static unsigned char object_list_sha1[20];
static int non_empty = 0;
static int no_reuse_delta = 0;
static int local = 0;
static int incremental = 0;
static int non_empty;
static int no_reuse_delta;
static int local;
static int incremental;
static struct object_entry **sorted_by_sha, **sorted_by_type;
static struct object_entry *objects = NULL;
static int nr_objects = 0, nr_alloc = 0, nr_result = 0;
static struct object_entry *objects;
static int nr_objects, nr_alloc, nr_result;
static const char *base_name;
static unsigned char pack_file_sha1[20];
static int progress = 1;
static volatile sig_atomic_t progress_update = 0;
static volatile sig_atomic_t progress_update;
static int window = 10;
/*
@ -72,8 +72,8 @@ static int window = 10;
* sorted_by_sha is also possible but this was easier to code and faster.
* This hashtable is built after all the objects are seen.
*/
static int *object_ix = NULL;
static int object_ix_hashsz = 0;
static int *object_ix;
static int object_ix_hashsz;
/*
* Pack index for existing packs give us easy access to the offsets into
@ -90,15 +90,15 @@ struct pack_revindex {
struct packed_git *p;
unsigned long *revindex;
} *pack_revindex = NULL;
static int pack_revindex_hashsz = 0;
static int pack_revindex_hashsz;
/*
* stats
*/
static int written = 0;
static int written_delta = 0;
static int reused = 0;
static int reused_delta = 0;
static int written;
static int written_delta;
static int reused;
static int reused_delta;
static int pack_revindex_ix(struct packed_git *p)
{

Просмотреть файл

@ -11,7 +11,7 @@
#include "cache-tree.h"
static const char prune_usage[] = "git-prune [-n]";
static int show_only = 0;
static int show_only;
static struct rev_info revs;
static int prune_object(char *path, const char *filename, const unsigned char *sha1)

Просмотреть файл

@ -10,14 +10,14 @@
static const char push_usage[] = "git-push [--all] [--tags] [-f | --force] <repository> [<refspec>...]";
static int all = 0, tags = 0, force = 0, thin = 1;
static const char *execute = NULL;
static int all, tags, force, thin = 1;
static const char *execute;
#define BUF_SIZE (2084)
static char buffer[BUF_SIZE];
static const char **refspec = NULL;
static int refspec_nr = 0;
static const char **refspec;
static int refspec_nr;
static void add_refspec(const char *ref)
{

Просмотреть файл

@ -12,7 +12,7 @@
#include "unpack-trees.h"
#include "builtin.h"
static struct object_list *trees = NULL;
static struct object_list *trees;
static int list_tree(unsigned char *sha1)
{

Просмотреть файл

@ -5,14 +5,14 @@
static const char git_config_set_usage[] =
"git-repo-config [ --bool | --int ] [--get | --get-all | --get-regexp | --replace-all | --unset | --unset-all] name [value [value_regex]] | --list";
static char* key = NULL;
static regex_t* key_regexp = NULL;
static regex_t* regexp = NULL;
static int show_keys = 0;
static int use_key_regexp = 0;
static int do_all = 0;
static int do_not_match = 0;
static int seen = 0;
static char *key;
static regex_t *key_regexp;
static regex_t *regexp;
static int show_keys;
static int use_key_regexp;
static int do_all;
static int do_not_match;
static int seen;
static enum { T_RAW, T_INT, T_BOOL } type = T_RAW;
static int show_all_config(const char *key_, const char *value_)

Просмотреть файл

@ -39,9 +39,9 @@ static const char rev_list_usage[] =
static struct rev_info revs;
static int bisect_list = 0;
static int show_timestamp = 0;
static int hdr_termination = 0;
static int bisect_list;
static int show_timestamp;
static int hdr_termination;
static const char *header_prefix;
static void show_commit(struct commit *commit)

Просмотреть файл

@ -15,16 +15,16 @@
#define DO_NONFLAGS 8
static int filter = ~0;
static const char *def = NULL;
static const char *def;
#define NORMAL 0
#define REVERSED 1
static int show_type = NORMAL;
static int symbolic = 0;
static int abbrev = 0;
static int output_sq = 0;
static int symbolic;
static int abbrev;
static int output_sq;
static int revs_count = 0;
static int revs_count;
/*
* Some arguments are relevant "revision" arguments,

Просмотреть файл

@ -8,9 +8,9 @@
static const char show_branch_usage[] =
"git-show-branch [--sparse] [--current] [--all] [--heads] [--tags] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...]";
static int default_num = 0;
static int default_alloc = 0;
static const char **default_arg = NULL;
static int default_num;
static int default_alloc;
static const char **default_arg;
#define UNINTERESTING 01

Просмотреть файл

@ -23,7 +23,7 @@ static int allow_replace;
static int info_only;
static int force_remove;
static int verbose;
static int mark_valid_only = 0;
static int mark_valid_only;
#define MARK_VALID 1
#define UNMARK_VALID 2

Просмотреть файл

@ -727,10 +727,10 @@ struct commit *pop_commit(struct commit_list **stack)
int count_parents(struct commit * commit)
{
int count = 0;
int count;
struct commit_list * parents = commit->parents;
for (count=0;parents; parents=parents->next,count++)
;
for (count = 0; parents; parents = parents->next,count++)
;
return count;
}

Просмотреть файл

@ -10,7 +10,7 @@
#include <netdb.h>
#include <signal.h>
static char *server_capabilities = NULL;
static char *server_capabilities;
static int check_ref(const char *name, int len, unsigned int flags)
{
@ -493,8 +493,8 @@ static void git_tcp_connect(int fd[2], char *host)
}
static char *git_proxy_command = NULL;
static const char *rhost_name = NULL;
static char *git_proxy_command;
static const char *rhost_name;
static int rhost_len;
static int git_proxy_command_options(const char *var, const char *value)

Просмотреть файл

@ -22,24 +22,24 @@ static const char daemon_usage[] =
" [--reuseaddr] [--detach] [--pid-file=file] [directory...]";
/* List of acceptable pathname prefixes */
static char **ok_paths = NULL;
static int strict_paths = 0;
static char **ok_paths;
static int strict_paths;
/* If this is set, git-daemon-export-ok is not required */
static int export_all_trees = 0;
static int export_all_trees;
/* Take all paths relative to this one if non-NULL */
static char *base_path = NULL;
static char *base_path;
/* If defined, ~user notation is allowed and the string is inserted
* after ~user/. E.g. a request to git://host/~alice/frotz would
* go to /home/alice/pub_git/frotz with --user-path=pub_git.
*/
static const char *user_path = NULL;
static const char *user_path;
/* Timeout, and initial timeout */
static unsigned int timeout = 0;
static unsigned int init_timeout = 0;
static unsigned int timeout;
static unsigned int init_timeout;
static void logreport(int priority, const char *err, va_list params)
{
@ -333,12 +333,12 @@ static int execute(struct sockaddr *addr)
static int max_connections = 25;
/* These are updated by the signal handler */
static volatile unsigned int children_reaped = 0;
static volatile unsigned int children_reaped;
static pid_t dead_child[MAX_CHILDREN];
/* These are updated by the main loop */
static unsigned int children_spawned = 0;
static unsigned int children_deleted = 0;
static unsigned int children_spawned;
static unsigned int children_deleted;
static struct child {
pid_t pid;

Просмотреть файл

@ -8,12 +8,12 @@
static const char describe_usage[] =
"git-describe [--all] [--tags] [--abbrev=<n>] <committish>*";
static int all = 0; /* Default to annotated tags only */
static int tags = 0; /* But allow any tags if --tags is specified */
static int all; /* Default to annotated tags only */
static int tags; /* But allow any tags if --tags is specified */
static int abbrev = DEFAULT_ABBREV;
static int names = 0, allocs = 0;
static int names, allocs;
static struct commit_name {
const struct commit *commit;
int prio; /* annotated tag = 2, tag = 1, head = 0 */

4
diff.c
Просмотреть файл

@ -13,9 +13,9 @@
static int use_size_cache;
static int diff_detect_rename_default = 0;
static int diff_detect_rename_default;
static int diff_rename_limit_default = -1;
static int diff_use_color_default = 0;
static int diff_use_color_default;
/* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */
static char diff_colors[][24] = {

Просмотреть файл

@ -13,14 +13,14 @@ char git_default_email[MAX_GITNAME];
char git_default_name[MAX_GITNAME];
int use_legacy_headers = 1;
int trust_executable_bit = 1;
int assume_unchanged = 0;
int prefer_symlink_refs = 0;
int log_all_ref_updates = 0;
int assume_unchanged;
int prefer_symlink_refs;
int log_all_ref_updates;
int warn_ambiguous_refs = 1;
int repository_format_version = 0;
int repository_format_version;
char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";
int shared_repository = PERM_UMASK;
const char *apply_default_whitespace = NULL;
const char *apply_default_whitespace;
int zlib_compression_level = Z_DEFAULT_COMPRESSION;
int pager_in_use;
int pager_use_color = 1;

Просмотреть файл

@ -5,7 +5,7 @@
extern char **environ;
static const char *builtin_exec_path = GIT_EXEC_PATH;
static const char *current_exec_path = NULL;
static const char *current_exec_path;
void git_set_exec_path(const char *exec_path)
{

Просмотреть файл

@ -24,8 +24,8 @@ static const char *exec = "git-upload-pack";
*/
#define MAX_IN_VAIN 256
static struct commit_list *rev_list = NULL;
static int non_common_revs = 0, multi_ack = 0, use_thin_pack = 0, use_sideband;
static struct commit_list *rev_list;
static int non_common_revs, multi_ack, use_thin_pack, use_sideband;
static void rev_list_push(struct commit *commit, int mark)
{
@ -250,7 +250,7 @@ done:
return retval;
}
static struct commit_list *complete = NULL;
static struct commit_list *complete;
static int mark_complete(const char *path, const unsigned char *sha1)
{

Просмотреть файл

@ -14,12 +14,12 @@
#define REACHABLE 0x0001
#define SEEN 0x0002
static int show_root = 0;
static int show_tags = 0;
static int show_unreachable = 0;
static int check_full = 0;
static int check_strict = 0;
static int keep_cache_objects = 0;
static int show_root;
static int show_tags;
static int show_unreachable;
static int check_full;
static int check_strict;
static int keep_cache_objects;
static unsigned char head_sha1[20];
#ifdef NO_D_INO_IN_DIRENT
@ -400,7 +400,7 @@ static void fsck_dir(int i, char *path)
closedir(dir);
}
static int default_refs = 0;
static int default_refs;
static int fsck_handle_ref(const char *refname, const unsigned char *sha1)
{

2
git.c
Просмотреть файл

@ -92,7 +92,7 @@ static int handle_options(const char*** argv, int* argc)
}
static const char *alias_command;
static char *alias_string = NULL;
static char *alias_string;
static int git_alias_config(const char *var, const char *value)
{

2
help.c
Просмотреть файл

@ -14,7 +14,7 @@
static int term_columns(void)
{
char *col_string = getenv("COLUMNS");
int n_cols = 0;
int n_cols;
if (col_string && (n_cols = atoi(col_string)) > 0)
return n_cols;

Просмотреть файл

@ -36,10 +36,10 @@ enum XML_Status {
#define PREV_BUF_SIZE 4096
#define RANGE_HEADER_SIZE 30
static int commits_on_stdin = 0;
static int commits_on_stdin;
static int got_alternates = -1;
static int corrupt_object_found = 0;
static int corrupt_object_found;
static struct curl_slist *no_pragma_header;
@ -52,7 +52,7 @@ struct alt_base
struct alt_base *next;
};
static struct alt_base *alt = NULL;
static struct alt_base *alt;
enum object_request_state {
WAITING,
@ -114,7 +114,7 @@ struct remote_ls_ctx
};
#endif
static struct object_request *object_queue_head = NULL;
static struct object_request *object_queue_head;
static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb,
void *data)

Просмотреть файл

@ -70,18 +70,18 @@ enum XML_Status {
/* We allow "recursive" symbolic refs. Only within reason, though */
#define MAXDEPTH 5
static int pushing = 0;
static int aborted = 0;
static int pushing;
static int aborted;
static signed char remote_dir_exists[256];
static struct curl_slist *no_pragma_header;
static struct curl_slist *default_headers;
static int push_verbosely = 0;
static int push_all = 0;
static int force_all = 0;
static int push_verbosely;
static int push_all;
static int force_all;
static struct object_list *objects = NULL;
static struct object_list *objects;
struct repo
{
@ -94,7 +94,7 @@ struct repo
struct remote_lock *locks;
};
static struct repo *remote = NULL;
static struct repo *remote;
enum transfer_state {
NEED_FETCH,
@ -134,7 +134,7 @@ struct transfer_request
struct transfer_request *next;
};
static struct transfer_request *request_queue_head = NULL;
static struct transfer_request *request_queue_head;
struct xml_ctx
{

Просмотреть файл

@ -5,10 +5,10 @@
#include "commit.h"
#include "fetch.h"
static int use_link = 0;
static int use_symlink = 0;
static int use_link;
static int use_symlink;
static int use_filecopy = 1;
static int commits_on_stdin = 0;
static int commits_on_stdin;
static const char *path; /* "Remote" git repository */
@ -16,7 +16,7 @@ void prefetch(unsigned char *sha1)
{
}
static struct packed_git *packs = NULL;
static struct packed_git *packs;
static void setup_index(unsigned char *sha1)
{

Просмотреть файл

@ -2,7 +2,7 @@
#include "cache.h"
#include "commit.h"
static int show_all = 0;
static int show_all;
static int merge_base(struct commit *rev1, struct commit *rev2)
{

Просмотреть файл

@ -4,7 +4,7 @@
#include "cache.h"
static const char *pgm = NULL;
static const char *pgm;
static const char *arguments[8];
static int one_shot, quiet;
static int err;

Просмотреть файл

@ -49,7 +49,6 @@ static void write_tree(unsigned char *sha1)
int i;
qsort(entries, used, sizeof(*entries), ent_compare);
size = 100;
for (size = i = 0; i < used; i++)
size += 32 + entries[i]->len;
buffer = xmalloc(size);

Просмотреть файл

@ -13,7 +13,7 @@
static const char pack_redundant_usage[] =
"git-pack-redundant [ --verbose ] [ --alt-odb ] < --all | <.pack filename> ...>";
static int load_all_packs = 0, verbose = 0, alt_odb = 0;
static int load_all_packs, verbose, alt_odb;
struct llist_item {
struct llist_item *next;
@ -37,7 +37,7 @@ struct pll {
struct pack_list *pl;
};
static struct llist_item *free_nodes = NULL;
static struct llist_item *free_nodes;
static inline void llist_item_put(struct llist_item *item)
{

Просмотреть файл

@ -19,16 +19,16 @@
#define CACHE_EXT(s) ( (s[0]<<24)|(s[1]<<16)|(s[2]<<8)|(s[3]) )
#define CACHE_EXT_TREE 0x54524545 /* "TREE" */
struct cache_entry **active_cache = NULL;
struct cache_entry **active_cache;
static time_t index_file_timestamp;
unsigned int active_nr = 0, active_alloc = 0, active_cache_changed = 0;
unsigned int active_nr, active_alloc, active_cache_changed;
struct cache_tree *active_cache_tree = NULL;
struct cache_tree *active_cache_tree;
int cache_errno = 0;
int cache_errno;
static void *cache_mmap = NULL;
static size_t cache_mmap_size = 0;
static void *cache_mmap;
static size_t cache_mmap_size;
/*
* This only updates the "non-critical" parts of the directory

Просмотреть файл

@ -8,10 +8,10 @@ static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
static const char *unpacker[] = { "unpack-objects", NULL };
static int report_status = 0;
static int report_status;
static char capabilities[] = "report-status";
static int capabilities_sent = 0;
static int capabilities_sent;
static int show_ref(const char *path, const unsigned char *sha1)
{
@ -40,7 +40,7 @@ struct command {
char ref_name[FLEX_ARRAY]; /* more */
};
static struct command *commands = NULL;
static struct command *commands;
static int is_all_zeroes(const char *hex)
{

Просмотреть файл

@ -9,10 +9,10 @@ static const char send_pack_usage[] =
"git-send-pack [--all] [--exec=git-receive-pack] <remote> [<head>...]\n"
" --all and explicit <head> specification are mutually exclusive.";
static const char *exec = "git-receive-pack";
static int verbose = 0;
static int send_all = 0;
static int force_update = 0;
static int use_thin_pack = 0;
static int verbose;
static int send_all;
static int force_update;
static int use_thin_pack;
static int is_zero_sha1(const unsigned char *sha1)
{

Просмотреть файл

@ -22,7 +22,7 @@
#endif
#endif
const unsigned char null_sha1[20] = { 0, };
const unsigned char null_sha1[20];
static unsigned int sha1_file_open_flag = O_NOATIME;

Просмотреть файл

@ -17,7 +17,7 @@
static int fd_in;
static int fd_out;
static unsigned char remote_version = 0;
static unsigned char remote_version;
static unsigned char local_version = 1;
static ssize_t force_write(int fd, void *buffer, size_t length)
@ -36,9 +36,9 @@ static ssize_t force_write(int fd, void *buffer, size_t length)
return ret;
}
static int prefetches = 0;
static int prefetches;
static struct object_list *in_transit = NULL;
static struct object_list *in_transit;
static struct object_list **end_of_transit = &in_transit;
void prefetch(unsigned char *sha1)
@ -59,7 +59,7 @@ void prefetch(unsigned char *sha1)
}
static char conn_buf[4096];
static size_t conn_buf_posn = 0;
static size_t conn_buf_posn;
int fetch(unsigned char *sha1)
{

Просмотреть файл

@ -15,9 +15,9 @@
#include <string.h>
static unsigned char local_version = 1;
static unsigned char remote_version = 0;
static unsigned char remote_version;
static int verbose = 0;
static int verbose;
static int serve_object(int fd_in, int fd_out) {
ssize_t size;

Просмотреть файл

@ -278,7 +278,7 @@ static void unlink_entry(char *name)
}
}
static volatile sig_atomic_t progress_update = 0;
static volatile sig_atomic_t progress_update;
static void progress_interval(int signum)
{

Просмотреть файл

@ -14,12 +14,12 @@ static const char upload_pack_usage[] = "git-upload-pack [--strict] [--timeout=n
#define THEY_HAVE (1U << 0)
#define OUR_REF (1U << 1)
#define WANTED (1U << 2)
static int multi_ack = 0, nr_our_refs = 0;
static int use_thin_pack = 0;
static int multi_ack, nr_our_refs;
static int use_thin_pack;
static struct object_array have_obj;
static struct object_array want_obj;
static unsigned int timeout = 0;
static int use_sideband = 0;
static unsigned int timeout;
static int use_sideband;
static void reset_timeout(void)
{