From 03a8325a2d907719c27011472b0a1ee73bec7c8e Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 17 Oct 2011 19:21:25 +0000 Subject: Simplify seconds_to_min(), and don't safeguard used parameter. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30779 a1c6a512-1295-4272-9138-f99709370657 --- apps/menus/main_menu.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 602becd..7f8a56e 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c @@ -430,18 +430,13 @@ static int sleep_timer(void) static int seconds_to_min(int secs) { - int min = secs / 60; - if ((secs % 60) > 50) /* round up for 50+ seconds */ - min++; - - return min; + return (secs + 10) / 60; /* round up for 50+ seconds */ } static char* sleep_timer_getname(int selected_item, void * data, char *buffer) { (void)selected_item; (void)data; - (void)buffer; int sec = get_sleep_timer(); char timer_buf[10]; /* we have no sprintf, so MAX_PATH is a guess */ -- cgit v1.1