aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-09-24 17:05:16 +0200
committerThomas White <taw@physics.org>2020-09-24 17:05:16 +0200
commitb223a27b191c28f25b1f93a2834bcad0ec80b4d9 (patch)
treeb879ffb33fa6567b9e6e9894b1e2e45266dd6731
parent6a2abc87029df2742d05a4f2af66f6d146c06634 (diff)
cell_explorer: Fix counting
-rw-r--r--src/cell_explorer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cell_explorer.c b/src/cell_explorer.c
index 922cd714..d8606edf 100644
--- a/src/cell_explorer.c
+++ b/src/cell_explorer.c
@@ -1933,6 +1933,7 @@ static int add_stream(CellWindow *w, const char *stream_filename,
{
Stream *st;
int n_chunks = 0;
+ int n_cells = 0;
int max_cells = *pmax_cells;
st = stream_open_for_read(stream_filename);
@@ -1990,19 +1991,22 @@ static int add_stream(CellWindow *w, const char *stream_filename,
}
w->indms[w->n_cells] = image->indexed_by;
w->n_cells++;
+ n_cells++;
}
n_chunks++;
if ( n_chunks % 1000 == 0 ) {
fprintf(stderr, "%s: Loaded %i cells from %i chunks\r",
- stream_filename, w->n_cells, n_chunks);
+ stream_filename, n_cells, n_chunks);
}
image_free(image);
} while ( 1 );
+ fprintf(stderr, "\n");
+
if ( stream_has_old_indexers(st) ) {
ERROR("----- Notice -----\n");
ERROR("This stream contains indexing methods specified in an old way.\n");
@@ -2017,7 +2021,7 @@ static int add_stream(CellWindow *w, const char *stream_filename,
stream_close(st);
- *pn_total_chunks = n_chunks;
+ *pn_total_chunks += n_chunks;
return 0;
}