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)
|
static i64 nloops(i64 seconds, uchar *b1, uchar *b2)
|
||||||
{
|
{
|
||||||
i64 nloops_encoded, nloops;
|
i64 nloops;
|
||||||
int nbits;
|
int nbits;
|
||||||
|
|
||||||
nloops = ARBITRARY_AT_EPOCH * pow(MOORE_TIMES_PER_SECOND, seconds);
|
nloops = ARBITRARY_AT_EPOCH * pow(MOORE_TIMES_PER_SECOND, seconds);
|
||||||
nbits = log (nloops) / M_LN2;
|
if (nloops < ARBITRARY)
|
||||||
*b1 = nbits - 7;
|
nloops = ARBITRARY;
|
||||||
*b2 = nloops >> *b1;
|
for (nbits = 0; nloops > 255; nbits ++)
|
||||||
nloops_encoded = (i64)*b2 << (i64)*b1;
|
nloops = nloops >> 1;
|
||||||
return nloops_encoded;
|
*b1 = nbits;
|
||||||
|
*b2 = nloops;
|
||||||
|
return nloops << nbits;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue