mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 01:34:25 +03:00
Scope reduce some variables.
This commit is contained in:
parent
c59c314283
commit
af11d7eb96
@ -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, "%"
|
||||
|
Loading…
Reference in New Issue
Block a user