Replace all die("BUG: ...") calls by BUG() ones

In d8193743e0 (usage.c: add BUG() function, 2017-05-12), a new macro
was introduced to use for reporting bugs instead of die(). It was then
subsequently used to convert one single caller in 588a538ae5
(setup_git_env: convert die("BUG") to BUG(), 2017-05-12).

The cover letter of the patch series containing this patch
(cf 20170513032414.mfrwabt4hovujde2@sigill.intra.peff.net) is not
terribly clear why only one call site was converted, or what the plan
is for other, similar calls to die() to report bugs.

Let's just convert all remaining ones in one fell swoop.

This trick was performed by this invocation:

	sed -i 's/die("BUG: /BUG("/g' $(git grep -l 'die("BUG' \*.c)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2018-05-02 11:38:39 +02:00
committed by Junio C Hamano
parent dde74d732f
commit 033abf97fc
67 changed files with 190 additions and 190 deletions

16
grep.c
View File

@ -404,7 +404,7 @@ static void compile_pcre1_regexp(struct grep_pat *p, const struct grep_opt *opt)
die("Couldn't allocate PCRE JIT stack");
pcre_assign_jit_stack(p->pcre1_extra_info, NULL, p->pcre1_jit_stack);
} else if (p->pcre1_jit_on != 0) {
die("BUG: The pcre1_jit_on variable should be 0 or 1, not %d",
BUG("The pcre1_jit_on variable should be 0 or 1, not %d",
p->pcre1_jit_on);
}
#endif
@ -550,7 +550,7 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
die("Couldn't allocate PCRE2 match context");
pcre2_jit_stack_assign(p->pcre2_match_context, NULL, p->pcre2_jit_stack);
} else if (p->pcre2_jit_on != 0) {
die("BUG: The pcre2_jit_on variable should be 0 or 1, not %d",
BUG("The pcre2_jit_on variable should be 0 or 1, not %d",
p->pcre1_jit_on);
}
}
@ -917,10 +917,10 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt)
for (p = opt->header_list; p; p = p->next) {
if (p->token != GREP_PATTERN_HEAD)
die("BUG: a non-header pattern in grep header list.");
BUG("a non-header pattern in grep header list.");
if (p->field < GREP_HEADER_FIELD_MIN ||
GREP_HEADER_FIELD_MAX <= p->field)
die("BUG: unknown header field %d", p->field);
BUG("unknown header field %d", p->field);
compile_regexp(p, opt);
}
@ -933,7 +933,7 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt)
h = compile_pattern_atom(&pp);
if (!h || pp != p->next)
die("BUG: malformed header expr");
BUG("malformed header expr");
if (!header_group[p->field]) {
header_group[p->field] = h;
continue;
@ -1652,7 +1652,7 @@ static int fill_textconv_grep(struct userdiff_driver *driver,
fill_filespec(df, &null_oid, 0, 0100644);
break;
default:
die("BUG: attempt to textconv something without a path?");
BUG("attempt to textconv something without a path?");
}
/*
@ -1748,7 +1748,7 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
case GREP_BINARY_TEXT:
break;
default:
die("BUG: unknown binary handling mode");
BUG("unknown binary handling mode");
}
}
@ -2072,7 +2072,7 @@ static int grep_source_load(struct grep_source *gs)
case GREP_SOURCE_BUF:
return gs->buf ? 0 : -1;
}
die("BUG: invalid grep_source type to load");
BUG("invalid grep_source type to load");
}
void grep_source_load_driver(struct grep_source *gs)