diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-26 10:38:25 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-26 10:58:36 +0300 |
commit | 333e41eac6daf60c6aa9df0496a39c57d74b9c87 (patch) | |
tree | 5986e980fd64bc4ef1c3dda125a0f9dca4bab2c8 /source/blender/gpu/opengl | |
parent | 0210c4df1793799a09a35e44be286dfca88769dc (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Use function style casts in C++ headers & source.
Diffstat (limited to 'source/blender/gpu/opengl')
-rw-r--r-- | source/blender/gpu/opengl/gl_index_buffer.hh | 6 | ||||
-rw-r--r-- | source/blender/gpu/opengl/gl_vertex_buffer.cc | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/gpu/opengl/gl_index_buffer.hh b/source/blender/gpu/opengl/gl_index_buffer.hh index 974c01d2b65..78159db764c 100644 --- a/source/blender/gpu/opengl/gl_index_buffer.hh +++ b/source/blender/gpu/opengl/gl_index_buffer.hh @@ -35,11 +35,9 @@ class GLIndexBuf : public IndexBuf { { additional_vertex_offset += index_start_; if (index_type_ == GPU_INDEX_U32) { - return reinterpret_cast<void *>(static_cast<intptr_t>(additional_vertex_offset) * - sizeof(GLuint)); + return reinterpret_cast<void *>(intptr_t(additional_vertex_offset) * sizeof(GLuint)); } - return reinterpret_cast<void *>(static_cast<intptr_t>(additional_vertex_offset) * - sizeof(GLushort)); + return reinterpret_cast<void *>(intptr_t(additional_vertex_offset) * sizeof(GLushort)); } GLuint restart_index() const diff --git a/source/blender/gpu/opengl/gl_vertex_buffer.cc b/source/blender/gpu/opengl/gl_vertex_buffer.cc index 2515b7e8f19..d186c2025b3 100644 --- a/source/blender/gpu/opengl/gl_vertex_buffer.cc +++ b/source/blender/gpu/opengl/gl_vertex_buffer.cc @@ -142,7 +142,7 @@ void *GLVertBuf::unmap(const void *mapped_data) const void GLVertBuf::wrap_handle(uint64_t handle) { BLI_assert(vbo_id_ == 0); - BLI_assert(glIsBuffer(static_cast<uint>(handle))); + BLI_assert(glIsBuffer(uint(handle))); is_wrapper_ = true; vbo_id_ = uint(handle); /* We assume the data is already on the device, so no need to allocate or send it. */ |