Correct rounding issue when displaying the compression ratio.
committer: mfx <mfx> 1058789628 +0000
This commit is contained in:
+1
-1
@@ -151,7 +151,7 @@ static const char *mkline(unsigned long fu_len, unsigned long fc_len,
|
|||||||
|
|
||||||
// Large ratios can happen because of overlays that are
|
// Large ratios can happen because of overlays that are
|
||||||
// appended after a program is packed.
|
// appended after a program is packed.
|
||||||
unsigned ratio = get_ratio(fu_len, fc_len);
|
unsigned ratio = get_ratio(fu_len, fc_len) + 50;
|
||||||
#if 1
|
#if 1
|
||||||
if (ratio >= 1000*1000)
|
if (ratio >= 1000*1000)
|
||||||
strcpy(r, "overlay");
|
strcpy(r, "overlay");
|
||||||
|
|||||||
+1
-1
@@ -533,7 +533,7 @@ unsigned get_ratio(unsigned u_len, unsigned c_len)
|
|||||||
const unsigned n = 1000000;
|
const unsigned n = 1000000;
|
||||||
if (u_len <= 0)
|
if (u_len <= 0)
|
||||||
return c_len <= 0 ? 0 : n;
|
return c_len <= 0 ? 0 : n;
|
||||||
return (unsigned) ((c_len * (acc_uint64l_t)n) / u_len) + 5;
|
return (unsigned) ((c_len * (acc_uint64l_t)n) / u_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user