summaryrefslogtreecommitdiff
path: root/unsorted
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2018-07-20 10:36:38 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-07-20 10:36:38 -0400
commit3631f36cb0c013a4c165c40120eddae1175e3d77 (patch)
tree2df75ee6fdd57627ae2d611b184f50c20c776050 /unsorted
parent7ac2d2ca26530e8c32491ddf71f2fa221f290187 (diff)
efl: fix some warnings in examples
Summary: - Check return vaule of fread() - Uninitialized var (seriously!) - Weird struct assignment Still one warning remains, pending evaluation of T7166. Fixes T6718 Test Plan: Those 3 warnings have disappeared and the related example still works as expected. Reviewers: zmike Reviewed By: zmike Subscribers: cedric, #committers Tags: #efl Maniphest Tasks: T6718 Differential Revision: https://phab.enlightenment.org/D6631
Diffstat (limited to 'unsorted')
-rw-r--r--unsorted/eina/eina_simple_xml_parser_01.c5
-rw-r--r--unsorted/elementary/efl_ui_view_list_example_1.c3
-rw-r--r--unsorted/evas/evas-map-utils-eo.c13
3 files changed, 12 insertions, 9 deletions
diff --git a/unsorted/eina/eina_simple_xml_parser_01.c b/unsorted/eina/eina_simple_xml_parser_01.c
index a4f6ca44..0ad4ec3b 100644
--- a/unsorted/eina/eina_simple_xml_parser_01.c
+++ b/unsorted/eina/eina_simple_xml_parser_01.c
@@ -31,7 +31,10 @@ main(void)
31 31
32 if ((buffer = malloc(size))) 32 if ((buffer = malloc(size)))
33 { 33 {
34 fread(buffer, 1, size, file); 34 if (fread(buffer, 1, size, file) != size)
35 {
36 EINA_LOG_ERR("Can't read chat.xml");
37 }
35 38
36 array = eina_array_new(10); 39 array = eina_array_new(10);
37 eina_simple_xml_parse(buffer, size, EINA_TRUE, 40 eina_simple_xml_parse(buffer, size, EINA_TRUE,
diff --git a/unsorted/elementary/efl_ui_view_list_example_1.c b/unsorted/elementary/efl_ui_view_list_example_1.c
index e3ca73d2..86b85426 100644
--- a/unsorted/elementary/efl_ui_view_list_example_1.c
+++ b/unsorted/elementary/efl_ui_view_list_example_1.c
@@ -72,7 +72,7 @@ EAPI_MAIN int
72elm_main(int argc, char **argv) 72elm_main(int argc, char **argv)
73{ 73{
74 Efl_Ui_Layout_Factory *factory; 74 Efl_Ui_Layout_Factory *factory;
75 Evas_Object *win, *li, *bx; 75 Evas_Object *win, *li;
76 Eo *model; 76 Eo *model;
77 77
78 win = elm_win_util_standard_add("viewlist", "Viewlist"); 78 win = elm_win_util_standard_add("viewlist", "Viewlist");
@@ -90,7 +90,6 @@ elm_main(int argc, char **argv)
90 li = efl_add(EFL_UI_VIEW_LIST_CLASS, win); 90 li = efl_add(EFL_UI_VIEW_LIST_CLASS, win);
91 efl_ui_view_list_layout_factory_set(li, factory); 91 efl_ui_view_list_layout_factory_set(li, factory);
92 efl_ui_view_model_set(li, model); 92 efl_ui_view_model_set(li, model);
93 elm_box_pack_end(bx, li);
94 93
95 efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_cb, NULL); 94 efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_cb, NULL);
96// efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_UNREALIZED, _unrealized_cb, NULL); 95// efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_UNREALIZED, _unrealized_cb, NULL);
diff --git a/unsorted/evas/evas-map-utils-eo.c b/unsorted/evas/evas-map-utils-eo.c
index 78845e70..e1767cd1 100644
--- a/unsorted/evas/evas-map-utils-eo.c
+++ b/unsorted/evas/evas-map-utils-eo.c
@@ -71,8 +71,9 @@ _anim_cb(void *data)
71 App_Data *ad = data; 71 App_Data *ad = data;
72 Evas_Object *o; 72 Evas_Object *o;
73 Eina_Rect rect; 73 Eina_Rect rect;
74 int r, g, b, a, f, h, w; 74 int r, g, b, a, f;
75 int win_w, win_h, mx, my; 75 int win_w, win_h, mx, my;
76 Eina_Size2D size;
76 77
77 f = ad->frame; 78 f = ad->frame;
78 r = ad->colors[ad->colors_index].r; 79 r = ad->colors[ad->colors_index].r;
@@ -90,13 +91,13 @@ _anim_cb(void *data)
90 91
91 92
92 o = evas_object_name_find(ad->canvas, "obj2"); 93 o = evas_object_name_find(ad->canvas, "obj2");
93 h = efl_gfx_entity_size_get(o).h; 94 size = efl_gfx_entity_size_get(o);
94 efl_gfx_map_reset(o); 95 efl_gfx_map_reset(o);
95 efl_gfx_map_smooth_set(o, ad->smooth); 96 efl_gfx_map_smooth_set(o, ad->smooth);
96 efl_gfx_map_alpha_set(o, ad->alpha); 97 efl_gfx_map_alpha_set(o, ad->alpha);
97 efl_gfx_map_color_set(o, -1, r, g, b, a); 98 efl_gfx_map_color_set(o, -1, r, g, b, a);
98 efl_gfx_map_translate(o, 0, 0, 100); 99 efl_gfx_map_translate(o, 0, 0, 100);
99 efl_gfx_map_rotate_3d(o, f * 6, f * 6, f * 6, NULL, 1./3., 10. / h, 0); 100 efl_gfx_map_rotate_3d(o, f * 6, f * 6, f * 6, NULL, 1./3., 10. / size.h, 0);
100 if (ad->apply_lighting) 101 if (ad->apply_lighting)
101 { 102 {
102 efl_gfx_map_lightning_3d(o, ad->canvas, 0.5, 0.5, -100., 103 efl_gfx_map_lightning_3d(o, ad->canvas, 0.5, 0.5, -100.,
@@ -105,13 +106,13 @@ _anim_cb(void *data)
105 106
106 107
107 o = evas_object_name_find(ad->canvas, "obj3"); 108 o = evas_object_name_find(ad->canvas, "obj3");
108 EINA_SIZE2D(w, h) = efl_gfx_entity_size_get(o); 109 size = efl_gfx_entity_size_get(o);
109 efl_gfx_map_reset(o); 110 efl_gfx_map_reset(o);
110 efl_gfx_map_smooth_set(o, ad->smooth); 111 efl_gfx_map_smooth_set(o, ad->smooth);
111 efl_gfx_map_alpha_set(o, ad->alpha); 112 efl_gfx_map_alpha_set(o, ad->alpha);
112 efl_gfx_map_color_set(o, -1, r, g, b, a); 113 efl_gfx_map_color_set(o, -1, r, g, b, a);
113 efl_gfx_map_translate(o, 0, h/2, -20); 114 efl_gfx_map_translate(o, 0, size.h/2, -20);
114 efl_gfx_map_rotate_3d(o, 20, f * 6, 0, NULL, 0.5, 0.5, w / 2); 115 efl_gfx_map_rotate_3d(o, 20, f * 6, 0, NULL, 0.5, 0.5, size.w / 2);
115 if (ad->apply_perspective) 116 if (ad->apply_perspective)
116 efl_gfx_map_perspective_3d(o, NULL, 0.5, 0.5, 0, 256); 117 efl_gfx_map_perspective_3d(o, NULL, 0.5, 0.5, 0, 256);
117 if (ad->apply_lighting) 118 if (ad->apply_lighting)