diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-03-20 15:55:39 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-04-05 11:49:17 +0200 |
commit | 394e2aa7171943b7b0be77be7b19bc4a97c36905 (patch) | |
tree | e90ac54cc8e8b3c4d476cd6b19cf0f39f446dc8b /src/mbgl/gl | |
parent | be3b5917c169a6d5e6fcdc3cca15ca78e44dfd1d (diff) | |
download | qtlocation-mapboxgl-394e2aa7171943b7b0be77be7b19bc4a97c36905.tar.gz |
[core] prefer static_cast for casts to derived classes
Diffstat (limited to 'src/mbgl/gl')
-rw-r--r-- | src/mbgl/gl/program.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/gl/texture.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/gl/program.hpp b/src/mbgl/gl/program.hpp index 1cec7671a1..92747e60c4 100644 --- a/src/mbgl/gl/program.hpp +++ b/src/mbgl/gl/program.hpp @@ -168,7 +168,7 @@ public: const gfx::IndexBuffer& indexBuffer, std::size_t indexOffset, std::size_t indexLength) override { - auto& context = reinterpret_cast<gl::Context&>(genericContext); + auto& context = static_cast<gl::Context&>(genericContext); context.setDepthMode(depthMode); context.setStencilMode(stencilMode); @@ -194,7 +194,7 @@ public: instance.textureStates.bind(context, textureBindings); - auto& vertexArray = reinterpret_cast<gl::DrawScopeResource&>(*drawScope.resource).vertexArray; + auto& vertexArray = static_cast<gl::DrawScopeResource&>(*drawScope.resource).vertexArray; vertexArray.bind(context, indexBuffer, instance.attributeLocations.toBindingArray(attributeBindings)); diff --git a/src/mbgl/gl/texture.cpp b/src/mbgl/gl/texture.cpp index 2b41e7ae8e..ef4d083677 100644 --- a/src/mbgl/gl/texture.cpp +++ b/src/mbgl/gl/texture.cpp @@ -9,7 +9,7 @@ namespace gl { using namespace platform; void bindTexture(gl::Context& context, const uint8_t unit, const gfx::TextureBinding& binding) { - auto& resource = reinterpret_cast<gl::TextureResource&>(*binding.resource); + auto& resource = static_cast<gl::TextureResource&>(*binding.resource); if (binding.filter != resource.filter || binding.mipmap != resource.mipmap || binding.wrapX != resource.wrapX || binding.wrapY != resource.wrapY) { context.activeTextureUnit = unit; |