From fb9518d66fba4e05a34f3e04bbfecdff5b24e79f Mon Sep 17 00:00:00 2001 From: Junseok Kim Date: Fri, 14 Oct 2022 16:46:39 +0900 Subject: [PATCH] e_pixmap: changed eina_safety to if clause to reduce error log Change-Id: I5f78bda6bc244ec69eef254ede83c2d8db75a603 --- src/bin/e_pixmap.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index 63ec037005..00bda169b8 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -598,7 +598,7 @@ e_pixmap_find_client_by_res_id(uint32_t res_id) E_API uint32_t e_pixmap_res_id_get(E_Pixmap *cp) { - EINA_SAFETY_ON_NULL_RETURN_VAL(cp, 0); + if (!cp) return 0; return cp->res_id; } @@ -714,9 +714,23 @@ e_pixmap_image_refresh(E_Pixmap *cp) struct wl_shm_buffer *shm_buffer = NULL; int bw, bh; - EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE); - EINA_SAFETY_ON_TRUE_RETURN_VAL(cp->dirty, EINA_FALSE); - EINA_SAFETY_ON_FALSE_RETURN_VAL(cp->type == E_PIXMAP_TYPE_WL, EINA_FALSE); + if (!cp) + { + ELOGF("PIXMAP", "cp is NULL", NULL); + return EINA_FALSE; + } + + if (cp->dirty) + { + ELOGF("PIXMAP", "cp->dirty is set, cp:%p", NULL, cp); + return EINA_FALSE; + } + + if (cp->type != E_PIXMAP_TYPE_WL) + { + ELOGF("PIXMAP", "cp->type is not E_PIXMAP_TYPE_WL, cp:%p, cp->type:%d", NULL, cp, cp->type); + return EINA_FALSE; + } buffer = cp->buffer; if (!buffer) return EINA_FALSE; -- 2.34.1