← Back to team overview

kicad-developers team mailing list archive

[PATCH 2/2] Avoid warning about int -> pointer conversion

 

---
 common/gal/opengl/gpu_manager.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/gal/opengl/gpu_manager.cpp b/common/gal/opengl/gpu_manager.cpp
index 2cba5cc..f14a994 100644
--- a/common/gal/opengl/gpu_manager.cpp
+++ b/common/gal/opengl/gpu_manager.cpp
@@ -168,7 +168,8 @@ void GPU_CACHED_MANAGER::EndDrawing()
     // Bind vertices data buffers
     glBindBuffer( GL_ARRAY_BUFFER, cached->GetBufferHandle() );
     glVertexPointer( CoordStride, GL_FLOAT, VertexSize, 0 );
-    glColorPointer( ColorStride, GL_UNSIGNED_BYTE, VertexSize, (GLvoid*) ColorOffset );
+    glColorPointer( ColorStride, GL_UNSIGNED_BYTE, VertexSize,
+            reinterpret_cast<GLvoid*>( static_cast<uintptr_t>( ColorOffset ) );
 
     if( m_shader != NULL )    // Use shader if applicable
     {
@@ -180,7 +181,7 @@ void GPU_CACHED_MANAGER::EndDrawing()
 
     glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, m_indicesBuffer );
     glBufferData( GL_ELEMENT_ARRAY_BUFFER, m_indicesSize * sizeof(int),
-            (GLvoid*) m_indices.get(), GL_DYNAMIC_DRAW );
+            reinterpret_cast<GLvoid*>( static_cast<uintptr_t>( m_indices.get() ) ), GL_DYNAMIC_DRAW );
 
     glDrawElements( GL_TRIANGLES, m_indicesSize, GL_UNSIGNED_INT, 0 );
 

Follow ups

References