Remove unhelpful return values

This commit is contained in:
Chris Thrasher 2023-12-17 13:33:12 -07:00
parent 2bc4e15043
commit 674d68faa6
4 changed files with 9 additions and 17 deletions

View File

@ -475,7 +475,7 @@ private:
/// \param event Event to filter /// \param event Event to filter
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool filterEvent(const Event& event); void filterEvent(const Event& event);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Perform some common internal initializations /// \brief Perform some common internal initializations

View File

@ -93,11 +93,7 @@ bool SoundFileWriterWav::open(const std::filesystem::path& filename, unsigned in
} }
// Write the header // Write the header
if (!writeHeader(sampleRate, channelCount)) writeHeader(sampleRate, channelCount);
{
err() << "Failed to write header of WAV sound file\n" << formatDebugPathInfo(filename) << std::endl;
return false;
}
return true; return true;
} }
@ -114,7 +110,7 @@ void SoundFileWriterWav::write(const std::int16_t* samples, std::uint64_t count)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool SoundFileWriterWav::writeHeader(unsigned int sampleRate, unsigned int channelCount) void SoundFileWriterWav::writeHeader(unsigned int sampleRate, unsigned int channelCount)
{ {
assert(m_file.good() && "Most recent I/O operation failed"); assert(m_file.good() && "Most recent I/O operation failed");
@ -152,8 +148,6 @@ bool SoundFileWriterWav::writeHeader(unsigned int sampleRate, unsigned int chann
m_file.write(dataChunkId, sizeof(dataChunkId)); m_file.write(dataChunkId, sizeof(dataChunkId));
const std::uint32_t dataChunkSize = 0; // placeholder, will be written later const std::uint32_t dataChunkSize = 0; // placeholder, will be written later
encode(m_file, dataChunkSize); encode(m_file, dataChunkSize);
return true;
} }

View File

@ -86,10 +86,8 @@ private:
/// \param sampleRate Sample rate of the sound /// \param sampleRate Sample rate of the sound
/// \param channelCount Number of channels of the sound /// \param channelCount Number of channels of the sound
/// ///
/// \return True on success, false on error
///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] bool writeHeader(unsigned int sampleRate, unsigned int channelCount); void writeHeader(unsigned int sampleRate, unsigned int channelCount);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Close the file /// \brief Close the file

View File

@ -164,7 +164,8 @@ bool WindowBase::pollEvent(Event& event)
{ {
if (m_impl && m_impl->popEvent(event, false)) if (m_impl && m_impl->popEvent(event, false))
{ {
return filterEvent(event); filterEvent(event);
return true;
} }
else else
{ {
@ -178,7 +179,8 @@ bool WindowBase::waitEvent(Event& event)
{ {
if (m_impl && m_impl->popEvent(event, true)) if (m_impl && m_impl->popEvent(event, true))
{ {
return filterEvent(event); filterEvent(event);
return true;
} }
else else
{ {
@ -383,7 +385,7 @@ void WindowBase::onResize()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool WindowBase::filterEvent(const Event& event) void WindowBase::filterEvent(const Event& event)
{ {
// Notify resize events to the derived class // Notify resize events to the derived class
if (event.type == Event::Resized) if (event.type == Event::Resized)
@ -394,8 +396,6 @@ bool WindowBase::filterEvent(const Event& event)
// Notify the derived class // Notify the derived class
onResize(); onResize();
} }
return true;
} }