summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2020-05-02 17:20:39 -0700
committerThiago Macieira <thiago.macieira@intel.com>2020-05-05 12:27:50 -0700
commit34c21bfe83a513a739365b02937ba6ad03b82d4e (patch)
tree5f4ca91db2a4f9c12dcd4c3046fef89e557a25f4 /src
parent6c1758d35e20655f46ba3696671068f4862c8878 (diff)
Fix Clang 10 warning about array size division being misleading
The parentheses were in the wrong place, so this was effectively dividing by a boolean. Thankfully, that was true (1), so the result was also a constant true. gltexture.cpp:710:41: warning: expression does not compute the number of elements in this array; element type is 'const GLenum' (aka 'const unsigned int'), not 'bool' [-Wsizeof-array-div] Pick-To: 5.15 Change-Id: I99ab0f318b1c43b89888fffd160b5cb83031ceb3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/renderers/opengl/textures/gltexture.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/renderers/opengl/textures/gltexture.cpp b/src/plugins/renderers/opengl/textures/gltexture.cpp
index 11b43e085..30247a719 100644
--- a/src/plugins/renderers/opengl/textures/gltexture.cpp
+++ b/src/plugins/renderers/opengl/textures/gltexture.cpp
@@ -707,7 +707,7 @@ void GLTexture::introspectPropertiesFromSharedTextureId()
#endif
};
- Q_ASSERT(sizeof(targetBindings) / sizeof(targetBindings[0] == sizeof(targets) / sizeof(targets[0])));
+ Q_STATIC_ASSERT(sizeof(targetBindings) / sizeof(targetBindings[0]) == sizeof(targets) / sizeof(targets[0]));
for (uint i = 0; i < sizeof(targetBindings) / sizeof(targetBindings[0]); ++i) {
const int target = targets[i];