mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
nloop cleanup courtesy Serge Belyshev.
This commit is contained in:
parent
a901b015bf
commit
bdf19e2654
14
main.c
14
main.c
|
|
@ -459,15 +459,17 @@ out:
|
|||
|
||||
static i64 nloops(i64 seconds, uchar *b1, uchar *b2)
|
||||
{
|
||||
i64 nloops_encoded, nloops;
|
||||
i64 nloops;
|
||||
int nbits;
|
||||
|
||||
nloops = ARBITRARY_AT_EPOCH * pow(MOORE_TIMES_PER_SECOND, seconds);
|
||||
nbits = log (nloops) / M_LN2;
|
||||
*b1 = nbits - 7;
|
||||
*b2 = nloops >> *b1;
|
||||
nloops_encoded = (i64)*b2 << (i64)*b1;
|
||||
return nloops_encoded;
|
||||
if (nloops < ARBITRARY)
|
||||
nloops = ARBITRARY;
|
||||
for (nbits = 0; nloops > 255; nbits ++)
|
||||
nloops = nloops >> 1;
|
||||
*b1 = nbits;
|
||||
*b2 = nloops;
|
||||
return nloops << nbits;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
|
|
|||
Loading…
Reference in a new issue