summaryrefslogtreecommitdiff
path: root/date.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-03-09 11:58:05 -0800
committerLibravatar Junio C Hamano <junkio@cox.net>2006-03-09 11:58:05 -0800
commitb4f2a6ac9263d6e9bf3bf9c8abe607cd6def0ee8 (patch)
tree7956fa207bb2aa7eaee0290c2f8cbf11b1feaf6e /date.c
parentRemove trailing dot after short description (diff)
downloadtgif-b4f2a6ac9263d6e9bf3bf9c8abe607cd6def0ee8.tar.xz
Use #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'date.c')
-rw-r--r--date.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/date.c b/date.c
index 416ea579a3..1c1917b4e8 100644
--- a/date.c
+++ b/date.c
@@ -123,8 +123,6 @@ static const struct {
{ "IDLE", +12, 0, }, /* International Date Line East */
};
-#define NR_TZ (sizeof(timezone_names) / sizeof(timezone_names[0]))
-
static int match_string(const char *date, const char *str)
{
int i = 0;
@@ -173,7 +171,7 @@ static int match_alpha(const char *date, struct tm *tm, int *offset)
}
}
- for (i = 0; i < NR_TZ; i++) {
+ for (i = 0; i < ARRAY_SIZE(timezone_names); i++) {
int match = match_string(date, timezone_names[i].name);
if (match >= 3) {
int off = timezone_names[i].offset;