aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2018-05-15 19:54:09 +0100
committerTomasz Kramkowski <tk@the-tk.com>2018-05-15 19:54:09 +0100
commit3e33f2768734ee9912cbf0cc4c0d609cda08248a (patch)
tree351381f9847e942998e1abb2c8183ae82a0813db
parentde3f41cedfc373f4650941b163f32d8b330833c5 (diff)
downloadfaqe-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.c6
1 files 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);