From 460d54977ae2f9c2c5997c6c4cd5541ab436d718 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Sun, 20 Feb 2011 15:23:18 +0000 Subject: FS#11939: Simplify talk_time_unit(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29347 a1c6a512-1295-4272-9138-f99709370657 --- apps/talk.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'apps/talk.c') diff --git a/apps/talk.c b/apps/talk.c index 5fddf85986..8c0f1f3a07 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -1015,7 +1015,7 @@ int talk_number(long n, bool enqueue) /* Say time duration/interval. Input is time in seconds, say hours,minutes,seconds. */ -static int talk_time_unit(long secs, bool exact, bool enqueue) +static int talk_time_unit(long secs, bool enqueue) { int hours, mins; if (!enqueue) @@ -1026,11 +1026,9 @@ static int talk_time_unit(long secs, bool exact, bool enqueue) } if((mins = secs/60)) { secs %= 60; - if(exact || !hours) - talk_value(mins, UNIT_MIN, true); - else talk_number(mins, true); /* don't say "minutes" */ + talk_value(mins, UNIT_MIN, true); } - if((exact && secs) || (!hours && !mins)) + if((secs) || (!hours && !mins)) talk_value(secs, UNIT_SEC, true); else if(!hours && secs) talk_number(secs, true); @@ -1110,8 +1108,8 @@ int talk_value_decimal(long n, int unit, int decimals, bool enqueue) #endif /* special case for time duration */ - if (unit == UNIT_TIME || unit == UNIT_TIME_EXACT) - return talk_time_unit(n, unit == UNIT_TIME_EXACT, enqueue); + if (unit == UNIT_TIME) + return talk_time_unit(n, enqueue); if (unit < 0 || unit >= UNIT_LAST) unit_id = -1; -- cgit v1.2.3