wok-current diff celestia/stuff/make-dereferenced-temporaries-explicit @ rev 22822
Add emu8051
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Feb 06 12:27:36 2020 +0100 (2020-02-06) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/celestia/stuff/make-dereferenced-temporaries-explicit Thu Feb 06 12:27:36 2020 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +--- celestia-1.6.0+dfsg.orig/src/celengine/vecgl.h 1.5 ++++ celestia-1.6.0+dfsg/src/celengine/vecgl.h 1.6 +@@ -89,17 +89,20 @@ inline void glScale(const Vec3f& v) 1.7 + 1.8 + inline void glLightDirection(GLenum light, const Vec3f& dir) 1.9 + { 1.10 +- glLightfv(light, GL_POSITION, &(Vec4f(dir.x, dir.y, dir.z, 0.0f).x)); 1.11 ++ Vec4f dir4(dir.x, dir.y, dir.z, 0.0f); 1.12 ++ glLightfv(light, GL_POSITION, &dir4.x); 1.13 + } 1.14 + 1.15 + inline void glLightPosition(GLenum light, const Point3f& pos) 1.16 + { 1.17 +- glLightfv(light, GL_POSITION, &(Vec4f(pos.x, pos.y, pos.z, 1.0f).x)); 1.18 ++ Vec4f pos4(pos.x, pos.y, pos.z, 1.0f); 1.19 ++ glLightfv(light, GL_POSITION, &pos4.x); 1.20 + } 1.21 + 1.22 + inline void glLightColor(GLenum light, GLenum which, const Vec3f& color) 1.23 + { 1.24 +- glLightfv(light, which, &(Vec4f(color.x, color.y, color.z, 1.0f).x)); 1.25 ++ Vec4f color4(color.x, color.y, color.z, 1.0f); 1.26 ++ glLightfv(light, which, &color4.x); 1.27 + } 1.28 + 1.29 + inline void glLightColor(GLenum light, GLenum which, const Vec4f& color) 1.30 +@@ -109,15 +112,14 @@ inline void glLightColor(GLenum light, G 1.31 + 1.32 + inline void glLightColor(GLenum light, GLenum which, const Color& color) 1.33 + { 1.34 +- glLightfv(light, which, 1.35 +- &(Vec4f(color.red(), color.green(), color.blue(), color.alpha()).x)); 1.36 ++ Vec4f color4(color.red(), color.green(), color.blue(), color.alpha()); 1.37 ++ glLightfv(light, which, &color4.x); 1.38 + } 1.39 + 1.40 + inline void glAmbientLightColor(const Color& color) 1.41 + { 1.42 +- glLightModelfv(GL_LIGHT_MODEL_AMBIENT, 1.43 +- &(Vec4f(color.red(), color.green(), color.blue(), 1.44 +- color.alpha()).x)); 1.45 ++ Vec4f color4(color.red(), color.green(), color.blue(), color.alpha()); 1.46 ++ glLightModelfv(GL_LIGHT_MODEL_AMBIENT, &color4.x); 1.47 + } 1.48 + 1.49 + #endif // _VECGL_H_