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>
This commit is contained in:
Lukas Fleischer
2012-06-12 22:42:28 +02:00
parent 844d35e851
commit 42c486d30d
6 changed files with 44 additions and 45 deletions

View File

@@ -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);