aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorcutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475>2023-01-04 19:51:24 +0000
committersfan5 <sfan5@live.de>2023-03-24 17:09:11 +0100
commit939b3f7bfb2a9dce8258003347d7d0a5132db844 (patch)
treedf1c0468537bc519f396cb8039fb0f8a340b6321 /source
parent9c2c91776eb067b505490df6d447bdd636ce0df6 (diff)
downloadirrlicht-939b3f7bfb2a9dce8258003347d7d0a5132db844.tar.xz
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
Diffstat (limited to 'source')
-rw-r--r--source/Irrlicht/COpenGLDriver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/Irrlicht/COpenGLDriver.cpp b/source/Irrlicht/COpenGLDriver.cpp
index b0f122b..c213283 100644
--- a/source/Irrlicht/COpenGLDriver.cpp
+++ b/source/Irrlicht/COpenGLDriver.cpp
@@ -746,10 +746,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;
}