From b50f835d3515508af57927e2fe037a30d180e7ef Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 15 Apr 2016 01:43:09 -0700 Subject: [PATCH] Warning and error fixes --- interface/src/FrameTimingsScriptingInterface.cpp | 8 ++++---- libraries/gl/src/gl/OglplusHelpers.cpp | 2 +- tests/gpu-test/src/main.cpp | 4 +--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/interface/src/FrameTimingsScriptingInterface.cpp b/interface/src/FrameTimingsScriptingInterface.cpp index 6c8c164804..59b653105c 100644 --- a/interface/src/FrameTimingsScriptingInterface.cpp +++ b/interface/src/FrameTimingsScriptingInterface.cpp @@ -29,7 +29,7 @@ void FrameTimingsScriptingInterface::finish() { _min = std::numeric_limits::max(); _max = std::numeric_limits::lowest(); size_t count = _values.size(); - for (auto i = 0; i < count; ++i) { + for (size_t i = 0; i < count; ++i) { const uint64_t& value = _values[i]; _max = std::max(_max, value); _min = std::min(_min, value); @@ -37,7 +37,7 @@ void FrameTimingsScriptingInterface::finish() { } _mean = (float)total / (float)count; float deviationTotal = 0; - for (auto i = 0; i < count; ++i) { + for (size_t i = 0; i < count; ++i) { float deviation = _values[i] - _mean; deviationTotal += deviation*deviation; } @@ -46,8 +46,8 @@ void FrameTimingsScriptingInterface::finish() { QVariantList FrameTimingsScriptingInterface::getValues() const { QVariantList result; - for (const auto& v : _values) { - result << v; + for (quint64 v : _values) { + result << QVariant(v); } return result; } diff --git a/libraries/gl/src/gl/OglplusHelpers.cpp b/libraries/gl/src/gl/OglplusHelpers.cpp index 11c4f2fe3d..220ea86646 100644 --- a/libraries/gl/src/gl/OglplusHelpers.cpp +++ b/libraries/gl/src/gl/OglplusHelpers.cpp @@ -126,7 +126,7 @@ ShapeWrapperPtr loadPlane(ProgramPtr program, float aspect) { } ShapeWrapperPtr loadSkybox(ProgramPtr program) { - return ShapeWrapperPtr(new shapes::ShapeWrapper({ { "Position" } }, shapes::SkyBox(), *program)); + return ShapeWrapperPtr(new shapes::ShapeWrapper(std::initializer_list{ "Position" }, shapes::SkyBox(), *program)); } // Return a point's cartesian coordinates on a sphere from pitch and yaw diff --git a/tests/gpu-test/src/main.cpp b/tests/gpu-test/src/main.cpp index 1bb02b8101..47852104a2 100644 --- a/tests/gpu-test/src/main.cpp +++ b/tests/gpu-test/src/main.cpp @@ -422,11 +422,10 @@ public: static const uint SHAPE_TEXTURES_OFFSET = sizeof(glm::vec4); static const gpu::Element POSITION_ELEMENT { gpu::VEC3, gpu::FLOAT, gpu::XYZ }; static const gpu::Element TEXTURE_ELEMENT { gpu::VEC2, gpu::FLOAT, gpu::UV }; - static const gpu::Type SHAPE_INDEX_TYPE = gpu::UINT16; - static const uint SHAPE_INDEX_SIZE = sizeof(gpu::uint16); std::vector vertices; const int MINX = -1000; const int MAXX = 1000; + // top vertices.push_back(vec4(MAXX, 0, MAXX, 1)); vertices.push_back(vec4(MAXX, MAXX, 0, 0)); @@ -456,7 +455,6 @@ public: pipeline = gpu::Pipeline::create(shader, state); vertexFormat->setAttribute(gpu::Stream::POSITION); vertexFormat->setAttribute(gpu::Stream::TEXCOORD); - }); batch.setPipeline(pipeline); batch.setInputBuffer(gpu::Stream::POSITION, positionView);