Skip to content

Commit

Permalink
Merge pull request #632 from paulfd/noexcept-compile-error
Browse files Browse the repository at this point in the history
Corrected a compile error on gcc 9.3
  • Loading branch information
paulfd authored Feb 12, 2021
2 parents f9eb818 + a7cfb84 commit da41ed5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
13 changes: 11 additions & 2 deletions src/sfizz/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,24 @@ void sfz::Logger::logCallbackTime(const CallbackBreakdown& breakdown, int numVoi
if (!loggingEnabled)
return;

callbackTimeQueue.try_push<CallbackTime>({ breakdown, numVoices, numSamples });
CallbackTime callbackTime;
callbackTime.breakdown = breakdown;
callbackTime.numVoices = numVoices;
callbackTime.numSamples = numSamples;
callbackTimeQueue.try_push(callbackTime);
}

void sfz::Logger::logFileTime(std::chrono::duration<double> waitDuration, std::chrono::duration<double> loadDuration, uint32_t fileSize, absl::string_view filename)
{
if (!loggingEnabled)
return;

fileTimeQueue.try_push<FileTime>({ waitDuration, loadDuration, fileSize, filename });
FileTime fileTime;
fileTime.waitDuration = waitDuration;
fileTime.loadDuration = loadDuration;
fileTime.fileSize = fileSize;
fileTime.filename = filename;
fileTimeQueue.try_push(fileTime);
}

void sfz::Logger::setPrefix(absl::string_view prefix)
Expand Down
14 changes: 0 additions & 14 deletions src/sfizz/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ struct ScopedTiming

struct FileTime
{
FileTime() = default;
FileTime(Duration waitDuration, Duration loadDuration, uint32_t fileSize, absl::string_view filename)
: waitDuration(waitDuration), loadDuration(loadDuration), fileSize(fileSize), filename(filename) { }
FileTime(const FileTime&) = default;
FileTime& operator=(const FileTime&) = default;
FileTime(FileTime&&) = default;
FileTime& operator=(FileTime&&) = default;
Duration waitDuration { 0 };
Duration loadDuration { 0 };
uint32_t fileSize { 0 };
Expand All @@ -76,13 +69,6 @@ struct CallbackBreakdown

struct CallbackTime
{
CallbackTime() = default;
CallbackTime(const CallbackBreakdown& breakdown, int numVoices, size_t numSamples)
: breakdown(breakdown), numVoices(numVoices), numSamples(numSamples) { }
CallbackTime(const CallbackTime&) = default;
CallbackTime& operator=(const CallbackTime&) = default;
CallbackTime(CallbackTime&&) = default;
CallbackTime& operator=(CallbackTime&&) = default;
CallbackBreakdown breakdown {};
int numVoices { 0 };
size_t numSamples { 0 };
Expand Down
8 changes: 4 additions & 4 deletions tests/SynthT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,10 @@ TEST_CASE("[Synth] veltrack")
};

const VeltrackData veltrackdata[] = {
{ 25, veldata25 },
{ 50, veldata50 },
{ 75, veldata75 },
{ 100, veldata100 },
{ 25, absl::MakeConstSpan(veldata25) },
{ 50, absl::MakeConstSpan(veldata50) },
{ 75, absl::MakeConstSpan(veldata75) },
{ 100, absl::MakeConstSpan(veldata100) },
};

for (const VeltrackData& vt : veltrackdata) {
Expand Down

0 comments on commit da41ed5

Please sign in to comment.