From bda6bb85954ca81f50f6a2789df631b97e3958e9 Mon Sep 17 00:00:00 2001 From: cutealien Date: Wed, 4 Jan 2023 19:51:24 +0000 Subject: [PATCH] Avoid undefined arithmetic on nullptr in buffer_offset function Not quite sure why it was done that way. Maybe to ensure we work with byte-pointers of correct size or something? Anyway, this doesn't seem to be defined in c++, so let's try working with a cast instead. Just something cppcheck tool complained about. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6447 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/COpenGLDriver.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Irrlicht/COpenGLDriver.cpp b/source/Irrlicht/COpenGLDriver.cpp index ed6bda9b..26757923 100644 --- a/source/Irrlicht/COpenGLDriver.cpp +++ b/source/Irrlicht/COpenGLDriver.cpp @@ -803,10 +803,10 @@ IRenderTarget* COpenGLDriver::addRenderTarget() } -// small helper function to create vertex buffer object adress offsets -static inline u8* buffer_offset(const long offset) +// small helper function to create vertex buffer object address offsets +static inline const GLvoid * buffer_offset(const long offset) { - return ((u8*)0 + offset); + return (const GLvoid *)offset; }