mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 14:21:04 +08:00
Added readability-redundant-*, readability-simplify-* checks
Fixed CI complaints Restored comment for clarity
This commit is contained in:
parent
6ef8e487cc
commit
144b336c17
@ -8,6 +8,8 @@ Checks: >
|
||||
readability-isolate-declaration,
|
||||
readability-qualified-auto,
|
||||
readability-redundant-access-specifiers,
|
||||
readability-redundant-*,
|
||||
readability-simplify-*,
|
||||
-clang-analyzer-core.NonNullParamChecker,
|
||||
-clang-analyzer-core.NullDereference,
|
||||
-clang-analyzer-nullability.NullablePassedToNonnull,
|
||||
|
@ -97,10 +97,7 @@ public:
|
||||
m_text.setPosition({30.f, 20.f});
|
||||
|
||||
// Load the shader
|
||||
if (!m_shader.loadFromFile("resources/wave.vert", "resources/blur.frag"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return m_shader.loadFromFile("resources/wave.vert", "resources/blur.frag");
|
||||
}
|
||||
|
||||
void onUpdate(float time, float x, float y) override
|
||||
@ -152,10 +149,7 @@ public:
|
||||
}
|
||||
|
||||
// Load the shader
|
||||
if (!m_shader.loadFromFile("resources/storm.vert", "resources/blink.frag"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return m_shader.loadFromFile("resources/storm.vert", "resources/blink.frag");
|
||||
}
|
||||
|
||||
void onUpdate(float time, float x, float y) override
|
||||
|
@ -17,7 +17,7 @@
|
||||
int main()
|
||||
{
|
||||
// Check that the device can capture audio
|
||||
if (sf::SoundRecorder::isAvailable() == false)
|
||||
if (!sf::SoundRecorder::isAvailable())
|
||||
{
|
||||
std::cout << "Sorry, audio capture is not supported by your system" << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
|
@ -195,7 +195,7 @@ bool Music::onGetData(SoundStream::Chunk& data)
|
||||
|
||||
// Check if we have stopped obtaining samples or reached either the EOF or the loop end point
|
||||
return (data.sampleCount != 0) && (currentOffset < m_file.getSampleCount()) &&
|
||||
!(currentOffset == loopEnd && m_loopSpan.length != 0);
|
||||
(currentOffset != loopEnd || m_loopSpan.length == 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,10 +52,8 @@ SoundBuffer::SoundBuffer()
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
SoundBuffer::SoundBuffer(const SoundBuffer& copy) :
|
||||
m_samples(copy.m_samples),
|
||||
m_duration(copy.m_duration),
|
||||
m_sounds() // don't copy the attached sounds
|
||||
SoundBuffer::SoundBuffer(const SoundBuffer& copy) : m_samples(copy.m_samples), m_duration(copy.m_duration)
|
||||
// don't copy the attached sounds
|
||||
{
|
||||
// Create the buffer
|
||||
alCheck(alGenBuffers(1, &m_buffer));
|
||||
|
@ -72,10 +72,7 @@ bool isActive(std::uint64_t id)
|
||||
{
|
||||
auto it = contextRenderTargetMap.find(sf::Context::getActiveContextId());
|
||||
|
||||
if ((it == contextRenderTargetMap.end()) || (it->second != id))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return (it != contextRenderTargetMap.end()) && (it->second == id);
|
||||
}
|
||||
|
||||
// Convert an sf::BlendMode::Factor constant to the corresponding OpenGL constant.
|
||||
|
@ -256,10 +256,7 @@ bool VertexBuffer::update([[maybe_unused]] const VertexBuffer& vertexBuffer)
|
||||
|
||||
glCheck(GLEXT_glBindBuffer(GLEXT_GL_ARRAY_BUFFER, 0));
|
||||
|
||||
if ((sourceResult == GL_FALSE) || (destinationResult == GL_FALSE))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return (sourceResult == GL_TRUE) && (destinationResult == GL_TRUE);
|
||||
|
||||
#endif // SFML_OPENGL_ES
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user