From: Hwankyu Jhun Date: Fri, 25 Mar 2016 12:48:38 +0000 (+0900) Subject: Adjust coding rules X-Git-Tag: submit/tizen/20160405.001024^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f23e0188ab8db88c7d98391f1e4b451a8cd02951;p=platform%2Fcore%2Fappfw%2Fappcore-widget.git Adjust coding rules Change-Id: Id7b804be392640d7459a91019e180f08a83f1a52 Signed-off-by: Hwankyu Jhun --- diff --git a/doc/appcore-widget_doc.h b/doc/appcore-widget_doc.h index e9fe5a5..1a83d63 100755 --- a/doc/appcore-widget_doc.h +++ b/doc/appcore-widget_doc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/include/widget_app.h b/include/widget_app.h index 67b6457..3c935cd 100755 --- a/include/widget_app.h +++ b/include/widget_app.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -51,13 +51,13 @@ typedef enum widget_app_destroy_type { * @brief The handle for widget class. * @since_tizen 2.3.1 */ -typedef struct _widget_class* widget_class_h; +typedef struct _widget_class *widget_class_h; /** * @brief The handle for widget context. * @since_tizen 2.3.1 */ -typedef struct _widget_context* widget_context_h; +typedef struct _widget_context *widget_context_h; /** * @brief Called when the widget instance starts. @@ -164,8 +164,7 @@ typedef int (*widget_instance_update_cb)(widget_context_h context, bundle *conte * @brief The structure for lifecycle of a widget instance. * @since_tizen 2.3.1 */ -typedef struct -{ +typedef struct { widget_instance_create_cb create; /**< The callback function is called after widget instance is created. */ widget_instance_destroy_cb destroy; /**< The callback function is called before widget instance is destroyed. */ widget_instance_pause_cb pause; /**< The callback function is called when the widget is invisible. */ @@ -213,8 +212,7 @@ typedef void (*widget_app_terminate_cb)(void *user_data); * @brief The structure for lifecycle of a widget application. * @since_tizen 2.3.1 */ -typedef struct -{ +typedef struct { widget_app_create_cb create; /**< The callback function is called before the main loop of the application starts. */ widget_app_terminate_cb terminate; /**< This callback function is called once after the main loop of the application exits. */ } widget_app_lifecycle_callback_s; @@ -321,7 +319,7 @@ int widget_app_foreach_context(widget_context_cb callback, void *data); * @see watch_app_remove_event_handler() */ int widget_app_add_event_handler(app_event_handler_h *event_handler, app_event_type_e event_type, - app_event_cb callback, void *user_data); + app_event_cb callback, void *user_data); /** * @brief Removes registered event handler. @@ -352,7 +350,7 @@ int widget_app_remove_event_handler(app_event_handler_h event_handler); * @remark You must not free returned Widget ID * @see get_last_result() */ -const char* widget_app_get_id(widget_context_h context); +const char *widget_app_get_id(widget_context_h context); /** * @brief Makes a class for widget instances. @@ -456,3 +454,4 @@ widget_class_h widget_app_class_add(widget_class_h widget_class, const char *cla #endif #endif /* __TIZEN_APPFW_WIDGET_APP_H__ */ + diff --git a/include/widget_app_efl.h b/include/widget_app_efl.h index 4bd1765..fd1a0c0 100644 --- a/include/widget_app_efl.h +++ b/include/widget_app_efl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -52,4 +52,5 @@ int widget_app_get_elm_win(widget_context_h context, Evas_Object **win); } #endif -#endif +#endif /* __TIZEN_APPFW_WIDGET_APP_EFL_H__ */ + diff --git a/include/widget_app_internal.h b/include/widget_app_internal.h index 260f4f3..024cfa9 100644 --- a/include/widget_app_internal.h +++ b/include/widget_app_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -27,18 +27,14 @@ extern "C" { * For in-house applications * */ - -typedef struct -{ - struct __pointer - { +typedef struct { + struct __pointer { double x; double y; int down; } pointer; - struct __part - { + struct __part { double sx; double sy; double ex; @@ -47,28 +43,27 @@ typedef struct } widget_obj_event_info_s; -typedef int (*widget_instance_text_signal_cb)(widget_context_h context, const char *signal_name, - const char *source, widget_obj_event_info_s *info, void *user_data); +typedef int (*widget_instance_text_signal_cb)(widget_context_h context, + const char *signal_name, const char *source, + widget_obj_event_info_s *info, void *user_data); -typedef struct _widget_obj_private_ops -{ +typedef struct _widget_obj_private_ops { widget_instance_text_signal_cb text_signal; } widget_obj_private_ops_s; typedef struct _widget_class_factory_full widget_class_factory_full_s; -typedef const widget_class_factory_full_s* (*widget_class_factory_override_text_signal)(widget_instance_text_signal_cb op); - +typedef const widget_class_factory_full_s *(*widget_class_factory_override_text_signal)(widget_instance_text_signal_cb op); typedef widget_class_h (*_widget_class_factory_operation_make)(widget_instance_lifecycle_callback_s callback); -struct _widget_class_factory_full -{ +struct _widget_class_factory_full { widget_class_factory_override_text_signal override_text_signal; }; -const widget_class_factory_full_s* widget_app_get_class_factory(void); +const widget_class_factory_full_s *widget_app_get_class_factory(void); #ifdef __cplusplus } #endif -#endif +#endif /* __TIZEN_APPFW_WIDGET_APP_INTERNAL_H__ */ + diff --git a/src/widget-i18n.c b/src/widget-i18n.c index 23cbd3b..91804e2 100755 --- a/src/widget-i18n.c +++ b/src/widget-i18n.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -33,18 +33,17 @@ void _update_lang(void) { + char *r; char *lang = vconf_get_str(VCONFKEY_LANGSET); if (lang) { setenv("LANG", lang, 1); setenv("LC_MESSAGES", lang, 1); - char *r = setlocale(LC_ALL, ""); + r = setlocale(LC_ALL, ""); if (r == NULL) { r = setlocale(LC_ALL, lang); - if (r) _D("*****appcore setlocale=%s\n", r); - } free(lang); } else { @@ -70,8 +69,8 @@ void _update_region(void) setenv("LC_TELEPHONE", region, 1); setenv("LC_MEASUREMENT", region, 1); setenv("LC_IDENTIFICATION", region, 1); - r = setlocale(LC_ALL, ""); + r = setlocale(LC_ALL, ""); if (r != NULL) _D("*****appcore setlocale=%s\n", r); @@ -85,6 +84,7 @@ static int __set_i18n(const char *domain) { char *r; char dirname[PATH_MAX] = {0, }; + char *lang; if (domain == NULL) { errno = EINVAL; @@ -97,15 +97,13 @@ static int __set_i18n(const char *domain) r = setlocale(LC_ALL, ""); /* if locale is not set properly, try again to set as language base */ if (r == NULL) { - char *lang = vconf_get_str(VCONFKEY_LANGSET); + lang = vconf_get_str(VCONFKEY_LANGSET); r = setlocale(LC_ALL, lang); - if (r) _D("*****appcore setlocale=%s\n", r); if (lang) free(lang); - } if (r == NULL) _E("appcore: setlocale() error"); diff --git a/src/widget-log.h b/src/widget-log.h index e8eb56d..980f3e3 100755 --- a/src/widget-log.h +++ b/src/widget-log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -45,37 +45,39 @@ #define _W(...) LOGW(__VA_ARGS__) #endif -#define _warn_if(expr, fmt, arg...) do { \ - if (expr) { \ - _ERR(fmt, ##arg); \ - } \ - } while (0) - -#define _ret_if(expr) do { \ - if (expr) { \ - return; \ - } \ - } while (0) - -#define _retv_if(expr, val) do { \ - if (expr) { \ - return (val); \ - } \ - } while (0) - -#define _retm_if(expr, fmt, arg...) do { \ - if (expr) { \ - _ERR(fmt, ##arg); \ - return; \ - } \ - } while (0) - -#define _retvm_if(expr, val, fmt, arg...) do { \ - if (expr) { \ - _ERR(fmt, ##arg); \ - return (val); \ - } \ - } while (0) - - -#endif //__APPFW_WIDGET_LOG_H_ +#define _warn_if(expr, fmt, arg...) \ + do { \ + if (expr) \ + _ERR(fmt, ##arg); \ + } while (0) + +#define _ret_if(expr) \ + do { \ + if (expr) \ + return; \ + } while (0) + +#define _retv_if(expr, val) \ + do { \ + if (expr) \ + return (val); \ + } while (0) + +#define _retm_if(expr, fmt, arg...) \ + do { \ + if (expr) { \ + _ERR(fmt, ##arg); \ + return; \ + } \ + } while (0) + +#define _retvm_if(expr, val, fmt, arg...) \ + do { \ + if (expr) { \ + _ERR(fmt, ##arg); \ + return (val); \ + } \ + } while (0) + +#endif /* __APPFW_WIDGET_LOG_H_ */ + diff --git a/src/widget-private.h b/src/widget-private.h index 662b734..ef6d32c 100644 --- a/src/widget-private.h +++ b/src/widget-private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -24,10 +24,11 @@ #define FEATURE_SHELL_APPWIDGET "http://tizen.org/feature/shell.appwidget" - int _set_i18n(const char *domainname); void _update_lang(void); void _update_region(void); -int widget_app_error(widget_error_e error, const char* function, const char *description); +int widget_app_error(widget_error_e error, const char *function, + const char *description); #endif /* __APPCORE_WIDGET_PRIVATE_H__ */ + diff --git a/src/widget_app.c b/src/widget_app.c index f515704..82f1f89 100755 --- a/src/widget_app.c +++ b/src/widget_app.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -117,14 +117,14 @@ static inline bool _is_widget_feature_enabled(void) static gint __comp_by_id(gconstpointer a, gconstpointer b) { - widget_context_s *wc = (widget_context_s*)a; + widget_context_s *wc = (widget_context_s *)a; - return strcmp(wc->id, (const char*)b); + return strcmp(wc->id, (const char *)b); } -static widget_context_s* __find_context_by_id(const char *id) +static widget_context_s *__find_context_by_id(const char *id) { - GList* ret = g_list_find_custom(contexts, id, __comp_by_id); + GList *ret = g_list_find_custom(contexts, id, __comp_by_id); if (ret == NULL) return NULL; @@ -183,21 +183,25 @@ static int __instance_create(widget_class_h handle, const char *id, bundle *b) contexts = g_list_append(contexts, wc); handle->ops.create(wc, b, w, h, handle->user_data); - ret = __send_update_status(handle->classid, wc->id, WIDGET_INSTANCE_EVENT_CREATE, b, 0); + ret = __send_update_status(handle->classid, wc->id, + WIDGET_INSTANCE_EVENT_CREATE, b, 0); return ret; } -static int __instance_destroy(widget_class_h handle, const char *id, widget_destroy_type_e reason, bundle *b) +static int __instance_destroy(widget_class_h handle, const char *id, + widget_destroy_type_e reason, bundle *b) { widget_context_s *wc = __find_context_by_id(id); int ret = 0; if (wc) { wc->state = WC_TERMINATED; - handle->ops.destroy(wc, (widget_app_destroy_type_e)reason, b, handle->user_data); + handle->ops.destroy(wc, (widget_app_destroy_type_e)reason, b, + handle->user_data); - ret = __send_update_status(handle->classid, id, WIDGET_INSTANCE_EVENT_TERMINATE, b, 0); + ret = __send_update_status(handle->classid, id, + WIDGET_INSTANCE_EVENT_TERMINATE, b, 0); contexts = g_list_remove(contexts, wc); @@ -212,7 +216,8 @@ static int __instance_destroy(widget_class_h handle, const char *id, widget_dest return ret; } -static widget_class_h __find_class_handler(const char *class_id, widget_class_h handle) +static widget_class_h __find_class_handler(const char *class_id, + widget_class_h handle) { if (!class_id || !handle) return NULL; @@ -267,7 +272,8 @@ static void __control(bundle *b) } else if (strcmp(operation, "destroy") == 0) { bundle_get_str(b, WIDGET_K_REASON, &reason); if (reason) - destroy_type = (int)g_ascii_strtoll(reason, &remain, 10); + destroy_type = (int)g_ascii_strtoll(reason, &remain, + 10); __instance_destroy(handle, id, destroy_type, b); } else if (strcmp(operation, "resume") == 0) { @@ -296,9 +302,10 @@ static int __aul_handler(aul_type type, bundle *b, void *data) case AUL_START: if (b) { bundle_get_str(b, WIDGET_K_CALLER, &caller); - if (caller) - caller_pid = g_ascii_strtoll(caller, &remain, 10); - else { + if (caller) { + caller_pid = g_ascii_strtoll(caller, &remain, + 10); + } else { /* using caller appid and query pid using caller appid? */ _E("no caller pid"); } @@ -359,14 +366,16 @@ static int __before_loop(int argc, char **argv) r = aul_launch_init(__aul_handler, NULL); if (r < 0) { - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, - "Fail to call the aul_launch_init"); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, + "Fail to call the aul_launch_init"); } r = aul_launch_argv_handler(argc, argv); if (r < 0) { - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, - "Fail to call the aul_launch_argv_handler"); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, + "Fail to call the aul_launch_argv_handler"); } r = app_get_id(&appid); @@ -375,8 +384,8 @@ static int __before_loop(int argc, char **argv) class_provider = app_ops->create(app_user_data); if (class_provider == NULL) { - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, - "widget_class is NULL"); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, "widget_class is NULL"); } return WIDGET_ERROR_NONE; @@ -394,7 +403,7 @@ static void __after_loop() } EXPORT_API int widget_app_main(int argc, char **argv, - widget_app_lifecycle_callback_s *callback, void *user_data) + widget_app_lifecycle_callback_s *callback, void *user_data) { int r; @@ -404,10 +413,14 @@ EXPORT_API int widget_app_main(int argc, char **argv, } if (argc <= 0 || argv == NULL || callback == NULL) - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, NULL); if (callback->create == NULL) - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, "widget_app_create_cb() callback must be registered"); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, + "widget_app_create_cb() callback must be " + "registered"); app_ops = callback; app_user_data = user_data; @@ -467,7 +480,8 @@ EXPORT_API int widget_app_terminate_context(widget_context_h context) } if (context == NULL) - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, NULL); g_idle_add(__finish_event_cb, context); return WIDGET_ERROR_NONE; @@ -487,8 +501,8 @@ EXPORT_API int widget_app_foreach_context(widget_context_cb cb, void *data) } EXPORT_API int widget_app_add_event_handler(app_event_handler_h *event_handler, - app_event_type_e event_type, app_event_cb callback, - void *user_data) + app_event_type_e event_type, app_event_cb callback, + void *user_data) { if (!_is_widget_feature_enabled()) { _E("not supported"); @@ -530,7 +544,7 @@ EXPORT_API int widget_app_remove_event_handler(app_event_handler_h return WIDGET_ERROR_NONE; } -EXPORT_API const char* widget_app_get_id(widget_context_h context) +EXPORT_API const char *widget_app_get_id(widget_context_h context) { if (!_is_widget_feature_enabled()) { _E("not supported"); @@ -549,7 +563,7 @@ EXPORT_API const char* widget_app_get_id(widget_context_h context) EXPORT_API int widget_app_get_elm_win(widget_context_h context, Evas_Object **win) { - widget_context_s *cxt = (widget_context_s*)context; + widget_context_s *cxt = (widget_context_s *)context; Evas_Object *ret_win; Ecore_Wl_Window *wl_win; @@ -559,7 +573,8 @@ EXPORT_API int widget_app_get_elm_win(widget_context_h context, } if (context == NULL || win == NULL) - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, NULL); ret_win = elm_win_add(NULL, cxt->id, ELM_WIN_BASIC); if (ret_win == NULL) { @@ -619,13 +634,16 @@ widget_class_h _widget_class_create(widget_class_s *prev, const char *class_id, return wc; } -EXPORT_API widget_class_h widget_app_class_add(widget_class_h widget_class, const char *class_id, +EXPORT_API widget_class_h widget_app_class_add(widget_class_h widget_class, + const char *class_id, widget_instance_lifecycle_callback_s callback, void *user_data) { - return _widget_class_create(widget_class, class_id, callback, user_data); + return _widget_class_create(widget_class, class_id, callback, + user_data); } -EXPORT_API widget_class_h widget_app_class_create(widget_instance_lifecycle_callback_s callback, void *user_data) +EXPORT_API widget_class_h widget_app_class_create( + widget_instance_lifecycle_callback_s callback, void *user_data) { return _widget_class_create(class_provider, appid, callback, user_data); } @@ -638,7 +656,8 @@ EXPORT_API int widget_app_context_set_tag(widget_context_h context, void *tag) } if (context == NULL) - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, NULL); context->tag = tag; @@ -653,14 +672,16 @@ EXPORT_API int widget_app_context_get_tag(widget_context_h context, void **tag) } if (context == NULL || tag == NULL) - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, NULL); *tag = context->tag; return WIDGET_ERROR_NONE; } -EXPORT_API int widget_app_context_set_content_info(widget_context_h context, bundle *content_info) +EXPORT_API int widget_app_context_set_content_info(widget_context_h context, + bundle *content_info) { const char *class_id = NULL; int ret = 0; @@ -671,27 +692,33 @@ EXPORT_API int widget_app_context_set_content_info(widget_context_h context, bun } if (context == NULL || content_info == NULL) - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, NULL); if (context->provider == NULL) - return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + return widget_app_error(WIDGET_ERROR_INVALID_PARAMETER, + __FUNCTION__, NULL); class_id = context->provider->classid; if (class_id == NULL) return widget_app_error(WIDGET_ERROR_FAULT, __FUNCTION__, NULL); - ret = __send_update_status(class_id, context->id, WIDGET_INSTANCE_EVENT_UPDATE, content_info, true); + ret = __send_update_status(class_id, context->id, + WIDGET_INSTANCE_EVENT_UPDATE, content_info, true); if (ret < 0) { - _E("failed to send content info: %s of %s (%d)", context->id, class_id, ret); - return widget_app_error(WIDGET_ERROR_IO_ERROR, __FUNCTION__, NULL); + _E("failed to send content info: %s of %s (%d)", context->id, + class_id, ret); + return widget_app_error(WIDGET_ERROR_IO_ERROR, __FUNCTION__, + NULL); } return WIDGET_ERROR_NONE; } -EXPORT_API int widget_app_context_set_title(widget_context_h context, const char *title) +EXPORT_API int widget_app_context_set_title(widget_context_h context, + const char *title) { if (!_is_widget_feature_enabled()) { _E("not supported"); diff --git a/src/widget_error.c b/src/widget_error.c index 010adb0..b6a63cc 100755 --- a/src/widget_error.c +++ b/src/widget_error.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -29,68 +29,56 @@ #define LOG_TAG "CAPI_WIDGET_APPLICATIO" -static const char* widget_app_error_to_string(widget_error_e error) +static const char *widget_app_error_to_string(widget_error_e error) { switch (error) { case WIDGET_ERROR_NONE: return "NONE"; - case WIDGET_ERROR_INVALID_PARAMETER: return "INVALID_PARAMETER"; - case WIDGET_ERROR_OUT_OF_MEMORY: return "OUT_OF_MEMORY"; - case WIDGET_ERROR_RESOURCE_BUSY: return "RESOURCE_BUSY"; - case WIDGET_ERROR_PERMISSION_DENIED: return "PERMISSION_DENIED"; - case WIDGET_ERROR_CANCELED: return "CANCELED"; - case WIDGET_ERROR_IO_ERROR: return "IO_ERROR"; - case WIDGET_ERROR_TIMED_OUT: return "TIMED_OUT"; - case WIDGET_ERROR_NOT_SUPPORTED: return "NOT_SUPPORTED"; - case WIDGET_ERROR_FILE_NO_SPACE_ON_DEVICE: return "FILE_NO_SPACE_ON_DEVICE"; - case WIDGET_ERROR_FAULT: return "FAULT"; - case WIDGET_ERROR_ALREADY_EXIST: return "ALREADY_EXIST"; - case WIDGET_ERROR_ALREADY_STARTED: return "ALREADY_STARTED"; - case WIDGET_ERROR_NOT_EXIST: return "NOT_EXIST"; - case WIDGET_ERROR_DISABLED: return "DISABLED"; - default: return "UNKNOWN"; } } -int widget_app_error(widget_error_e error, const char* function, - const char *description) +int widget_app_error(widget_error_e error, const char *function, + const char *description) { if (description) { - LOGE("[%s] %s(0x%08x) : %s", function, widget_app_error_to_string(error), error, - description); + LOGE("[%s] %s(0x%08x) : %s", function, + widget_app_error_to_string(error), error, + description); } else { - LOGE("[%s] %s(0x%08x)", function, widget_app_error_to_string(error), error); + LOGE("[%s] %s(0x%08x)", function, + widget_app_error_to_string(error), error); } return error; } +