Skip to content

Commit c0aa335

Browse files
dschogitster
authored andcommitted
Remove unused variables
Noticed by gcc 4.6.0. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent c2e86ad commit c0aa335

File tree

7 files changed

+5
-19
lines changed

7 files changed

+5
-19
lines changed

builtin/fsck.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,10 @@ static int traverse_reachable(void)
140140
int result = 0;
141141
while (pending.nr) {
142142
struct object_array_entry *entry;
143-
struct object *obj, *parent;
143+
struct object *obj;
144144

145145
entry = pending.objects + --pending.nr;
146146
obj = entry->item;
147-
parent = (struct object *) entry->name;
148147
result |= traverse_one_object(obj);
149148
}
150149
return !!result;

builtin/remote-ext.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,12 @@ static char *strip_escapes(const char *str, const char *service,
3030
size_t rpos = 0;
3131
int escape = 0;
3232
char special = 0;
33-
size_t pslen = 0;
34-
size_t pSlen = 0;
3533
size_t psoff = 0;
3634
struct strbuf ret = STRBUF_INIT;
3735

3836
/* Calculate prefix length for \s and lengths for \s and \S */
3937
if (!strncmp(service, "git-", 4))
4038
psoff = 4;
41-
pSlen = strlen(service);
42-
pslen = pSlen - psoff;
4339

4440
/* Pass the service to command. */
4541
setenv("GIT_EXT_SERVICE", service, 1);

diff.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
12421242
uintmax_t max_change = 0, max_len = 0;
12431243
int total_files = data->nr;
12441244
int width, name_width;
1245-
const char *reset, *set, *add_c, *del_c;
1245+
const char *reset, *add_c, *del_c;
12461246
const char *line_prefix = "";
12471247
struct strbuf *msg = NULL;
12481248

@@ -1269,7 +1269,6 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
12691269

12701270
/* Find the longest filename and max number of changes */
12711271
reset = diff_get_color_opt(options, DIFF_RESET);
1272-
set = diff_get_color_opt(options, DIFF_PLAIN);
12731272
add_c = diff_get_color_opt(options, DIFF_FILE_NEW);
12741273
del_c = diff_get_color_opt(options, DIFF_FILE_OLD);
12751274

reachable.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,11 @@ static void process_tree(struct tree *tree,
7070
static void process_tag(struct tag *tag, struct object_array *p, const char *name)
7171
{
7272
struct object *obj = &tag->object;
73-
struct name_path me;
7473

7574
if (obj->flags & SEEN)
7675
return;
7776
obj->flags |= SEEN;
7877

79-
me.up = NULL;
80-
me.elem = "tag:/";
81-
me.elem_len = 5;
82-
8378
if (parse_tag(tag) < 0)
8479
die("bad tag object %s", sha1_to_hex(obj->sha1));
8580
if (tag->tagged)

test-subprocess.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33

44
int main(int argc, char **argv)
55
{
6-
const char *prefix;
76
struct child_process cp;
87
int nogit = 0;
98

10-
prefix = setup_git_directory_gently(&nogit);
9+
setup_git_directory_gently(&nogit);
1110
if (nogit)
1211
die("No git repo found");
1312
if (!strcmp(argv[1], "--setup-work-tree")) {

transport-helper.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,9 @@ static int push_refs_with_push(struct transport *transport,
561561
int mirror = flags & TRANSPORT_PUSH_MIRROR;
562562
struct helper_data *data = transport->data;
563563
struct strbuf buf = STRBUF_INIT;
564-
struct child_process *helper;
565564
struct ref *ref;
566565

567-
helper = get_helper(transport);
566+
get_helper(transport);
568567
if (!data->push)
569568
return 1;
570569

tree-diff.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2,
1717
const unsigned char *sha1, *sha2;
1818
int cmp, pathlen1, pathlen2;
1919
int old_baselen = base->len;
20-
int retval = 0;
2120

2221
sha1 = tree_entry_extract(t1, &path1, &mode1);
2322
sha2 = tree_entry_extract(t2, &path2, &mode2);
@@ -53,7 +52,7 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2,
5352
sha1, sha2, base->buf, 0, 0);
5453
}
5554
strbuf_addch(base, '/');
56-
retval = diff_tree_sha1(sha1, sha2, base->buf, opt);
55+
diff_tree_sha1(sha1, sha2, base->buf, opt);
5756
} else {
5857
opt->change(opt, mode1, mode2, sha1, sha2, base->buf, 0, 0);
5958
}

0 commit comments

Comments
 (0)