summaryrefslogtreecommitdiff
path: root/legacy/eina
diff options
context:
space:
mode:
authorPatryk Kaczmarek <patryk.k@samsung.com>2012-09-12 07:33:36 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-09-12 07:33:36 +0000
commitb487866e75b12e1e86fbe5582c3981308573b01f (patch)
tree5ddbc149fc56196a577235e489b74b58dc10c02d /legacy/eina
parentfaee221288362968788698a65d81bf48e86bb0b7 (diff)
From: Patryk Kaczmarek <patryk.k@samsung.com>
Firstly, I want to say hallo to everyone, it is my first message to that list. I had prepared several patches for eina module. One of them fix problem with you are having highly discussion, checking if function arguments are not NULL. What’s more: - I had proposed patches for eina_tiler and eina_rectangle functions, now below zero values ( distance and coordinstes ) are not acceptable. - Documentation for eina list specified, it should be more clear now and eina stringshare_strlen fixed (NULL had length 0 ). - eina_convert_atofp wrong return value if fp is NULL (EINA_TRUE instead of EINA_FALSE) I had also attached diff to AUTHORS, ChangeLog and NEWS. SVN revision: 76498
Diffstat (limited to 'legacy/eina')
-rw-r--r--legacy/eina/AUTHORS1
-rw-r--r--legacy/eina/ChangeLog7
-rw-r--r--legacy/eina/NEWS5
-rw-r--r--legacy/eina/src/include/eina_list.h4
-rw-r--r--legacy/eina/src/include/eina_stringshare.h2
-rw-r--r--legacy/eina/src/lib/eina_list.c2
-rw-r--r--legacy/eina/src/lib/eina_quadtree.c2
-rw-r--r--legacy/eina/src/lib/eina_rectangle.c3
-rw-r--r--legacy/eina/src/lib/eina_str.c3
-rw-r--r--legacy/eina/src/lib/eina_tiler.c11
10 files changed, 37 insertions, 3 deletions
diff --git a/legacy/eina/AUTHORS b/legacy/eina/AUTHORS
index ef0d3cc304..7ee2d6c3e6 100644
--- a/legacy/eina/AUTHORS
+++ b/legacy/eina/AUTHORS
@@ -25,3 +25,4 @@ Jonas M. Gastal <jgastal@profusion.mobi>
25Raphael Kubo da Costa <rakuco@freebsd.org> 25Raphael Kubo da Costa <rakuco@freebsd.org>
26Jérôme Pinot <ngc891@gmail.com> 26Jérôme Pinot <ngc891@gmail.com>
27Mike Blumenkrantz <michael.blumenkrantz@gmail.com> 27Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
28Patryk Kaczmarek <patryk.k@samsung.com>
diff --git a/legacy/eina/ChangeLog b/legacy/eina/ChangeLog
index 403c9d7df7..6b9f822daf 100644
--- a/legacy/eina/ChangeLog
+++ b/legacy/eina/ChangeLog
@@ -341,3 +341,10 @@
3412012-09-11 Cedric Bail 3412012-09-11 Cedric Bail
342 342
343 * Speedup Eina Rbtree Iterator by recycling memory instead of massively calling malloc/free. 343 * Speedup Eina Rbtree Iterator by recycling memory instead of massively calling malloc/free.
344
3452012-09-12 Patryk Kaczmarek <patryk.k@samsung.com>
346
347 * Add EINA_SAFETY checks for proper function arguments.
348 * Add check if given arguments (distance and coordinates) in eina_tiler
349 and eina_rectangle are not below zero
350 * Documentation for eina list specified and eina stringshare fixed
diff --git a/legacy/eina/NEWS b/legacy/eina/NEWS
index c6b08c9ff7..21665d77f8 100644
--- a/legacy/eina/NEWS
+++ b/legacy/eina/NEWS
@@ -15,6 +15,9 @@ Additions:
15 * Add backtrace support to Eina_Log, use EINA_LOG_BACKTRACE to enable it. 15 * Add backtrace support to Eina_Log, use EINA_LOG_BACKTRACE to enable it.
16 * Add an helper to iterate over line in a mapped file. 16 * Add an helper to iterate over line in a mapped file.
17 * Add EINA_SENTINEL to protect variadic functions 17 * Add EINA_SENTINEL to protect variadic functions
18 * Add EINA_SAFETY checks for proper function arguments.
19 * Add check if given arguments (distance and coordinates) in eina_tiler
20 and eina_rectangle are not below zero
18 21
19Fixes: 22Fixes:
20 * Add missing files in the tarball. 23 * Add missing files in the tarball.
@@ -27,6 +30,8 @@ Fixes:
27 * Implement eina_file_map_lines() on Windows. 30 * Implement eina_file_map_lines() on Windows.
28 * Handle NULL in all eina_*_free function. 31 * Handle NULL in all eina_*_free function.
29 * eina_log_console_color_set() 32 * eina_log_console_color_set()
33 * Documentation for eina list specified and eina stringshare fixed.
34 * eina_convert_atofp wrong return value if fp is NULL.
30 35
31Removal: 36Removal:
32 * configure options: --disable-posix-threads, --disable-win32-threads, 37 * configure options: --disable-posix-threads, --disable-win32-threads,
diff --git a/legacy/eina/src/include/eina_list.h b/legacy/eina/src/include/eina_list.h
index a0540c8f61..a81f57b801 100644
--- a/legacy/eina/src/include/eina_list.h
+++ b/legacy/eina/src/include/eina_list.h
@@ -954,8 +954,8 @@ EAPI Eina_List *eina_list_merge(Eina_List *left, Eina_List *right) EI
954 * smallest one to be head of the returned list. It will continue this process 954 * smallest one to be head of the returned list. It will continue this process
955 * for all entry of both list. 955 * for all entry of both list.
956 * 956 *
957 * Both left and right do not exist anymore after the merge. 957 * Both left and right lists are not vailid anymore after the merge and should
958 * If @p func is @c NULL, it will return @c NULL. 958 * not be used. If @p func is @c NULL, it will return @c NULL.
959 * 959 *
960 * Example: 960 * Example:
961 * @code 961 * @code
diff --git a/legacy/eina/src/include/eina_stringshare.h b/legacy/eina/src/include/eina_stringshare.h
index 9a05bcd7e0..21daeaf268 100644
--- a/legacy/eina/src/include/eina_stringshare.h
+++ b/legacy/eina/src/include/eina_stringshare.h
@@ -311,7 +311,7 @@ EAPI void eina_stringshare_del(Eina_Stringshare *str);
311 * @brief Note that the given string @b must be shared. 311 * @brief Note that the given string @b must be shared.
312 * 312 *
313 * @param str the shared string to know the length. It is safe to 313 * @param str the shared string to know the length. It is safe to
314 * give @c NULL, in that case @c -1 is returned. 314 * give @c NULL, in that case @c 0 is returned.
315 * @return The length of a shared string. 315 * @return The length of a shared string.
316 * 316 *
317 * This function is a cheap way to known the length of a shared 317 * This function is a cheap way to known the length of a shared
diff --git a/legacy/eina/src/lib/eina_list.c b/legacy/eina/src/lib/eina_list.c
index ea5dfb9433..7ef219def9 100644
--- a/legacy/eina/src/lib/eina_list.c
+++ b/legacy/eina/src/lib/eina_list.c
@@ -1466,6 +1466,8 @@ eina_list_accessor_new(const Eina_List *list)
1466{ 1466{
1467 Eina_Accessor_List *ac; 1467 Eina_Accessor_List *ac;
1468 1468
1469 EINA_SAFETY_ON_NULL_RETURN_VAL(list, NULL);
1470
1469 eina_error_set(0); 1471 eina_error_set(0);
1470 ac = calloc(1, sizeof (Eina_Accessor_List)); 1472 ac = calloc(1, sizeof (Eina_Accessor_List));
1471 if (!ac) 1473 if (!ac)
diff --git a/legacy/eina/src/lib/eina_quadtree.c b/legacy/eina/src/lib/eina_quadtree.c
index f0a2dd466c..e163e6fe7a 100644
--- a/legacy/eina/src/lib/eina_quadtree.c
+++ b/legacy/eina/src/lib/eina_quadtree.c
@@ -875,6 +875,8 @@ eina_quadtree_increase(Eina_QuadTree_Item *object)
875{ 875{
876 size_t tmp; 876 size_t tmp;
877 877
878 EINA_MAGIC_CHECK_QUADTREE_ITEM(object);
879
878 tmp = object->quad->index++; 880 tmp = object->quad->index++;
879 if (object->index == tmp) 881 if (object->index == tmp)
880 return; 882 return;
diff --git a/legacy/eina/src/lib/eina_rectangle.c b/legacy/eina/src/lib/eina_rectangle.c
index cfa5ac295c..85cf310c2a 100644
--- a/legacy/eina/src/lib/eina_rectangle.c
+++ b/legacy/eina/src/lib/eina_rectangle.c
@@ -361,6 +361,9 @@ eina_rectangle_pool_new(int w, int h)
361{ 361{
362 Eina_Rectangle_Pool *new; 362 Eina_Rectangle_Pool *new;
363 363
364 if ((w <= 0) || (h <= 0))
365 return NULL;
366
364 new = malloc(sizeof (Eina_Rectangle_Pool)); 367 new = malloc(sizeof (Eina_Rectangle_Pool));
365 if (!new) 368 if (!new)
366 return NULL; 369 return NULL;
diff --git a/legacy/eina/src/lib/eina_str.c b/legacy/eina/src/lib/eina_str.c
index 2a54c00c78..9a1a369c3f 100644
--- a/legacy/eina/src/lib/eina_str.c
+++ b/legacy/eina/src/lib/eina_str.c
@@ -544,6 +544,9 @@ eina_str_escape(const char *str)
544 char *s2, *d; 544 char *s2, *d;
545 const char *s; 545 const char *s;
546 546
547 if (!str)
548 return NULL;
549
547 s2 = malloc((strlen(str) * 2) + 1); 550 s2 = malloc((strlen(str) * 2) + 1);
548 if (!s2) 551 if (!s2)
549 return NULL; 552 return NULL;
diff --git a/legacy/eina/src/lib/eina_tiler.c b/legacy/eina/src/lib/eina_tiler.c
index 155b0e0037..b436ba6583 100644
--- a/legacy/eina/src/lib/eina_tiler.c
+++ b/legacy/eina/src/lib/eina_tiler.c
@@ -1115,6 +1115,9 @@ EAPI Eina_Tiler *eina_tiler_new(int w, int h)
1115{ 1115{
1116 Eina_Tiler *t; 1116 Eina_Tiler *t;
1117 1117
1118 if ((w <= 0) || (h <= 0))
1119 return NULL;
1120
1118 t = calloc(1, sizeof(Eina_Tiler)); 1121 t = calloc(1, sizeof(Eina_Tiler));
1119 t->area.w = w; 1122 t->area.w = w;
1120 t->area.h = h; 1123 t->area.h = h;
@@ -1151,6 +1154,8 @@ EAPI Eina_Bool eina_tiler_rect_add(Eina_Tiler *t, const Eina_Rectangle *r)
1151 Eina_Rectangle tmp; 1154 Eina_Rectangle tmp;
1152 1155
1153 EINA_MAGIC_CHECK_TILER(t, EINA_FALSE); 1156 EINA_MAGIC_CHECK_TILER(t, EINA_FALSE);
1157 EINA_SAFETY_ON_NULL_RETURN_VAL(r, EINA_FALSE);
1158
1154 if ((r->w <= 0) || (r->h <= 0)) 1159 if ((r->w <= 0) || (r->h <= 0))
1155 return EINA_FALSE; 1160 return EINA_FALSE;
1156 1161
@@ -1169,6 +1174,8 @@ EAPI void eina_tiler_rect_del(Eina_Tiler *t, const Eina_Rectangle *r)
1169 Eina_Rectangle tmp; 1174 Eina_Rectangle tmp;
1170 1175
1171 EINA_MAGIC_CHECK_TILER(t); 1176 EINA_MAGIC_CHECK_TILER(t);
1177 EINA_SAFETY_ON_NULL_RETURN(r);
1178
1172 if ((r->w <= 0) || (r->h <= 0)) 1179 if ((r->w <= 0) || (r->h <= 0))
1173 return; 1180 return;
1174 1181
@@ -1260,6 +1267,10 @@ eina_tile_grid_slicer_iterator_new(int x,
1260{ 1267{
1261 Eina_Tile_Grid_Slicer_Iterator *it; 1268 Eina_Tile_Grid_Slicer_Iterator *it;
1262 1269
1270 if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) ||
1271 (tile_w <= 0) || (tile_h <= 0))
1272 return NULL;
1273
1263 it = calloc(1, sizeof(*it)); 1274 it = calloc(1, sizeof(*it));
1264 if (!it) 1275 if (!it)
1265 { 1276 {