1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-15 07:01:18 +02:00

Convert sampleCount <-> floating or -> long long explicitly ...

... A non-narrowing conversion out to long long is a necessity, but the
conversions to float and double are simply conveniences.

Conversion from floating is explicit, to avoid unintended consequences with
arithmetic operators, when later sampleCount ceases to be an alias for an
integral type.

Some conversions are not made explicit, where I expect to change the type of
the variable later to have mere size_t width.
This commit is contained in:
Paul Licameli
2016-08-25 08:53:59 -04:00
parent 99dca62cff
commit 78be459fa1
53 changed files with 329 additions and 207 deletions

View File

@@ -400,13 +400,21 @@ int PCMImportFileHandle::Import(TrackFactory *trackFactory,
iter->get()->AppendAlias(mFilename, i, blockLen, c,useOD);
if (++updateCounter == 50) {
updateResult = mProgress->Update(i, fileTotalFrames);
updateResult = mProgress->Update(
i.as_long_long(),
fileTotalFrames.as_long_long()
);
updateCounter = 0;
if (updateResult != eProgressSuccess)
break;
}
}
updateResult = mProgress->Update(fileTotalFrames, fileTotalFrames);
// One last update for completion
updateResult = mProgress->Update(
fileTotalFrames.as_long_long(),
fileTotalFrames.as_long_long()
);
if(useOD)
{
@@ -485,8 +493,10 @@ int PCMImportFileHandle::Import(TrackFactory *trackFactory,
framescompleted += block;
}
updateResult = mProgress->Update((long long unsigned)framescompleted,
(long long unsigned)fileTotalFrames);
updateResult = mProgress->Update(
framescompleted.as_long_long(),
fileTotalFrames.as_long_long()
);
if (updateResult != eProgressSuccess)
break;