aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
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
commitb4d3c92b6c8120eb389e10b49269c656448da1b5 (patch)
treeff513e1c3baac2873a0ebc6934f2a4fc2f53cf33 /src/examples
parenteina: Add doxygen in/out tags for cow, cpu, and debug (diff)
downloadefl-b4d3c92b6c8120eb389e10b49269c656448da1b5.tar.gz
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 https://phab.enlightenment.org/T7166. Fixes https://phab.enlightenment.org/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: https://phab.enlightenment.org/T6718 Differential Revision: https://phab.enlightenment.org/D6631
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/eina/eina_simple_xml_parser_01.c5
-rw-r--r--src/examples/elementary/efl_ui_view_list_example_1.c3
-rw-r--r--src/examples/evas/evas-map-utils-eo.c13
3 files changed, 12 insertions, 9 deletions
diff --git a/src/examples/eina/eina_simple_xml_parser_01.c b/src/examples/eina/eina_simple_xml_parser_01.c
index a4f6ca4456..0ad4ec3b85 100644
--- a/src/examples/eina/eina_simple_xml_parser_01.c
+++ b/src/examples/eina/eina_simple_xml_parser_01.c
@@ -31,7 +31,10 @@ main(void)
if ((buffer = malloc(size)))
{
- fread(buffer, 1, size, file);
+ if (fread(buffer, 1, size, file) != size)
+ {
+ EINA_LOG_ERR("Can't read chat.xml");
+ }
array = eina_array_new(10);
eina_simple_xml_parse(buffer, size, EINA_TRUE,
diff --git a/src/examples/elementary/efl_ui_view_list_example_1.c b/src/examples/elementary/efl_ui_view_list_example_1.c
index e3ca73d261..86b854261b 100644
--- a/src/examples/elementary/efl_ui_view_list_example_1.c
+++ b/src/examples/elementary/efl_ui_view_list_example_1.c
@@ -72,7 +72,7 @@ EAPI_MAIN int
elm_main(int argc, char **argv)
{
Efl_Ui_Layout_Factory *factory;
- Evas_Object *win, *li, *bx;
+ Evas_Object *win, *li;
Eo *model;
win = elm_win_util_standard_add("viewlist", "Viewlist");
@@ -90,7 +90,6 @@ elm_main(int argc, char **argv)
li = efl_add(EFL_UI_VIEW_LIST_CLASS, win);
efl_ui_view_list_layout_factory_set(li, factory);
efl_ui_view_model_set(li, model);
- elm_box_pack_end(bx, li);
efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_REALIZED, _realized_cb, NULL);
// efl_event_callback_add(li, EFL_UI_VIEW_LIST_EVENT_ITEM_UNREALIZED, _unrealized_cb, NULL);
diff --git a/src/examples/evas/evas-map-utils-eo.c b/src/examples/evas/evas-map-utils-eo.c
index 78845e708a..e1767cd1c3 100644
--- a/src/examples/evas/evas-map-utils-eo.c
+++ b/src/examples/evas/evas-map-utils-eo.c
@@ -71,8 +71,9 @@ _anim_cb(void *data)
App_Data *ad = data;
Evas_Object *o;
Eina_Rect rect;
- int r, g, b, a, f, h, w;
+ int r, g, b, a, f;
int win_w, win_h, mx, my;
+ Eina_Size2D size;
f = ad->frame;
r = ad->colors[ad->colors_index].r;
@@ -90,13 +91,13 @@ _anim_cb(void *data)
o = evas_object_name_find(ad->canvas, "obj2");
- h = efl_gfx_entity_size_get(o).h;
+ size = efl_gfx_entity_size_get(o);
efl_gfx_map_reset(o);
efl_gfx_map_smooth_set(o, ad->smooth);
efl_gfx_map_alpha_set(o, ad->alpha);
efl_gfx_map_color_set(o, -1, r, g, b, a);
efl_gfx_map_translate(o, 0, 0, 100);
- efl_gfx_map_rotate_3d(o, f * 6, f * 6, f * 6, NULL, 1./3., 10. / h, 0);
+ efl_gfx_map_rotate_3d(o, f * 6, f * 6, f * 6, NULL, 1./3., 10. / size.h, 0);
if (ad->apply_lighting)
{
efl_gfx_map_lightning_3d(o, ad->canvas, 0.5, 0.5, -100.,
@@ -105,13 +106,13 @@ _anim_cb(void *data)
o = evas_object_name_find(ad->canvas, "obj3");
- EINA_SIZE2D(w, h) = efl_gfx_entity_size_get(o);
+ size = efl_gfx_entity_size_get(o);
efl_gfx_map_reset(o);
efl_gfx_map_smooth_set(o, ad->smooth);
efl_gfx_map_alpha_set(o, ad->alpha);
efl_gfx_map_color_set(o, -1, r, g, b, a);
- efl_gfx_map_translate(o, 0, h/2, -20);
- efl_gfx_map_rotate_3d(o, 20, f * 6, 0, NULL, 0.5, 0.5, w / 2);
+ efl_gfx_map_translate(o, 0, size.h/2, -20);
+ efl_gfx_map_rotate_3d(o, 20, f * 6, 0, NULL, 0.5, 0.5, size.w / 2);
if (ad->apply_perspective)
efl_gfx_map_perspective_3d(o, NULL, 0.5, 0.5, 0, 256);
if (ad->apply_lighting)