From af11d7eb9683e7daab8b56a3c0ee8063469ff931 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 19 May 2014 17:12:18 +0100 Subject: Scope reduce some variables. --- atari/download.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'atari/download.c') diff --git a/atari/download.c b/atari/download.c index 5f034d857..6fe0d87e0 100755 --- a/atari/download.c +++ b/atari/download.c @@ -362,8 +362,6 @@ static nserror gui_download_window_data(struct gui_download_window *dw, uint32_t clck = clock(); uint32_t tnow = clck / (CLOCKS_PER_SEC>>3); uint32_t sdiff = (clck / (CLOCKS_PER_SEC)) - dw->start; - uint32_t p = 0; - float speed; float pf = 0; LOG(("")); @@ -384,11 +382,13 @@ static nserror gui_download_window_data(struct gui_download_window *dw, /* Update GUI */ if ((tnow - dw->lastrdw) > 1) { + float speed; dw->lastrdw = tnow; speed = dw->size_downloaded / sdiff; if( dw->size_total > 0 ){ + uint32_t p = 0; p = ((double)dw->size_downloaded / (double)dw->size_total * 100); snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT, "%lu%s", p, "%" -- cgit v1.2.3