From 78b1021253c7db0c570be83098c907795b33eb92 Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Fri, 8 Mar 2024 18:20:16 +0900 Subject: [PATCH] Fix lcov pair error New lcov version do not allow start stop comment pair error. It makes lcov generating failed. Change-Id: Ie4b29ca4d6687d512231137e25794275ebfd9cc0 Signed-off-by: Junkyeong Kim --- src/tbm_bo.c | 2 ++ src/tbm_bufmgr.c | 25 ------------------------- src/tbm_dummy_display.c | 2 -- 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/tbm_bo.c b/src/tbm_bo.c index 17abfa3..29fd6bf 100644 --- a/src/tbm_bo.c +++ b/src/tbm_bo.c @@ -53,6 +53,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. } \ } +/* LCOV_EXCL_START */ + char * _tbm_flag_to_str(int f) { diff --git a/src/tbm_bufmgr.c b/src/tbm_bufmgr.c index 78a7189..a069fab 100644 --- a/src/tbm_bufmgr.c +++ b/src/tbm_bufmgr.c @@ -909,22 +909,18 @@ tbm_bufmgr_internal_alloc_bo(tbm_bufmgr bufmgr, int size, int flags) bo = calloc(1, sizeof(struct _tbm_bo)); if (!bo) { - /* LCOV_EXCL_START */ TBM_ERR("memory allocationc failed."); error = TBM_ERROR_OUT_OF_MEMORY; goto failed; - /* LCOV_EXCL_STOP */ } bo->bo_data = tbm_module_alloc_bo_data(bufmgr->module, bo, size, flags, &error); if (!bo->bo_data) { - /* LCOV_EXCL_START */ TBM_ERR("tbm_module_alloc_bo_data failed. size:%d flags:%s error:%d", size, _tbm_flag_to_str(flags), error); free(bo); _tbm_set_last_result(error); _tbm_bufmgr_mutex_unlock(); goto failed; - /* LCOV_EXCL_STOP */ } _tbm_bufmgr_initialize_bo(bufmgr, bo, flags); @@ -936,18 +932,13 @@ tbm_bufmgr_internal_alloc_bo(tbm_bufmgr bufmgr, int size, int flags) return bo; -/* LCOV_EXCL_START */ failed: _tbm_set_last_result(error); _tbm_bufmgr_mutex_unlock(); return NULL; -/* LCOV_EXCL_STOP */ } - -/* LCOV_EXCL_START */ - tbm_bo tbm_bufmgr_internal_alloc_bo_with_format(tbm_bufmgr bufmgr, int format, int bo_idx, int width, int height, int bpp, tbm_bo_memory_type flags, tbm_error_e *error) @@ -962,19 +953,15 @@ tbm_bufmgr_internal_alloc_bo_with_format(tbm_bufmgr bufmgr, int format, int bo_i bo = calloc(1, sizeof(struct _tbm_bo)); if (!bo) { - /* LCOV_EXCL_START */ TBM_ERR("memory allocationc failed."); *error = TBM_ERROR_OUT_OF_MEMORY; goto failed; - /* LCOV_EXCL_STOP */ } bo->bo_data = tbm_module_alloc_bo_data_with_format(bufmgr->module, format, bo_idx, width, height, bpp, flags, error); if (!bo->bo_data) { - /* LCOV_EXCL_START */ free(bo); goto failed; - /* LCOV_EXCL_STOP */ } _tbm_bufmgr_initialize_bo(bufmgr, bo, flags); @@ -983,12 +970,10 @@ tbm_bufmgr_internal_alloc_bo_with_format(tbm_bufmgr bufmgr, int format, int bo_i return bo; -/* LCOV_EXCL_START */ failed: _tbm_bufmgr_mutex_unlock(); return NULL; -/* LCOV_EXCL_STOP */ } tbm_bo @@ -1007,12 +992,10 @@ tbm_bufmgr_internal_alloc_bo_with_bo_data(tbm_bufmgr bufmgr, tbm_bo_data *bo_dat bo = calloc(1, sizeof(struct _tbm_bo)); if (!bo) { - /* LCOV_EXCL_START */ TBM_ERR("memory allocationc failed."); *error = TBM_ERROR_OUT_OF_MEMORY; _tbm_bufmgr_mutex_unlock(); return NULL; - /* LCOV_EXCL_STOP */ } bo->bo_data = bo_data; bo->get_from_surface_data = 1; @@ -1051,19 +1034,15 @@ tbm_bufmgr_internal_import_bo_with_key(tbm_bufmgr bufmgr, unsigned int key) bo = calloc(1, sizeof(struct _tbm_bo)); if (!bo) { - /* LCOV_EXCL_START */ TBM_ERR("memory allocationc failed."); goto failed; - /* LCOV_EXCL_STOP */ } bo->bo_data = tbm_module_import_bo_data_with_key(bufmgr->module, bo, key, &error); if (!bo->bo_data) { - /* LCOV_EXCL_START */ TBM_ERR("tbm_module_import_bo_data_with_key failed. tbm_key:%d", key); free(bo); goto failed; - /* LCOV_EXCL_STOP */ } // return the existed bo2 if bo->bo_data and bo2->bo_data is the same @@ -1118,19 +1097,15 @@ tbm_bufmgr_internal_import_bo_with_fd(tbm_bufmgr bufmgr, tbm_fd fd) bo = calloc(1, sizeof(struct _tbm_bo)); if (!bo) { - /* LCOV_EXCL_START */ TBM_ERR("memory allocationc failed."); goto failed; - /* LCOV_EXCL_STOP */ } bo->bo_data = tbm_module_import_bo_data_with_fd(bufmgr->module, bo, fd, &error); if (!bo->bo_data) { - /* LCOV_EXCL_START */ TBM_ERR("tbm_module_import_bo_data_with_fd failed. tbm_fd:%d", fd); free(bo); goto failed; - /* LCOV_EXCL_STOP */ } // return the existed bo2 if bo->bo_data and bo2->bo_data is the same diff --git a/src/tbm_dummy_display.c b/src/tbm_dummy_display.c index f57fb2a..c5e67f7 100644 --- a/src/tbm_dummy_display.c +++ b/src/tbm_dummy_display.c @@ -97,12 +97,10 @@ tbm_dummy_display_create(void) dpy = calloc(1, sizeof(struct _tbm_dummy_display)); if (!dpy) { - /* LCOV_EXCL_START */ TBM_ERR("fail to allocate struct _tbm_dummy_display."); _tbm_set_last_result(TBM_ERROR_OUT_OF_MEMORY); _tbm_dummy_display_mutex_unlock(); return NULL; - /* LCOV_EXCL_STOP */ } LIST_ADD(&dpy->link, &g_dummy_display_list); -- 2.7.4