summaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Guido Lerch <guido.lerch@gmail.com>2015-09-05 11:04:58 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-05 11:28:57 -0700
commitb7f5871e597d8b0088d75ef858be10cc93e27ad3 (patch)
tree65a5e46d78f6fdda0cadf5ffb9936ea8dd26d3bf /uemis-downloader.c
parent8647f959534396e1ee6d0685908ba9801afb646b (diff)
downloadsubsurface-b7f5871e597d8b0088d75ef858be10cc93e27ad3.tar.gz
Uemis downloader: add constant for maximum number of ANS files
[Dirk Hohndel: refactored one huge commit into smaller pieces] Signed-off-by: Guido Lerch <guido.lerch@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index 340daee60..b263072ee 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -33,6 +33,8 @@
// debugging setup
//#define UEMIS_DEBUG 1 + 2
+#define UEMIS_MAX_FILES 4000
+
#if UEMIS_DEBUG & 64 /* we are reading from a copy of the filesystem, not the device - no need to wait */
#define UEMIS_TIMEOUT 50 /* 50ns */
#define UEMIS_LONG_TIMEOUT 500 /* 500ns */
@@ -501,7 +503,7 @@ static bool uemis_get_answer(const char *path, char *request, int n_param_in,
while (searching || assembling_mbuf) {
if (import_thread_cancelled)
return false;
- progress_bar_fraction = filenr / 4000.0;
+ progress_bar_fraction = filenr / (double)UEMIS_MAX_FILES;
snprintf(fl, 13, "ANS%d.TXT", filenr - 1);
ans_path = build_filename(build_filename(path, "ANS"), fl);
ans_file = subsurface_open(ans_path, O_RDONLY, 0666);