From 42c486d30d8e6f82d27651e19029e332af86cba3 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 12 Jun 2012 22:42:28 +0200 Subject: Rename displacement enumeration elements * Rename "LEFT" to "DAY_PREV", "RIGHT" to "DAY_NEXT", "UP" to "WEEK_PREV" and "DOWN" to "WEEK_NEXT" to reflect the semantics of these operations. Remove the unneeded "MOVES" element. * Reorder code to improve consistency. Signed-off-by: Lukas Fleischer --- src/calendar.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/calendar.c') diff --git a/src/calendar.c b/src/calendar.c index f369d8f..dbac9c7 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -614,18 +614,18 @@ void calendar_move(enum move move, int count) t.tm_year = slctd_day.yyyy - 1900; switch (move) { - case UP: - ret = date_change(&t, 0, -count * WEEKINDAYS); - break; - case DOWN: - ret = date_change(&t, 0, count * WEEKINDAYS); - break; - case LEFT: + case DAY_PREV: ret = date_change(&t, 0, -count); break; - case RIGHT: + case DAY_NEXT: ret = date_change(&t, 0, count); break; + case WEEK_PREV: + ret = date_change(&t, 0, -count * WEEKINDAYS); + break; + case WEEK_NEXT: + ret = date_change(&t, 0, count * WEEKINDAYS); + break; case WEEK_START: /* Normalize struct tm to get week day number. */ mktime(&t); -- cgit v1.2.3-54-g00ecf