From d58de5564566705d372fc49ba7efd0a954a03756 Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Sun, 28 Dec 2014 01:22:50 -0500 Subject: redshift: Add enum member for unknown period_t (PERIOD_NONE) --- src/redshift.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/redshift.c b/src/redshift.c index 8950097..b09f39c 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -299,13 +299,15 @@ typedef enum { /* Periods of day. */ typedef enum { - PERIOD_DAYTIME = 0, + PERIOD_NONE = 0, + PERIOD_DAYTIME, PERIOD_NIGHT, PERIOD_TRANSITION } period_t; /* Names of periods of day */ static const char *period_names[] = { + N_("None"), N_("Daytime"), N_("Night"), N_("Transition") @@ -374,6 +376,7 @@ static void print_period(period_t period, double transition) { switch (period) { + case PERIOD_NONE: case PERIOD_NIGHT: case PERIOD_DAYTIME: printf(_("Period: %s\n"), gettext(period_names[period])); @@ -1436,7 +1439,7 @@ main(int argc, char *argv[]) /* Save previous colors so we can avoid printing status updates if the values did not change. */ - period_t prev_period = -1; + period_t prev_period = PERIOD_NONE; color_setting_t prev_interp = { -1, { NAN, NAN, NAN }, NAN }; -- cgit v1.2.3-70-g09d2