cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ccfbb521cd6c6e8a3ad5156f6f971dcffbe192f5
commit ccfbb521cd6c6e8a3ad5156f6f971dcffbe192f5 Author: Bogdan Devichev <b.devic...@samsung.com> Date: Mon Feb 23 14:46:15 2015 +0100 evas: some fixes to evas examples. Summary: Fixed : errors (connected with eo and new resources path) in evas-object-manipulation-eo.c Fixed : warning: format not a string literal and no format arguments [-Wformat-security] FIxed : unused variables in evas-images3.c are deleted Reviewers: raster, Hermet, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2025 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/examples/evas/evas-events.c | 5 ++--- src/examples/evas/evas-images.c | 5 ++--- src/examples/evas/evas-images2.c | 5 ++--- src/examples/evas/evas-images3.c | 8 ++------ src/examples/evas/evas-images4.c | 5 ++--- src/examples/evas/evas-object-manipulation-eo.c | 10 +++++----- src/examples/evas/evas-smart-object.c | 5 ++--- 7 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/examples/evas/evas-events.c b/src/examples/evas/evas-events.c index 7b61498..34ffd3e 100644 --- a/src/examples/evas/evas-events.c +++ b/src/examples/evas/evas-events.c @@ -10,7 +10,6 @@ * gcc -o evas-events evas-events.c `pkg-config --libs --cflags evas ecore ecore-evas` * @endverbatim */ -//TODO: Fix warning. #ifdef HAVE_CONFIG_H #include "config.h" @@ -148,7 +147,7 @@ _on_keydown(void *data EINA_UNUSED, if (strcmp(ev->key, "h") == 0) /* print help */ { - fprintf(stdout, commands); + puts(commands); return; } @@ -396,7 +395,7 @@ main(void) d.resize_timer = ecore_timer_add(2, _resize_cb, NULL); - fprintf(stdout, commands); + puts(commands); ecore_main_loop_begin(); ecore_evas_free(d.ee); diff --git a/src/examples/evas/evas-images.c b/src/examples/evas/evas-images.c index 851b0d6..da78ba4 100644 --- a/src/examples/evas/evas-images.c +++ b/src/examples/evas/evas-images.c @@ -9,7 +9,6 @@ * gcc -o evas-images evas-images.c `pkg-config --libs --cflags evas ecore ecore-evas` * @endverbatim */ -//TODO: Fix warnings. #ifdef HAVE_CONFIG_H #include "config.h" @@ -99,7 +98,7 @@ _on_keydown(void *data EINA_UNUSED, if (strcmp(ev->key, "h") == 0) /* print help */ { - fprintf(stdout, commands); + puts(commands); return; } @@ -336,7 +335,7 @@ main(void) evas_object_show(d.img2); } - fprintf(stdout, commands); + puts(commands); ecore_main_loop_begin(); ecore_evas_free(d.ee); diff --git a/src/examples/evas/evas-images2.c b/src/examples/evas/evas-images2.c index 45d7a4f..48f3d59 100644 --- a/src/examples/evas/evas-images2.c +++ b/src/examples/evas/evas-images2.c @@ -9,7 +9,6 @@ * gcc -o evas-images2 evas-images2.c `pkg-config --libs --cflags evas ecore ecore-evas` * @endverbatim */ -//TODO: Fix warnings #ifdef HAVE_CONFIG_H #include "config.h" @@ -164,7 +163,7 @@ _on_keydown(void *data EINA_UNUSED, if (strcmp(ev->key, "h") == 0) /* print help */ { - fprintf(stdout, commands); + puts(commands); return; } @@ -294,7 +293,7 @@ main(void) evas_object_resize(d.proxy_img, WIDTH / 2, HEIGHT / 2); evas_object_show(d.proxy_img); - fprintf(stdout, commands); + puts(commands); ecore_main_loop_begin(); ecore_evas_free(d.ee); diff --git a/src/examples/evas/evas-images3.c b/src/examples/evas/evas-images3.c index 7bd68f8..fcbaa87 100644 --- a/src/examples/evas/evas-images3.c +++ b/src/examples/evas/evas-images3.c @@ -9,7 +9,6 @@ * gcc -o evas-images3 evas-images3.c `pkg-config --libs --cflags evas ecore ecore-evas` * @endverbatim */ -//TODO: Fix warnings. #ifdef HAVE_CONFIG_H #include "config.h" @@ -77,7 +76,7 @@ _on_keydown(void *data EINA_UNUSED, if (strcmp(ev->key, "h") == 0) /* print help */ { - fprintf(stdout, commands); + puts(commands); return; } @@ -138,9 +137,6 @@ _on_keydown(void *data EINA_UNUSED, int main(void) { - // unsigned int i; - // unsigned int pixels[(WIDTH / 4) * (HEIGHT / 4)]; - if (!ecore_evas_init()) return EXIT_FAILURE; @@ -179,7 +175,7 @@ main(void) evas_object_move(d.logo1, WIDTH / 2, 0); evas_object_show(d.logo1); - fprintf(stdout, commands); + puts(commands); ecore_main_loop_begin(); ecore_evas_free(d.ee); diff --git a/src/examples/evas/evas-images4.c b/src/examples/evas/evas-images4.c index 0bb51fa..26b116f 100644 --- a/src/examples/evas/evas-images4.c +++ b/src/examples/evas/evas-images4.c @@ -9,7 +9,6 @@ * gcc -o evas-images4 evas-images4.c `pkg-config --libs --cflags evas ecore ecore-evas` * @endverbatim */ -//TODO: Fix warnings. #ifdef HAVE_CONFIG_H #include "config.h" @@ -80,7 +79,7 @@ _on_keydown(void *data EINA_UNUSED, if (strcmp(ev->key, "h") == 0) /* print help */ { - fprintf(stdout, commands); + puts(commands); return; } @@ -167,7 +166,7 @@ main(void) d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); } - fprintf(stdout, commands); + puts(commands); ecore_main_loop_begin(); ecore_evas_free(d.ee); diff --git a/src/examples/evas/evas-object-manipulation-eo.c b/src/examples/evas/evas-object-manipulation-eo.c index 2b0bfbe..e54e282 100644 --- a/src/examples/evas/evas-object-manipulation-eo.c +++ b/src/examples/evas/evas-object-manipulation-eo.c @@ -12,12 +12,13 @@ * gcc -o evas-object-manipulation-eo evas-object-manipulation-eo.c `pkg-config --libs --cflags ecore evas ecore-evas eo` * @endverbatim */ -//TODO: Fix error and warning. #ifdef HAVE_CONFIG_H #include "config.h" #else #define PACKAGE_EXAMPLES_DIR "." +#define EFL_EO_API_SUPPORT +#define EFL_BETA_API_SUPPORT #endif #include <Efl.h> @@ -25,12 +26,13 @@ #include <Ecore_Evas.h> #include <stdio.h> #include <errno.h> +#include "evas-common.h" #define WIDTH (320) #define HEIGHT (240) -static const char *img_path = PACKAGE_EXAMPLES_DIR "/enlightenment.png"; -static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; +static const char *img_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/enlightenment.png"; +static const char *border_img_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/red.png"; static const char *commands = \ "commands are:\n" @@ -191,7 +193,6 @@ main(void) * 'canvas' keeps reference to 'image'. * So it's possible to decrement refcount, and 'image' object * will be deleted automatically by parent.*/ - eo_unref(d.img); eo_do(d.img, evas_obj_image_filled_set(EINA_TRUE), efl_file_set(img_path, NULL), @@ -235,7 +236,6 @@ main(void) * rectangle) - it won't change clippees' colors, then (multiplying * by 255) */ d.clipper = eo_add(EVAS_RECTANGLE_CLASS, d.canvas); - eo_unref(d.clipper); eo_do(d.clipper, evas_obj_position_set( WIDTH / 4, HEIGHT / 4), diff --git a/src/examples/evas/evas-smart-object.c b/src/examples/evas/evas-smart-object.c index 5cece8e..d4aca26 100644 --- a/src/examples/evas/evas-smart-object.c +++ b/src/examples/evas/evas-smart-object.c @@ -8,7 +8,6 @@ * gcc -o evas-smart-object evas-smart-object.c `pkg-config --libs --cflags evas ecore ecore-evas` * @endverbatim */ -//TODO: Fix warnings. #ifdef HAVE_CONFIG_H #include "config.h" @@ -452,7 +451,7 @@ _on_keydown(void *data EINA_UNUSED, if (strcmp(ev->key, "h") == 0) /* print help */ { - fprintf(stdout, commands); + puts(commands); return; } @@ -717,7 +716,7 @@ main(void) evas_object_event_callback_add( d.bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); - fprintf(stdout, commands); + puts(commands); ecore_main_loop_begin(); ecore_evas_free(d.ee); --