devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=40247decd383db7322a9ed42e3cda7706e87ebc8

commit 40247decd383db7322a9ed42e3cda7706e87ebc8
Author: Chris Michael <[email protected]>
Date:   Wed Oct 29 12:12:39 2014 -0400

    evas-gl-3d: Fix compiler warning about 'ld' may be used uninitialized
    
    Summary: This commit fixes compiler warning:
    modules/evas/engines/gl_common/evas_gl_3d.c:1322:48: warning: 'ld' may
    be used uninitialized in this function [-Wmaybe-uninitialized]. We
    declare 'ld' as NULL now, and check it is valid before using it.
    
    @fix
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/modules/evas/engines/gl_common/evas_gl_3d.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_3d.c 
b/src/modules/evas/engines/gl_common/evas_gl_3d.c
index 36d301a..a5e0a81 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_3d.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_3d.c
@@ -1283,7 +1283,7 @@ e3d_drawable_scene_render(E3D_Drawable *drawable, 
E3D_Renderer *renderer, Evas_3
    const Evas_Mat4  *matrix_eye;
    Evas_3D_Node     *light;
    Evas_Mat4        matrix_light_eye;
-   Evas_3D_Light_Data *ld;
+   Evas_3D_Light_Data *ld = NULL;
    Evas_3D_Node_Data *pd_light_node;
 
    /* Get eye matrix. */
@@ -1319,8 +1319,9 @@ e3d_drawable_scene_render(E3D_Drawable *drawable, 
E3D_Renderer *renderer, Evas_3
           {
              evas_mat4_multiply(&matrix_mv, &matrix_light_eye,
                  &pd_mesh_node->data.mesh.matrix_local_to_world);
-             evas_mat4_multiply(&matrix_light, &ld->projection,
-                 &matrix_mv);
+             if (ld)
+               evas_mat4_multiply(&matrix_light, &ld->projection,
+                                  &matrix_mv);
           }
 
         evas_mat4_multiply(&matrix_mv, matrix_eye, 
&pd_mesh_node->data.mesh.matrix_local_to_world);

-- 


Reply via email to