mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +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-isolate-declaration,
|
||||||
readability-qualified-auto,
|
readability-qualified-auto,
|
||||||
readability-redundant-access-specifiers,
|
readability-redundant-access-specifiers,
|
||||||
|
readability-redundant-*,
|
||||||
|
readability-simplify-*,
|
||||||
-clang-analyzer-core.NonNullParamChecker,
|
-clang-analyzer-core.NonNullParamChecker,
|
||||||
-clang-analyzer-core.NullDereference,
|
-clang-analyzer-core.NullDereference,
|
||||||
-clang-analyzer-nullability.NullablePassedToNonnull,
|
-clang-analyzer-nullability.NullablePassedToNonnull,
|
||||||
|
@ -97,10 +97,7 @@ public:
|
|||||||
m_text.setPosition({30.f, 20.f});
|
m_text.setPosition({30.f, 20.f});
|
||||||
|
|
||||||
// Load the shader
|
// Load the shader
|
||||||
if (!m_shader.loadFromFile("resources/wave.vert", "resources/blur.frag"))
|
return m_shader.loadFromFile("resources/wave.vert", "resources/blur.frag");
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onUpdate(float time, float x, float y) override
|
void onUpdate(float time, float x, float y) override
|
||||||
@ -152,10 +149,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load the shader
|
// Load the shader
|
||||||
if (!m_shader.loadFromFile("resources/storm.vert", "resources/blink.frag"))
|
return m_shader.loadFromFile("resources/storm.vert", "resources/blink.frag");
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onUpdate(float time, float x, float y) override
|
void onUpdate(float time, float x, float y) override
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
// Check that the device can capture audio
|
// 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;
|
std::cout << "Sorry, audio capture is not supported by your system" << std::endl;
|
||||||
return EXIT_SUCCESS;
|
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
|
// 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()) &&
|
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) :
|
SoundBuffer::SoundBuffer(const SoundBuffer& copy) : m_samples(copy.m_samples), m_duration(copy.m_duration)
|
||||||
m_samples(copy.m_samples),
|
// don't copy the attached sounds
|
||||||
m_duration(copy.m_duration),
|
|
||||||
m_sounds() // don't copy the attached sounds
|
|
||||||
{
|
{
|
||||||
// Create the buffer
|
// Create the buffer
|
||||||
alCheck(alGenBuffers(1, &m_buffer));
|
alCheck(alGenBuffers(1, &m_buffer));
|
||||||
|
@ -72,10 +72,7 @@ bool isActive(std::uint64_t id)
|
|||||||
{
|
{
|
||||||
auto it = contextRenderTargetMap.find(sf::Context::getActiveContextId());
|
auto it = contextRenderTargetMap.find(sf::Context::getActiveContextId());
|
||||||
|
|
||||||
if ((it == contextRenderTargetMap.end()) || (it->second != id))
|
return (it != contextRenderTargetMap.end()) && (it->second == id);
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert an sf::BlendMode::Factor constant to the corresponding OpenGL constant.
|
// 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));
|
glCheck(GLEXT_glBindBuffer(GLEXT_GL_ARRAY_BUFFER, 0));
|
||||||
|
|
||||||
if ((sourceResult == GL_FALSE) || (destinationResult == GL_FALSE))
|
return (sourceResult == GL_TRUE) && (destinationResult == GL_TRUE);
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
#endif // SFML_OPENGL_ES
|
#endif // SFML_OPENGL_ES
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user