From cb13b4f5edc38b8415696ad9e4cc19dae334e2c5 Mon Sep 17 00:00:00 2001 From: SubodhKumar Date: Wed, 9 Nov 2016 14:33:40 +0530 Subject: [PATCH] [efl] Fix warnings Change-Id: I84a90168ff64d12c80af211d1995f4c3c76bb3b7 Signed-off-by: SubodhKumar --- src/bin/edje/edje_cc.h | 2 +- src/bin/edje/edje_cc_handlers.c | 2 +- src/lib/ecore/ecore_anim.c | 2 +- src/lib/ecore_drm/ecore_drm_device.c | 5 ++-- src/lib/ecore_drm/ecore_drm_fb.c | 9 +++--- src/lib/ecore_drm/ecore_drm_inputs.c | 2 +- src/lib/ecore_evas/ecore_evas_tbm.c | 1 - src/lib/ecore_evas/ecore_evas_tbm.h | 2 +- src/lib/ecore_wayland/ecore_wl_dnd.c | 1 - src/lib/ecore_wayland/ecore_wl_input.c | 1 - src/lib/edje/edje_calc.c | 2 +- src/lib/edje/edje_util.c | 2 +- src/lib/efl/interfaces/efl_gfx_shape.c | 4 +-- src/lib/evas/canvas/evas_object_vg.c | 5 ++-- .../ecore_evas/engines/extn/ecore_evas_extn_buf.c | 4 ++- src/modules/evas/engines/drm/evas_engine.c | 4 +++ .../evas/engines/gl_common/evas_gl_texture.c | 7 ++--- src/modules/evas/engines/gl_generic/evas_engine.c | 2 +- src/modules/evas/engines/gl_tbm/evas_engine.c | 33 +++++++++++++++++++++- .../evas/engines/software_generic/evas_engine.c | 2 +- src/modules/evas/engines/wayland_shm/evas_tbmbuf.c | 4 +-- .../evas/image_loaders/psd/evas_image_load_psd.c | 5 ++-- 22 files changed, 66 insertions(+), 35 deletions(-) diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h index 5722e9a..eb6cc0b 100644 --- a/src/bin/edje/edje_cc.h +++ b/src/bin/edje/edje_cc.h @@ -301,7 +301,7 @@ extern Eina_Bool current_group_inherit; extern int had_quote; /* TIZEN_ONLY(150320)********************Ninepatch patch for Samsung************************************/ -Eina_Bool is_ninepatch_image(char* name); +Eina_Bool is_ninepatch_image(const char* name); Eina_Bool ninepatch_image_info_get(char* name, int *w, int *h, int* borderleft, int* borderright, int* bordertop, int* borderbottom); /************************************************************************************/ diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index cef0d87..55a030d 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -14674,7 +14674,7 @@ struct _NinePatch_Image_Info Eina_List *ninepatch_image_infos = NULL; -Eina_Bool is_ninepatch_image(char* name) +Eina_Bool is_ninepatch_image(const char* name) { char* check_point; int str_len = strlen(name); diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c index 30cfcc6..05a95e2 100644 --- a/src/lib/ecore/ecore_anim.c +++ b/src/lib/ecore/ecore_anim.c @@ -111,7 +111,7 @@ _timer_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread) fd_set rfds, wfds, exfds; struct timeval tv; unsigned int t; - char tick = 0; + signed char tick = 0; double t0, d; int ret; diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c index f09df69..ef83e1f 100644 --- a/src/lib/ecore_drm/ecore_drm_device.c +++ b/src/lib/ecore_drm/ecore_drm_device.c @@ -210,7 +210,7 @@ ecore_drm_device_find(const char *name, const char *seat) if (!getenv("ECORE_DRM_DEVICE_DUMMY")) return NULL; - if (dev = calloc(1, sizeof(Ecore_Drm_Device))) + if ((dev = calloc(1, sizeof(Ecore_Drm_Device)))) { dev->drm.name = eina_stringshare_add("dummy"); dev->drm.path = eina_stringshare_add("dummy"); @@ -862,8 +862,7 @@ EAPI Eina_Bool ecore_drm_device_pointer_rotation_set(Ecore_Drm_Device *dev, int rotation) { Ecore_Drm_Seat *seat = NULL; - Ecore_Drm_Evdev *edev = NULL; - Eina_List *l = NULL, *l2 = NULL; + Eina_List *l = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(dev->seats, EINA_FALSE); diff --git a/src/lib/ecore_drm/ecore_drm_fb.c b/src/lib/ecore_drm/ecore_drm_fb.c index 10a8da6..05046b1 100644 --- a/src/lib/ecore_drm/ecore_drm_fb.c +++ b/src/lib/ecore_drm/ecore_drm_fb.c @@ -57,11 +57,6 @@ _ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb) EAPI Ecore_Drm_Fb * ecore_drm_fb_create(Ecore_Drm_Device *dev, int width, int height) { - Ecore_Drm_Fb *fb; - struct drm_mode_create_dumb carg; - struct drm_mode_destroy_dumb darg; - struct drm_mode_map_dumb marg; - EINA_SAFETY_ON_NULL_RETURN_VAL(dev, NULL); EINA_SAFETY_ON_TRUE_RETURN_VAL((width < 1) || (height < 1), NULL); @@ -77,6 +72,10 @@ ecore_drm_fb_create(Ecore_Drm_Device *dev, int width, int height) else return _ecore_drm_display_fb_create(dev, width, height); #endif + Ecore_Drm_Fb *fb; + struct drm_mode_create_dumb carg; + struct drm_mode_destroy_dumb darg; + struct drm_mode_map_dumb marg; if (!(fb = calloc(1, sizeof(Ecore_Drm_Fb)))) return NULL; diff --git a/src/lib/ecore_drm/ecore_drm_inputs.c b/src/lib/ecore_drm/ecore_drm_inputs.c index b0d20b0..c735373 100644 --- a/src/lib/ecore_drm/ecore_drm_inputs.c +++ b/src/lib/ecore_drm/ecore_drm_inputs.c @@ -447,7 +447,7 @@ const struct libinput_interface _input_interface = }; static void -ecore_drm_libinput_log_handler(struct libinput *libinput, +ecore_drm_libinput_log_handler(struct libinput *libinput EINA_UNUSED, enum libinput_log_priority priority, const char *format, va_list args) { diff --git a/src/lib/ecore_evas/ecore_evas_tbm.c b/src/lib/ecore_evas/ecore_evas_tbm.c index 08bd4ae..b5c14ee 100755 --- a/src/lib/ecore_evas/ecore_evas_tbm.c +++ b/src/lib/ecore_evas/ecore_evas_tbm.c @@ -897,7 +897,6 @@ EAPI void ecore_evas_tbm_pixels_release(Ecore_Evas *ee) { Ecore_Evas_Engine_Tbm_Data *tbm_data; - tbm_surface_info_s surf_info; EINA_SAFETY_ON_NULL_RETURN(ee); diff --git a/src/lib/ecore_evas/ecore_evas_tbm.h b/src/lib/ecore_evas/ecore_evas_tbm.h index 7def861..02cfff3 100755 --- a/src/lib/ecore_evas/ecore_evas_tbm.h +++ b/src/lib/ecore_evas/ecore_evas_tbm.h @@ -4,7 +4,7 @@ typedef struct _Ecore_Evas_Engine_Tbm_Data Ecore_Evas_Engine_Tbm_Data; struct _Ecore_Evas_Engine_Tbm_Data { - void* tbm_queue; + const void* tbm_queue; tbm_surface_h tbm_surf; Eina_Bool ext_tbm_queue; void (*free_func) (void *data, void *tbm_queue); diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c b/src/lib/ecore_wayland/ecore_wl_dnd.c index bb68dd3..8f9a10d 100644 --- a/src/lib/ecore_wayland/ecore_wl_dnd.c +++ b/src/lib/ecore_wayland/ecore_wl_dnd.c @@ -600,7 +600,6 @@ static void _ecore_wl_dnd_selection_cb_free(void *data EINA_UNUSED, void *event) { Ecore_Wl_Event_Dnd_Selection *ev; - char **t; LOGFN(__FILE__, __LINE__, __FUNCTION__); diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c index e999feb..b17c297 100644 --- a/src/lib/ecore_wayland/ecore_wl_input.c +++ b/src/lib/ecore_wayland/ecore_wl_input.c @@ -1246,7 +1246,6 @@ static Eina_Bool _ecore_wl_input_cb_keyboard_repeat(void *data) { Ecore_Wl_Input *input; - Ecore_Wl_Window *win = NULL; LOGFN(__FILE__, __LINE__, __FUNCTION__); diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 038547b..7f25bf6 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -3847,7 +3847,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein #define EDJE_DEFAULT_RIGHT_FADE_IMAGE "edje_default_right_fade_image.png" static void -_edje_real_part_text_fade_image_set(Edje *ed, Edje_Real_Part *ep, double align) +_edje_real_part_text_fade_image_set(Edje *ed EINA_UNUSED, Edje_Real_Part *ep, double align) { Evas_Object *fade_obj = fade_obj = ep->typedata.text->fade.object; char buf[1024]; diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 8038ad3..90361cb 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -5573,7 +5573,7 @@ _edje_real_part_text_text_source_description_get(Edje_Real_Part *ep, Edje_Real_P } EOLIAN Eina_Bool -_edje_object_part_text_hide_visible_password(Eo *obj, Edje *ed, const char *part) +_edje_object_part_text_hide_visible_password(Eo *obj EINA_UNUSED, Edje *ed, const char *part) { Edje_Real_Part *rp; Eina_Bool int_ret = EINA_FALSE; diff --git a/src/lib/efl/interfaces/efl_gfx_shape.c b/src/lib/efl/interfaces/efl_gfx_shape.c index a5b7097..ec4fb6d 100644 --- a/src/lib/efl/interfaces/efl_gfx_shape.c +++ b/src/lib/efl/interfaces/efl_gfx_shape.c @@ -1538,8 +1538,8 @@ _efl_gfx_shape_append_svg_path(Eo *obj, Efl_Gfx_Shape_Data *pd, goto error; } process_command(obj, pd, cmd, number_array, number_count, &cur_x, &cur_y); - if (!arc && (cmd == 'a') || (cmd == 'A') || - (cmd == 'e') || (cmd == 'E')) + if ((!arc) && ((cmd == 'a') || (cmd == 'A') || + (cmd == 'e') || (cmd == 'E'))) arc = EINA_TRUE; } if (arc) diff --git a/src/lib/evas/canvas/evas_object_vg.c b/src/lib/evas/canvas/evas_object_vg.c index ba08f13..8c3836d 100644 --- a/src/lib/evas/canvas/evas_object_vg.c +++ b/src/lib/evas/canvas/evas_object_vg.c @@ -231,7 +231,8 @@ _svg_data_render(Evas_Object_Protected_Data *obj, Ector_Surface *ector; RGBA_Draw_Context *ct; Eina_Bool async_unref; - Eina_Bool error = EINA_FALSE, created = EINA_FALSE; + Eina_Bool created = EINA_FALSE; + int error = 0; // if the size changed in between path set and the draw call; if (!(svg->w == obj->cur->geometry.w && @@ -309,7 +310,7 @@ evas_object_vg_render(Evas_Object *eo_obj EINA_UNUSED, { Evas_VG_Data *vd = type_private_data; Ector_Surface *ector = evas_ector_get(obj->layer->evas); - Eina_Bool error = EINA_FALSE; + int error = 0; // FIXME: Set context (that should affect Ector_Surface) and // then call Ector_Renderer render from bottom to top. Get the diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c b/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c index 31f3e14..8709c77 100644 --- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c +++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn_buf.c @@ -20,7 +20,9 @@ _extnbuf_new(const char *base, int id, Eina_Bool sys, int num, mode_t mode = S_IRUSR; int prot = PROT_READ; int page_size; - Eina_Tmpstr *tmp = NULL; + //TIZEN ONLY (150908): security issue. To access any application, it needs smack rule. + //Eina_Tmpstr *tmp = NULL; + // page_size = eina_cpu_page_size(); diff --git a/src/modules/evas/engines/drm/evas_engine.c b/src/modules/evas/engines/drm/evas_engine.c index 24282f7..901592b 100644 --- a/src/modules/evas/engines/drm/evas_engine.c +++ b/src/modules/evas/engines/drm/evas_engine.c @@ -6,6 +6,10 @@ # include #endif +#ifdef EVAS_CSERVE2 +#include "evas_cs2_private.h" +#endif + /* local structures */ typedef struct _Render_Engine Render_Engine; diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c b/src/modules/evas/engines/gl_common/evas_gl_texture.c index c3e98a4..3eb0b70 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_texture.c +++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c @@ -1103,7 +1103,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int if ((tex->gc->shared->info.tune.atlas.max_memcpy_size > im->cache_entry.w) && (tex->gc->shared->info.tune.atlas.max_memcpy_size > im->cache_entry.h)) { - int sw, sh, dw, dh, sidx, didx; + int sw, sh, dw, dh; dw = im->cache_entry.w + 2; dh = im->cache_entry.h + 2; @@ -1112,10 +1112,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int DATA32 * temp = alloca (dw * dh * bytes_count); DATA8 *dp = (unsigned char *)temp; DATA8 *sp = (unsigned char *)im->image.data; - int i,j; - - sidx = 0; - didx = 0; + int i; dp += (dw * bytes_count); for(i = 0 ; i < sh ; i ++) diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index d31db2a..f52640b 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -2560,7 +2560,7 @@ eng_ector_surface_create(void *data, void *surface, int width, int height, Eina_ } static void -eng_ector_surface_cache_set(void *data, void *key, void *surface) +eng_ector_surface_cache_set(void *data EINA_UNUSED, void *key, void *surface) { evas_gl_common_surface_cache_set(key, surface); } diff --git a/src/modules/evas/engines/gl_tbm/evas_engine.c b/src/modules/evas/engines/gl_tbm/evas_engine.c index 1d77570..357526e 100755 --- a/src/modules/evas/engines/gl_tbm/evas_engine.c +++ b/src/modules/evas/engines/gl_tbm/evas_engine.c @@ -274,6 +274,7 @@ evgl_eng_display_get(void *data) if (!(ob = eng_get_ob(re))) return NULL; return (void *)ob->egl_disp; #else + (void)data; return NULL; #endif } @@ -289,6 +290,7 @@ evgl_eng_evas_surface_get(void *data) if (!(ob = eng_get_ob(re))) return NULL; return (void *)ob->egl_surface[0]; #else + (void)data; return NULL; #endif } @@ -328,6 +330,7 @@ evgl_eng_native_window_create(void *data) return (void *)surface; #else + (void)data; return NULL; #endif } @@ -354,6 +357,8 @@ evgl_eng_native_window_destroy(void *data, void *win) free(surface); return 1; #else + (void)data; + (void)win; return 0; #endif } @@ -387,6 +392,8 @@ evgl_eng_window_surface_create(void *data, void *win) return (void *)surface; #else + (void)data; + (void)win; return NULL; #endif } @@ -415,6 +422,8 @@ evgl_eng_window_surface_destroy(void *data, void *surface) eglDestroySurface(ob->egl_disp, (EGLSurface)surface); return 1; #else + (void)data; + (void)surface; return 0; #endif } @@ -506,6 +515,9 @@ evgl_eng_context_create(void *data, void *ctxt, Evas_GL_Context_Version version) return (void *)context; #else + (void)data; + (void)ctxt; + (void)version; return NULL; #endif } @@ -534,6 +546,8 @@ evgl_eng_context_destroy(void *data, void *ctxt) eglDestroyContext(ob->egl_disp, (EGLContext)ctxt); return 1; #else + (void)data; + (void)ctxt; return 0; #endif } @@ -592,6 +606,10 @@ evgl_eng_make_current(void *data, void *surface, void *ctxt, int flush) return 1; #else + (void)data; + (void)surface; + (void)ctxt; + (void) flush; return 0; #endif } @@ -603,6 +621,7 @@ evgl_eng_proc_address_get(const char *name) if (glsym_eglGetProcAddress) return glsym_eglGetProcAddress(name); return dlsym(RTLD_DEFAULT, name); #else + (void)name; return NULL; #endif } @@ -624,6 +643,7 @@ evgl_eng_string_get(void *data) return eglQueryString(ob->egl_disp, EGL_EXTENSIONS); #else + (void)data; return NULL; #endif } @@ -652,6 +672,7 @@ evgl_eng_rotation_angle_get(void *data) return 0; } #else + (void)data; return 0; #endif } @@ -793,6 +814,9 @@ evgl_eng_pbuffer_surface_create(void *data, EVGL_Surface *sfc, return (void*)(intptr_t)pbuf; #endif #else + (void)data; + (void)sfc; + (void)attrib_list; return NULL; #endif } @@ -830,6 +854,8 @@ evgl_eng_pbuffer_surface_destroy(void *data, void *surface) return 1; #else + (void)data; + (void)surface; return 0; #endif } @@ -853,6 +879,11 @@ evgl_eng_native_win_surface_config_get(void *data, int *win_depth, eng_get_ob(re)->detected.depth_buffer_size, eng_get_ob(re)->detected.stencil_buffer_size, eng_get_ob(re)->detected.msaa); +#else + (void)data; + (void)win_depth; + (void)win_stencil; + (void)win_msaa; #endif } @@ -1235,7 +1266,7 @@ _native_cb_bind(void *data EINA_UNUSED, void *image) if (n->ns_data.evasgl.surface) { Eina_Bool is_egl_image = EINA_FALSE; - void *surface; + void *surface = NULL; if (glsym_evgl_native_surface_buffer_get) surface = glsym_evgl_native_surface_buffer_get(n->ns_data.evasgl.surface, &is_egl_image); diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index 8b2e955..a6c8688 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -3958,7 +3958,7 @@ _ector_surface_cache_dump(void) } static void -eng_ector_surface_cache_set(void *data, void *key, void *surface) +eng_ector_surface_cache_set(void *data EINA_UNUSED, void *key, void *surface) { Ector_Surface_Data *surface_data = NULL; int count; diff --git a/src/modules/evas/engines/wayland_shm/evas_tbmbuf.c b/src/modules/evas/engines/wayland_shm/evas_tbmbuf.c index 57aba17..1737658 100755 --- a/src/modules/evas/engines/wayland_shm/evas_tbmbuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_tbmbuf.c @@ -449,8 +449,8 @@ _evas_tbmbuf_surface_data_get(Surface *s, int *w, int *h) static void -__cb_client_frame_callback(void *data, struct wl_callback *callback, - uint32_t time) +__cb_client_frame_callback(void *data EINA_UNUSED, struct wl_callback *callback, + uint32_t time EINA_UNUSED) { wl_callback_destroy(callback); } diff --git a/src/modules/evas/image_loaders/psd/evas_image_load_psd.c b/src/modules/evas/image_loaders/psd/evas_image_load_psd.c index 6c8879a..f39fd28 100644 --- a/src/modules/evas/image_loaders/psd/evas_image_load_psd.c +++ b/src/modules/evas/image_loaders/psd/evas_image_load_psd.c @@ -200,7 +200,8 @@ read_compressed_channel(const unsigned char *map, size_t length, size_t *positio { // FIXME: what does channel_length means, and why is it not used unsigned int i; - char headbyte, c; + signed char headbyte; + unsigned char c; #define CHECK_RET(Call) \ if (!Call) return READ_COMPRESSED_ERROR_FILE_READ_ERROR; \ @@ -502,7 +503,7 @@ get_single_channel(PSD_Header *head, Eina_Bool compressed) { unsigned int i, bpc; - char headbyte; + signed char headbyte; int c; int pixels_count; -- 2.7.4