From 139969ef7b0ac660853899ac601bab330c111f71 Mon Sep 17 00:00:00 2001 From: Pavel Vymetálek Date: Wed, 20 Jan 2021 13:31:57 +0100 Subject: Fixed integer rounding - progress show 100% at the finish --- sercp.c | 4 ++-- sercp.rc | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sercp.c b/sercp.c index f19fea4..66baefb 100644 --- a/sercp.c +++ b/sercp.c @@ -68,7 +68,7 @@ #define FALSE 0 #define true 1 #define TRUE 1 -const char* _version = "v0.3.5"; +const char* _version = "v0.3.6"; // SERIAL FILE *tapout_fd = NULL; int is_outfile = 0; @@ -293,7 +293,7 @@ void DoProgress(size_t pos, size_t max, unsigned char csum_ok) { char progress_char; p = pos; m = max; - percent = 100 / m * p; + percent = (100 / m * p) + 0.5; ipercent = percent / 100 * imax; if (is_binary) progress_char = '#'; else progress_char = '='; diff --git a/sercp.rc b/sercp.rc index 038e212..24679c0 100644 --- a/sercp.rc +++ b/sercp.rc @@ -1,8 +1,8 @@ // RC file, codepage utf-8 !!!!! #include // include for version info constants 1 VERSIONINFO -FILEVERSION 0,3,5,0 -PRODUCTVERSION 0,3,5,0 +FILEVERSION 0,3,6,0 +PRODUCTVERSION 0,3,6,0 FILETYPE VFT_APP { BLOCK "StringFileInfo" @@ -10,14 +10,14 @@ FILETYPE VFT_APP BLOCK "040904E4" { VALUE "CompanyName", "vym.cz" - VALUE "FileVersion", "0.3.5" + VALUE "FileVersion", "0.3.6" VALUE "FileDescription", "sercp - serial copy for ZX Spectrum" VALUE "InternalName", "sercp" VALUE "LegalCopyright", "GNU GPL v3 or above" VALUE "LegalTrademarks", "Pavel Vymetálek" VALUE "OriginalFilename", "sercp" VALUE "ProductName", "sercp" - VALUE "ProductVersion", "0.3.5" + VALUE "ProductVersion", "0.3.6" VALUE "Build environment", "Linux: Mingw64, x86_64" } } -- cgit