Skip to content

Commit 11ab3c5

Browse files
committed
c++ casts in glemu for #35
1 parent 7be402c commit 11ab3c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/shared/glemu.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ namespace gle
9898
}
9999
count = maxquads - offset;
100100
}
101-
glDrawRangeElements(GL_TRIANGLES, offset*4, (offset + count)*4-1, count*6, GL_UNSIGNED_SHORT, (ushort *)0 + offset*6);
101+
glDrawRangeElements(GL_TRIANGLES, offset*4, (offset + count)*4-1, count*6, GL_UNSIGNED_SHORT, static_cast<ushort *>(nullptr) + offset*6);
102102
}
103103

104104
static void defattrib(int type, int size, int format)
@@ -608,7 +608,7 @@ namespace gle
608608
{
609609
if(attribbuf.check(2*sizeof(T)))
610610
{
611-
T *buf = (T *)attribbuf.pad(2*sizeof(T));
611+
T *buf = reinterpret_cast<T *>(attribbuf.pad(2*sizeof(T)));
612612
buf[0] = x;
613613
buf[1] = y;
614614
}
@@ -619,7 +619,7 @@ namespace gle
619619
{
620620
if(attribbuf.check(3*sizeof(T)))
621621
{
622-
T *buf = (T *)attribbuf.pad(3*sizeof(T));
622+
T *buf = reinterpret_cast<T *>(attribbuf.pad(3*sizeof(T)));
623623
buf[0] = x;
624624
buf[1] = y;
625625
buf[2] = z;
@@ -631,7 +631,7 @@ namespace gle
631631
{
632632
if(attribbuf.check(4*sizeof(T)))
633633
{
634-
T *buf = (T *)attribbuf.pad(4*sizeof(T));
634+
T *buf = reinterpret_cast<T *>(attribbuf.pad(4*sizeof(T)));
635635
buf[0] = x;
636636
buf[1] = y;
637637
buf[2] = z;

0 commit comments

Comments
 (0)