Skip to content

Commit

Permalink
FIX: [64bits] GLuint <-> void* conversion in fontTTFGL
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Apr 13, 2016
1 parent 1b84cab commit 7105864
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/guilib/GUIFontTTFGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void CGUIFontTTFGL::LastEnd()
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glMatrixModview.Get());

// Bind the buffer to the OpenGL context's GL_ARRAY_BUFFER binding point
glBindBuffer(GL_ARRAY_BUFFER, (GLuint) m_vertexTrans[i].vertexBuffer->bufferHandle);
glBindBuffer(GL_ARRAY_BUFFER, (GLuint) ((long)(m_vertexTrans[i].vertexBuffer->bufferHandle) & 0xffff));

// Do the actual drawing operation, split into groups of characters no
// larger than the pre-determined size of the element array
Expand Down

3 comments on commit 7105864

@fritsch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful here ... especially if the size of long varies from platform to platform.

@koying
Copy link
Owner Author

@koying koying commented on 7105864 Apr 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it follows the pointer length on all architecture/compilers I know (and surely that we support).
Do you have an actual example where it doesn't?

@koying
Copy link
Owner Author

@koying koying commented on 7105864 Apr 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually doesn't matter as long as the cast from void* is accepted by the compiler and sizeof(long) >= sizeof(GLuint), though...

Please sign in to comment.