From 677cea13fdc0a859c89e31ef84b7a26e313f0880 Mon Sep 17 00:00:00 2001 From: Norbert Warmuth Date: Fri, 25 Dec 1998 21:31:59 +0000 Subject: [PATCH] Fri Dec 25 20:19:57 1998 Norbert Warmuth * file.c (panel_operate_flags): Don't change file progress count and size twice for every file. (panel_compute_totals): Initialize return values to zero before calculating anything. (panel_operate_def, panel_operate): return a value --- src/ChangeLog | 10 ++++++++++ src/file.c | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0e09defef..f910e394d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +Fri Dec 25 20:19:57 1998 Norbert Warmuth + + * file.c (panel_operate_flags): Don't change file progress count and + size twice for every file. + + (panel_compute_totals): Initialize return values to zero before + calculating anything. + + (panel_operate_def, panel_operate): return a value + Thu Dec 24 19:00:05 1998 Norbert Warmuth * screen.c (recalculate_panel_summary): new function which recalculates diff --git a/src/file.c b/src/file.c index 176a23097..d2a8646eb 100644 --- a/src/file.c +++ b/src/file.c @@ -1636,6 +1636,9 @@ panel_compute_totals (WPanel *panel, long *ret_marked, double *ret_total) { int i; + *ret_marked = 0; + *ret_total = 0.0; + for (i = 0; i < panel->count; i++){ struct stat *s; @@ -1972,12 +1975,9 @@ panel_operate_flags (void *source_panel, FileOperation operation, char *thedefau if (value == FILE_CONT) do_file_mark (panel, i, 0); - count++; - if (file_progress_show_count (count, file_progress_count) == FILE_ABORT) goto clean_up; - bytes += src_stat.st_size; if (verbose && file_progress_show_bytes (bytes, file_progress_bytes) == FILE_ABORT) goto clean_up; @@ -2040,13 +2040,13 @@ panel_operate_flags (void *source_panel, FileOperation operation, char *thedefau int panel_operate_def (void *source_panel, FileOperation operation, char *thedefault) { - panel_operate_flags (source_panel, operation, thedefault, FALSE); + return panel_operate_flags (source_panel, operation, thedefault, FALSE); } int panel_operate (void *source_panel, FileOperation operation, char *thedefault) { - panel_operate_flags (source_panel, operation, thedefault, TRUE); + return panel_operate_flags (source_panel, operation, thedefault, TRUE); } /* }}} */