From 3e33f2768734ee9912cbf0cc4c0d609cda08248a Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Tue, 15 May 2018 19:54:09 +0100 Subject: dorp says this is no longer UB if float (*)[4] is cast to float * The C standard is a strange beast. --- faqe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/faqe.c b/faqe.c index d4138a8..9c52ff6 100644 --- a/faqe.c +++ b/faqe.c @@ -27,7 +27,7 @@ void viewport(GLuint proj, int width, int height) mat4x4 pers; gl_viewport(0, 0, width, height); mat4x4_perspective(pers, FOV, (float)width / (float)height, 0.1, 100); - gl_uni_setm4fv(proj, 1, GL_FALSE, pers[0]); + gl_uni_setm4fv(proj, 1, GL_FALSE, (GLfloat *)pers); } void loadmodel(struct model *mdl, char *name) @@ -181,8 +181,8 @@ int main(int argc, char **argv) mat4x4_identity(model); gl_prog_use(prog); - gl_uni_setm4fv(uni.view, 1, GL_FALSE, view[0]); - gl_uni_setm4fv(uni.model, 1, GL_FALSE, model[0]); + gl_uni_setm4fv(uni.view, 1, GL_FALSE, (GLfloat *)view); + gl_uni_setm4fv(uni.model, 1, GL_FALSE, (GLfloat *)model); gl_uni_set3fv(uni.light, 1, lipos); model_render(&mdl); gl_va_bind(0); -- cgit v1.2.3-54-g00ecf