summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-31 11:53:59 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-31 11:53:59 +0900
commit6e82f90807e19993a77a007e4ce0a9dbcd082d9b (patch)
tree15911424931c44444722b0f6730c26de20e17466
parentf4ce0d1b953fdb1a2b9974f0080febe937bb0ba8 (diff)
evas mem - remove redundenty unused evas mem absraction
was never used as was not practical to do so so it effectively does nothing so remove it to reduce analyser warnings found by PVS studio
-rw-r--r--src/lib/evas/canvas/evas_key_grab.c15
-rw-r--r--src/lib/evas/canvas/evas_object_intercept.c2
-rw-r--r--src/lib/evas/canvas/evas_smart.c2
-rw-r--r--src/lib/evas/include/evas_private.h3
-rw-r--r--src/lib/evas/main.c30
5 files changed, 5 insertions, 47 deletions
diff --git a/src/lib/evas/canvas/evas_key_grab.c b/src/lib/evas/canvas/evas_key_grab.c
index 7d856d2d5a..aaf6e6a2d0 100644
--- a/src/lib/evas/canvas/evas_key_grab.c
+++ b/src/lib/evas/canvas/evas_key_grab.c
@@ -35,7 +35,7 @@ evas_key_grab_new(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, const ch
35 35
36 if (have_exclusion && exclusive) return NULL; 36 if (have_exclusion && exclusive) return NULL;
37 37
38 g = evas_mem_calloc(sizeof(Evas_Key_Grab)); 38 g = calloc(1, sizeof(Evas_Key_Grab));
39 if (!g) return NULL; 39 if (!g) return NULL;
40 g->object = eo_obj; 40 g->object = eo_obj;
41 g->modifiers = modifiers; 41 g->modifiers = modifiers;
@@ -47,17 +47,8 @@ evas_key_grab_new(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, const ch
47 g->is_active = EINA_TRUE; 47 g->is_active = EINA_TRUE;
48 if (!g->keyname) 48 if (!g->keyname)
49 { 49 {
50 if (!evas_mem_free(strlen(keyname) + 1)) 50 free(g);
51 { 51 return NULL;
52 free(g);
53 return NULL;
54 }
55 g->keyname = strdup(keyname);
56 if (!g->keyname)
57 {
58 free(g);
59 return NULL;
60 }
61 } 52 }
62 53
63 if (exclusive) 54 if (exclusive)
diff --git a/src/lib/evas/canvas/evas_object_intercept.c b/src/lib/evas/canvas/evas_object_intercept.c
index 9ce9d0b5a2..fc482ad222 100644
--- a/src/lib/evas/canvas/evas_object_intercept.c
+++ b/src/lib/evas/canvas/evas_object_intercept.c
@@ -17,7 +17,7 @@ evas_object_intercept_init(Evas_Object *eo_obj)
17{ 17{
18 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 18 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
19 if (!obj->interceptors) 19 if (!obj->interceptors)
20 obj->interceptors = evas_mem_calloc(sizeof(Evas_Intercept_Func)); 20 obj->interceptors = calloc(1, sizeof(Evas_Intercept_Func));
21} 21}
22 22
23static void 23static void
diff --git a/src/lib/evas/canvas/evas_smart.c b/src/lib/evas/canvas/evas_smart.c
index a070c98a95..e93c3fc0e8 100644
--- a/src/lib/evas/canvas/evas_smart.c
+++ b/src/lib/evas/canvas/evas_smart.c
@@ -32,7 +32,7 @@ evas_smart_class_new(const Evas_Smart_Class *sc)
32 /* api does not match abi! for now refuse as we only have 1 version */ 32 /* api does not match abi! for now refuse as we only have 1 version */
33 if (sc->version != EVAS_SMART_CLASS_VERSION) return NULL; 33 if (sc->version != EVAS_SMART_CLASS_VERSION) return NULL;
34 34
35 s = evas_mem_calloc(sizeof(Evas_Smart)); 35 s = calloc(1, sizeof(Evas_Smart));
36 if (!s) return NULL; 36 if (!s) return NULL;
37 37
38 s->magic = MAGIC_SMART; 38 s->magic = MAGIC_SMART;
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 15322f18e8..f055bc09c6 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1671,8 +1671,6 @@ void evas_object_callback_init(Efl_Canvas_Object *eo_obj, Evas_Object_Protected_
1671void evas_object_callback_shutdown(Efl_Canvas_Object *eo_obj, Evas_Object_Protected_Data *obj); 1671void evas_object_callback_shutdown(Efl_Canvas_Object *eo_obj, Evas_Object_Protected_Data *obj);
1672void evas_object_event_callback_call(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Callback_Type type, void *event_info, int event_id, const Efl_Event_Description *efl_event_desc); 1672void evas_object_event_callback_call(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Callback_Type type, void *event_info, int event_id, const Efl_Event_Description *efl_event_desc);
1673Eina_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y); 1673Eina_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y);
1674int evas_mem_free(int mem_required);
1675int evas_mem_degrade(int mem_required);
1676void evas_debug_error(void); 1674void evas_debug_error(void);
1677void evas_debug_input_null(void); 1675void evas_debug_input_null(void);
1678void evas_debug_magic_null(void); 1676void evas_debug_magic_null(void);
@@ -1722,7 +1720,6 @@ void evas_object_smart_bounding_box_update(Evas_Object_Protected_Data *obj);
1722void evas_object_smart_need_bounding_box_update(Evas_Smart_Data *o, Evas_Object_Protected_Data *obj); 1720void evas_object_smart_need_bounding_box_update(Evas_Smart_Data *o, Evas_Object_Protected_Data *obj);
1723Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj); 1721Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj);
1724void evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s); 1722void evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s);
1725void *evas_mem_calloc(int size);
1726void _evas_post_event_callback_call_real(Evas *e, Evas_Public_Data* e_pd, int min_event_id); 1723void _evas_post_event_callback_call_real(Evas *e, Evas_Public_Data* e_pd, int min_event_id);
1727#define _evas_post_event_callback_call(e, pd, id) do { \ 1724#define _evas_post_event_callback_call(e, pd, id) do { \
1728 if (!pd->delete_me && pd->post_events) _evas_post_event_callback_call_real(e, pd, id); } while (0) 1725 if (!pd->delete_me && pd->post_events) _evas_post_event_callback_call_real(e, pd, id); } while (0)
diff --git a/src/lib/evas/main.c b/src/lib/evas/main.c
index 8c31d8edd9..c0f7e91312 100644
--- a/src/lib/evas/main.c
+++ b/src/lib/evas/main.c
@@ -19,36 +19,6 @@ evas_alloc_error(void)
19 return _evas_alloc_error; 19 return _evas_alloc_error;
20} 20}
21 21
22/* free cached items only in ram for speed reasons. return 0 if can't free */
23int
24evas_mem_free(int mem_required EINA_UNUSED)
25{
26 return 0;
27}
28
29/* start reducing quality of images etc. return 0 if can't free anything */
30int
31evas_mem_degrade(int mem_required EINA_UNUSED)
32{
33 return 0;
34}
35
36void *
37evas_mem_calloc(int size)
38{
39 void *ptr;
40
41 ptr = calloc(1, size);
42 if (ptr) return ptr;
43 MERR_BAD();
44 while ((!ptr) && (evas_mem_free(size))) ptr = calloc(1, size);
45 if (ptr) return ptr;
46 while ((!ptr) && (evas_mem_degrade(size))) ptr = calloc(1, size);
47 if (ptr) return ptr;
48 MERR_FATAL();
49 return NULL;
50}
51
52static void 22static void
53_evas_debug_init_from_env(void) 23_evas_debug_init_from_env(void)
54{ 24{