updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / par2cmdline / 06-Introduced-conditional-compilation-to-speed-up-thing.patch
blob77b0cdecd18a0aad053cdf6dd75a2b93638d1d98
1 --- a/par2creatorsourcefile.cpp
2 +++ b/par2creatorsourcefile.cpp
3 @@ -213,21 +213,22 @@ bool Par2CreatorSourceFile::Open(CommandLine::NoiseLevel noiselevel, const Comma
7 + // Define MPDL to skip reporting; speeds up things considerably
8 +#ifndef MPDL
9 if (noiselevel > CommandLine::nlQuiet)
11 // Display progress
12 u32 oldfraction = (u32)(1000 * offset / filesize);
13 - offset += want;
14 - u32 newfraction = (u32)(1000 * offset / filesize);
15 + // The original source had here: offset += want;
16 + // That's definitely an error, because offset must always be incremented!
17 + u32 newfraction = (u32)(1000 * (offset + want) / filesize);
18 if (oldfraction != newfraction)
20 cout << newfraction/10 << '.' << newfraction%10 << "%\r" << flush;
23 - else
24 - {
25 - offset += want;
26 - }
27 +#endif
28 + offset += want;
31 // Did we finish the last block