From 800b877ed71698326e68071c50a511e4ac91bfd0 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Wed, 2 Aug 2017 18:40:25 +0900 Subject: [PATCH] evas model loader - restructure code to silence warning keep our build quiet warnings-wise and change the code to be so... so we see real warnings. not a bug... just a warning. --- src/modules/evas/model_loaders/obj/evas_model_load_obj.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/evas/model_loaders/obj/evas_model_load_obj.c b/src/modules/evas/model_loaders/obj/evas_model_load_obj.c index 2b18c61202..bdc246d559 100644 --- a/src/modules/evas/model_loaders/obj/evas_model_load_obj.c +++ b/src/modules/evas/model_loaders/obj/evas_model_load_obj.c @@ -405,6 +405,8 @@ evas_model_load_file_obj(Evas_Canvas3D_Mesh *mesh, Eina_File *file) { float *p, *n, *t; + n = NULL; + t = NULL; p = (float *)((char *)pos + stride_pos * (j * 3 + k)); if (counts.existence_of_normal) n = (float *)((char *)nor + stride_nor * (j * 3 + k)); @@ -415,14 +417,14 @@ evas_model_load_file_obj(Evas_Canvas3D_Mesh *mesh, Eina_File *file) p[1] = ARRAY_2D(_vertices_obj, (ARRAY_2D(_triangles, j, (3 * k), 9) - 1), 1, 3); p[2] = ARRAY_2D(_vertices_obj, (ARRAY_2D(_triangles, j, (3 * k), 9) - 1), 2, 3); - if (counts.existence_of_normal) + if (n) { n[0] = ARRAY_2D(_normales_obj, (ARRAY_2D(_triangles, j, (3 * k + 2), 9) - 1), 0, 3); n[1] = ARRAY_2D(_normales_obj, (ARRAY_2D(_triangles, j, (3 * k + 2), 9) - 1), 1, 3); n[2] = ARRAY_2D(_normales_obj, (ARRAY_2D(_triangles, j, (3 * k + 2), 9) - 1), 2, 3); } - if (counts.existence_of_tex_point) + if (t) { t[0] = ARRAY_2D(_tex_coords_obj, (ARRAY_2D(_triangles, j, (3 * k + 1), 9) - 1), 0, 3); t[1] = ARRAY_2D(_tex_coords_obj, (ARRAY_2D(_triangles, j, (3 * k + 1), 9) - 1), 1, 3);