diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2018-05-15 19:54:09 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2018-05-15 19:54:09 +0100 |
commit | 3e33f2768734ee9912cbf0cc4c0d609cda08248a (patch) | |
tree | 351381f9847e942998e1abb2c8183ae82a0813db | |
parent | de3f41cedfc373f4650941b163f32d8b330833c5 (diff) | |
download | faqe-3e33f2768734ee9912cbf0cc4c0d609cda08248a.tar.gz faqe-3e33f2768734ee9912cbf0cc4c0d609cda08248a.tar.xz faqe-3e33f2768734ee9912cbf0cc4c0d609cda08248a.zip |
dorp says this is no longer UB if float (*)[4] is cast to float *
The C standard is a strange beast.
-rw-r--r-- | faqe.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |