Remove unused variables

Noticed by gcc 4.6.0.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2011-03-22 12:39:31 +01:00
parent 3377895dc4
commit ad4cb95da4
7 changed files with 4 additions and 21 deletions

View File

@@ -140,11 +140,10 @@ static int traverse_reachable(void)
int result = 0;
while (pending.nr) {
struct object_array_entry *entry;
struct object *obj, *parent;
struct object *obj;
entry = pending.objects + --pending.nr;
obj = entry->item;
parent = (struct object *) entry->name;
result |= traverse_one_object(obj);
}
return !!result;

View File

@@ -30,16 +30,12 @@ static char *strip_escapes(const char *str, const char *service,
size_t rpos = 0;
int escape = 0;
char special = 0;
size_t pslen = 0;
size_t pSlen = 0;
size_t psoff = 0;
struct strbuf ret = STRBUF_INIT;
/* Calculate prefix length for \s and lengths for \s and \S */
if (!strncmp(service, "git-", 4))
psoff = 4;
pSlen = strlen(service);
pslen = pSlen - psoff;
/* Pass the service to command. */
setenv("GIT_EXT_SERVICE", service, 1);

3
diff.c
View File

@@ -1235,7 +1235,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
uintmax_t max_change = 0, max_len = 0;
int total_files = data->nr;
int width, name_width;
const char *reset, *set, *add_c, *del_c;
const char *reset, *add_c, *del_c;
const char *line_prefix = "";
struct strbuf *msg = NULL;
@@ -1262,7 +1262,6 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
/* Find the longest filename and max number of changes */
reset = diff_get_color_opt(options, DIFF_RESET);
set = diff_get_color_opt(options, DIFF_PLAIN);
add_c = diff_get_color_opt(options, DIFF_FILE_NEW);
del_c = diff_get_color_opt(options, DIFF_FILE_OLD);

View File

@@ -366,7 +366,6 @@ static void make_room_for_directories_of_df_conflicts(struct merge_options *o,
*/
const char *last_file = NULL;
int last_len = 0;
struct stage_data *last_e;
int i;
for (i = 0; i < entries->nr; i++) {
@@ -396,7 +395,6 @@ static void make_room_for_directories_of_df_conflicts(struct merge_options *o,
if (S_ISREG(e->stages[2].mode) || S_ISLNK(e->stages[2].mode)) {
last_file = path;
last_len = len;
last_e = e;
} else {
last_file = NULL;
}
@@ -971,7 +969,6 @@ static int process_renames(struct merge_options *o,
}
for (i = 0, j = 0; i < a_renames->nr || j < b_renames->nr;) {
char *src;
struct string_list *renames1, *renames2Dst;
struct rename *ren1 = NULL, *ren2 = NULL;
const char *branch1, *branch2;
@@ -1006,7 +1003,6 @@ static int process_renames(struct merge_options *o,
ren2 = ren1;
ren1 = tmp;
}
src = ren1->pair->one->path;
ren1->dst_entry->processed = 1;
ren1->src_entry->processed = 1;

View File

@@ -70,16 +70,11 @@ static void process_tree(struct tree *tree,
static void process_tag(struct tag *tag, struct object_array *p, const char *name)
{
struct object *obj = &tag->object;
struct name_path me;
if (obj->flags & SEEN)
return;
obj->flags |= SEEN;
me.up = NULL;
me.elem = "tag:/";
me.elem_len = 5;
if (parse_tag(tag) < 0)
die("bad tag object %s", sha1_to_hex(obj->sha1));
if (tag->tagged)

View File

@@ -3,11 +3,10 @@
int main(int argc, char **argv)
{
const char *prefix;
struct child_process cp;
int nogit = 0;
prefix = setup_git_directory_gently(&nogit);
setup_git_directory_gently(&nogit);
if (nogit)
die("No git repo found");
if (!strcmp(argv[1], "--setup-work-tree")) {

View File

@@ -562,10 +562,9 @@ static int push_refs_with_push(struct transport *transport,
int mirror = flags & TRANSPORT_PUSH_MIRROR;
struct helper_data *data = transport->data;
struct strbuf buf = STRBUF_INIT;
struct child_process *helper;
struct ref *ref;
helper = get_helper(transport);
get_helper(transport);
if (!data->push)
return 1;