mirror of
https://github.com/git/git
synced 2024-06-30 22:54:27 +00:00
pretty: add casts for decoration option pointers
The `struct decoration_options` have a prefix and suffix field which are both non-constant, but we assign a constant pointer to them. This is safe to do because we pass them to `format_decorations()`, which never modifies these pointers, and then immediately discard the structure. Add explicit casts to avoid compilation warnings with `-Wwrite-strings`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9f03e4813a
commit
9c076c32fb
4
pretty.c
4
pretty.c
|
@ -1584,8 +1584,8 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
|
||||||
case 'D':
|
case 'D':
|
||||||
{
|
{
|
||||||
const struct decoration_options opts = {
|
const struct decoration_options opts = {
|
||||||
.prefix = "",
|
.prefix = (char *) "",
|
||||||
.suffix = ""
|
.suffix = (char *) "",
|
||||||
};
|
};
|
||||||
|
|
||||||
format_decorations(sb, commit, c->auto_color, &opts);
|
format_decorations(sb, commit, c->auto_color, &opts);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user