summaryrefslogtreecommitdiff
path: root/json-writer.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-07-01 10:51:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-07-01 19:31:45 (GMT)
commit3d97ea479fdcb88671105e2f2d04064bab110bd5 (patch)
treea27eca58a56879dd07289bc85e46dddcc76e89cd /json-writer.h
parentebf3c04b262aa27fbb97f8a0156c2347fecafafb (diff)
downloadgit-3d97ea479fdcb88671105e2f2d04064bab110bd5.zip
git-3d97ea479fdcb88671105e2f2d04064bab110bd5.tar.gz
git-3d97ea479fdcb88671105e2f2d04064bab110bd5.tar.bz2
*.h: move some *_INIT to designated initializers
Move *_INIT macros I'll use in a subsequent commits to designated initializers. This isn't required for those follow-up changes, but since next commits will change things in this area, let's use the modern pattern over the old one while we're at it. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'json-writer.h')
-rw-r--r--json-writer.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/json-writer.h b/json-writer.h
index 83906b0..209355e 100644
--- a/json-writer.h
+++ b/json-writer.h
@@ -64,7 +64,10 @@ struct json_writer
unsigned int pretty:1;
};
-#define JSON_WRITER_INIT { STRBUF_INIT, STRBUF_INIT, 0, 0 }
+#define JSON_WRITER_INIT { \
+ .json = STRBUF_INIT, \
+ .open_stack = STRBUF_INIT, \
+}
void jw_init(struct json_writer *jw);
void jw_release(struct json_writer *jw);