mirror of
https://github.com/SFML/SFML.git
synced 2024-12-01 15:51:04 +08:00
Remove unhelpful return values
This commit is contained in:
parent
2bc4e15043
commit
674d68faa6
@ -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
|
||||||
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user