From 3e230693e62696f32bc8ab64619843f2507ed393 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 26 Jan 2018 14:29:03 -0600 Subject: [PATCH] eina_module: Drop ridiculous ERR messages from module_list_load/unload The documentation for these functions claims that passing a NULL array results in doing nothing - that should also include logging nothing. EINA_SAFETY_ON_NULL_RETURN() logs an ERR message and should be reserved for usage when NULL is not actually a valid state. Additionally, it's entirely possible to turn off EINA_SAFETY_CHECKS, at which point these functions would stop behaving as the documentation says they do. Not great. --- src/lib/eina/eina_module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c index 493e1a59ff..58f79b5fb6 100644 --- a/src/lib/eina/eina_module.c +++ b/src/lib/eina/eina_module.c @@ -565,7 +565,7 @@ EAPI void eina_module_list_load(Eina_Array *array) Eina_Module *m; unsigned int i; - EINA_SAFETY_ON_NULL_RETURN(array); + if (!array) return; DBG("array %p, count %u", array, array->count); EINA_ARRAY_ITER_NEXT(array, i, m, iterator) { @@ -580,7 +580,7 @@ EAPI void eina_module_list_unload(Eina_Array *array) Eina_Module *m; unsigned int i; - EINA_SAFETY_ON_NULL_RETURN(array); + if (!array) return; DBG("array %p, count %u", array, array->count); EINA_ARRAY_ITER_NEXT(array, i, m, iterator) eina_module_unload(m);