Skip to content

Commit d178111

Browse files
committed
Merge branch 'rj/warning-uninitialized-fix'
Compilation fix. * rj/warning-uninitialized-fix: read-cache: fix an -Wmaybe-uninitialized warning -Wuninitialized: remove some 'init-self' workarounds
2 parents c108a77 + 00a4b03 commit d178111

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

builtin/rev-list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
536536
mark_edges_uninteresting(&revs, show_edge);
537537

538538
if (bisect_list) {
539-
int reaches = reaches, all = all;
539+
int reaches, all;
540540

541541
find_bisection(&revs.commits, &reaches, &all, bisect_find_all);
542542

fast-import.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,7 +3005,7 @@ static void cat_blob(struct object_entry *oe, struct object_id *oid)
30053005

30063006
static void parse_get_mark(const char *p)
30073007
{
3008-
struct object_entry *oe = oe;
3008+
struct object_entry *oe;
30093009
char output[GIT_MAX_HEXSZ + 2];
30103010

30113011
/* get-mark SP <object> LF */
@@ -3022,7 +3022,7 @@ static void parse_get_mark(const char *p)
30223022

30233023
static void parse_cat_blob(const char *p)
30243024
{
3025-
struct object_entry *oe = oe;
3025+
struct object_entry *oe;
30263026
struct object_id oid;
30273027

30283028
/* cat-blob SP <object> LF */

merge-recursive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,7 @@ int merge_recursive(struct merge_options *o,
20902090
{
20912091
struct commit_list *iter;
20922092
struct commit *merged_common_ancestors;
2093-
struct tree *mrtree = mrtree;
2093+
struct tree *mrtree;
20942094
int clean;
20952095

20962096
if (show(o, 4)) {

read-cache.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,13 +2110,15 @@ static int ce_write_entry(git_hash_ctx *c, int fd, struct cache_entry *ce,
21102110
struct strbuf *previous_name, struct ondisk_cache_entry *ondisk)
21112111
{
21122112
int size;
2113-
int saved_namelen = saved_namelen; /* compiler workaround */
21142113
int result;
2114+
unsigned int saved_namelen;
2115+
int stripped_name = 0;
21152116
static unsigned char padding[8] = { 0x00 };
21162117

21172118
if (ce->ce_flags & CE_STRIP_NAME) {
21182119
saved_namelen = ce_namelen(ce);
21192120
ce->ce_namelen = 0;
2121+
stripped_name = 1;
21202122
}
21212123

21222124
if (ce->ce_flags & CE_EXTENDED)
@@ -2156,7 +2158,7 @@ static int ce_write_entry(git_hash_ctx *c, int fd, struct cache_entry *ce,
21562158
strbuf_splice(previous_name, common, to_remove,
21572159
ce->name + common, ce_namelen(ce) - common);
21582160
}
2159-
if (ce->ce_flags & CE_STRIP_NAME) {
2161+
if (stripped_name) {
21602162
ce->ce_namelen = saved_namelen;
21612163
ce->ce_flags &= ~CE_STRIP_NAME;
21622164
}

0 commit comments

Comments
 (0)