Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/date.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-16 11:14:03 +0300
committerJunio C Hamano <gitster@pobox.com>2022-02-16 20:40:00 +0300
commitf1842898324330dcf7a3b30ea08d18a68bd19ceb (patch)
treede9ec60456d9f3f2b3e36db374d27288bed97eff /date.h
parent88c7b4c3c8d51510d20ebb9990750ad0e97afbfb (diff)
date API: provide and use a DATE_MODE_INIT
Provide and use a DATE_MODE_INIT macro. Most of the users of struct date_mode" use it via pretty.h's "struct pretty_print_context" which doesn't have an initialization macro, so we're still bound to being initialized to "{ 0 }" by default. But we can change the couple of callers that directly declared a variable on the stack to instead use the initializer, and thus do away with the "mode.local = 0" added in add00ba2de9 (date: make "local" orthogonal to date format, 2015-09-03). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'date.h')
-rw-r--r--date.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/date.h b/date.h
index 5db9ec8dd2..c3a00d08ed 100644
--- a/date.h
+++ b/date.h
@@ -20,6 +20,10 @@ struct date_mode {
int local;
};
+#define DATE_MODE_INIT { \
+ .type = DATE_NORMAL, \
+}
+
/*
* Convenience helper for passing a constant type, like:
*