diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-12 22:42:28 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-13 00:12:27 +0200 |
commit | 42c486d30d8e6f82d27651e19029e332af86cba3 (patch) | |
tree | c02b65cdda719ca0f1f30a85696737071c2b798c /src/calendar.c | |
parent | 844d35e851b5ef51bc8c0822dbd699b619ddd194 (diff) | |
download | calcurse-42c486d30d8e6f82d27651e19029e332af86cba3.zip |
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 <calcurse@cryptocrack.de>
Diffstat (limited to 'src/calendar.c')
-rw-r--r-- | src/calendar.c | 16 |
1 files changed, 8 insertions, 8 deletions
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); |