summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDane Springmeyer <dane@mapbox.com>2019-11-08 09:40:06 -0800
committerDane Springmeyer <dane@mapbox.com>2019-11-08 09:40:06 -0800
commit1cf76b3702e0d626167edcb1e65bd770bb60415e (patch)
tree7e2d8070979a43bfce9686a7099ad27a47b86857
parent55e18a6f81f3b8ee61c3eb70b0d1cbe9a861e44f (diff)
downloadqtlocation-mapboxgl-upstream/fix-clang-8-compiler-warnings.tar.gz
Fix compile of render-test with clang-8upstream/fix-clang-8-compiler-warnings
This deals with two types of warnings which fail with build given the default -Werror flag. ``` ../../render-test/runner.cpp:937:17: error: variable 'transitionFinished' used in loop condition not modified in loop body [-Werror,-Wfor-loop-analysis] for (; !transitionFinished; frames++) { ^~~~~~~~~~~~~~~~~~ ``` ``` ../../render-test/runner.cpp:38:7: warning: field 'numBuffers' will be initialized after field 'numDrawCalls' [-Wreorder] : numBuffers(stats.numBuffers), ^ ../../render-test/runner.cpp:40:7: warning: field 'numFrameBuffers' will be initialized after field 'numTextures' [-Wreorder] numFrameBuffers(stats.numFrameBuffers), ^ ../../render-test/runner.cpp:43:7: warning: field 'memVertexBuffers' will be initialized after field 'memTextures' [-Wreorder] memVertexBuffers(stats.memVertexBuffers, std::max(stats.memVertexBuffers, prev.memVertexBuffers.peak)), ^ ```
-rw-r--r--render-test/metadata.hpp6
-rw-r--r--render-test/runner.cpp4
2 files changed, 6 insertions, 4 deletions
diff --git a/render-test/metadata.hpp b/render-test/metadata.hpp
index 567c89e3fc..2b007a445c 100644
--- a/render-test/metadata.hpp
+++ b/render-test/metadata.hpp
@@ -100,14 +100,14 @@ struct GfxProbe {
GfxProbe() = default;
GfxProbe(const mbgl::gfx::RenderingStats&, const GfxProbe&);
- int numDrawCalls;
- int numTextures;
int numBuffers;
+ int numDrawCalls;
int numFrameBuffers;
+ int numTextures;
- Memory memTextures;
Memory memIndexBuffers;
Memory memVertexBuffers;
+ Memory memTextures;
};
class TestMetrics {
diff --git a/render-test/runner.cpp b/render-test/runner.cpp
index 8a4b0b3b0e..de89da6696 100644
--- a/render-test/runner.cpp
+++ b/render-test/runner.cpp
@@ -1035,6 +1035,8 @@ bool TestRunner::runOperations(const std::string& key, TestMetadata& metadata, R
map.flyTo(mbgl::CameraOptions().withCenter(endPos).withZoom(endZoom), animationOptions);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wfor-loop-analysis"
for (; !transitionFinished; frames++) {
frontend.renderOnce(map);
float frameTime = (float)frontend.getFrameTime();
@@ -1042,7 +1044,7 @@ bool TestRunner::runOperations(const std::string& key, TestMetadata& metadata, R
samples.push_back(frameTime);
}
-
+#pragma clang diagnostic pop
float averageFps = totalTime > 0.0 ? frames / totalTime : 0.0;
float minFrameTime = 0.0;