Fixed non-constant condition for static assertion

GCC 7:
src/gl/renderer/gl_renderer.cpp:702:2: error: non-constant condition for static assertion
src/gl/renderer/gl_renderer.cpp:702:2: error: value ‘12’ of type ‘float*’ is not a constant expression
src/gl/renderer/gl_renderer.cpp:703:2: error: non-constant condition for static assertion
src/gl/renderer/gl_renderer.cpp:703:2: error: value ‘20’ of type ‘PalEntry*’ is not a constant expression

Clang:
src/gl/renderer/gl_renderer.cpp:701:16: error: static_assert expression is not an integral constant expression
src/gl/renderer/gl_renderer.cpp:701:23: note: cannot access field of null pointer
This commit is contained in:
alexey.lysiuk 2018-04-08 11:18:20 +03:00
parent 6144ca930d
commit b8ee9d88ba

View file

@ -697,16 +697,15 @@ void FGLRenderer::DrawBlend(sector_t * viewsector, bool FixedColormap, bool doco
// Vertex buffer for 2D drawer
//
//===========================================================================
#define TDiO ((F2DDrawer::TwoDVertex*)NULL)
class F2DVertexBuffer : public FSimpleVertexBuffer
{
uint32_t ibo_id;
// Make sure we can build upon FSimpleVertexBuffer.
static_assert(&VSiO->x == &TDiO->x, "x not aligned");
static_assert(&VSiO->u == &TDiO->u, "y not aligned");
static_assert(&VSiO->color == &TDiO->color0, "color not aligned");
static_assert(offsetof(FSimpleVertex, x) == offsetof(F2DDrawer::TwoDVertex, x), "x not aligned");
static_assert(offsetof(FSimpleVertex, u) == offsetof(F2DDrawer::TwoDVertex, u), "u not aligned");
static_assert(offsetof(FSimpleVertex, color) == offsetof(F2DDrawer::TwoDVertex, color0), "color not aligned");
public: