theme-node: Rewrite switch statement

Some compilers warn about unhandled enum values in switch statements,
so don't use one where only two out of 21 possible values make sense.
This commit is contained in:
Florian Müllner 2015-09-23 20:00:23 +02:00
parent 82f84416a9
commit c3a29d6df1

View File

@ -840,26 +840,21 @@ st_theme_node_lookup_time (StThemeNode *node,
if (strcmp (decl->property->stryng->str, property_name) == 0)
{
CRTerm *term = decl->value;
int factor = 1;
if (term->type != TERM_NUMBER)
continue;
switch (term->content.num->type)
{
case NUM_TIME_S:
*value = 1000 * term->content.num->val;
result = TRUE;
break;
case NUM_TIME_MS:
*value = term->content.num->val;
result = TRUE;
break;
default:
;
}
if (term->content.num->type != NUM_TIME_S ||
term->content.num->type != NUM_TIME_MS)
continue;
if (result)
break;
if (term->content.num->type == NUM_TIME_S)
factor = 1000;
*value = factor * term->content.num->val;
result = TRUE;
break;
}
}