Code

Define date values in DATE_INFO macro
authorJonas Fonseca <jonas.fonseca@savoirfairelinux.com>
Fri, 11 Dec 2009 23:26:25 +0000 (18:26 -0500)
committerJonas Fonseca <jonas.fonseca@savoirfairelinux.com>
Fri, 11 Dec 2009 23:26:25 +0000 (18:26 -0500)
tig.c

diff --git a/tig.c b/tig.c
index 08b2993b7f8a664384c5f4812055162d85448682..4282b9df15aed8d40729f7a515495c19d67ffa6b 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -381,19 +381,21 @@ static int local_tzoffset(time_t time)
        return offset * eastwest;
 }
 
+#define DATE_INFO \
+       DATE_(NO), \
+       DATE_(DEFAULT), \
+       DATE_(RELATIVE), \
+       DATE_(SHORT)
+
 enum date {
-       DATE_NO = 0,
-       DATE_DEFAULT,
-       DATE_RELATIVE,
-       DATE_SHORT
+#define DATE_(name) DATE_##name
+       DATE_INFO
+#undef DATE_
 };
 
 static const struct enum_map date_map[] = {
 #define DATE_(name) ENUM_MAP(#name, DATE_##name)
-       DATE_(NO),
-       DATE_(DEFAULT),
-       DATE_(RELATIVE),
-       DATE_(SHORT)
+       DATE_INFO
 #undef DATE_
 };