From 4f56ce57053b93b4cc9355329e589a17e128685e Mon Sep 17 00:00:00 2001 From: "saerome.kim" Date: Fri, 30 Jun 2017 13:11:41 +0900 Subject: [PATCH] Fix Tizen coding rule errors menu.h:44: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:46: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:50: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:54: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:58: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:61: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:61: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:64: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:68: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:73: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:73: ERROR: [SPC_M_OPR] space required after that ',' (ctx:VxV) menu.h:93: ERROR: [SPC_M_SEP] space prohibited between function name and open parenthesis '(' menu.h:117: ERROR: [SPC_M_SEP] space prohibited between function name and open parenthesis '(' menu.h:118: ERROR: [SPC_M_SEP] space prohibited between function name and open parenthesis '(' menu.h:119: ERROR: [SPC_M_SEP] space prohibited between function name and open parenthesis '(' menu.h:120: ERROR: [SPC_M_SEP] space prohibited between function name and open parenthesis '(' mesh_log.h:32: ERROR: [SPC_M_SEP] space required after that close brace '}' mesh_log.h:33: ERROR: [SPC_M_KWD] space required before the open parenthesis '(' mesh_log.h:41: ERROR: [SPC_M_KWD] space required before the open parenthesis '(' mesh_log.h:48: ERROR: [SPC_M_SEP] space required after that close brace '}' mesh_log.h:49: ERROR: [SPC_M_KWD] space required before the open parenthesis '(' mesh_log.h:57: ERROR: [SPC_M_KWD] space required before the open parenthesis '(' Signed-off-by: saerome.kim --- include/mesh.h | 37 ++++++++++++++++++------------------- include/mesh_log.h | 12 ++++++------ src/mesh_dbus.c | 10 +++++----- test/main.c | 20 ++++++++++---------- test/menu.h | 36 ++++++++++++++++++------------------ 5 files changed, 57 insertions(+), 58 deletions(-) diff --git a/include/mesh.h b/include/mesh.h index 2ae96a8..a827ac2 100644 --- a/include/mesh.h +++ b/include/mesh.h @@ -62,7 +62,6 @@ typedef enum { MESH_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not Supported */ MESH_ERROR_OPERATION_FAILED = TIZEN_ERROR_MESH | 0x01, /**< Operation failed */ MESH_ERROR_OPERATION_ABORTED = TIZEN_ERROR_MESH | 0x02, /**< Operation is aborted */ - MESH_ERROR_ALREADY_INITIALIZED = TIZEN_ERROR_MESH | 0x09 /**< Already Iinitialized */ } mesh_error_e; /** @@ -121,11 +120,11 @@ typedef enum { * @since_tizen 4.0 */ typedef enum { - MESH_EVENT_ENABLED = 0x00, /**< This event is received after enabling mesh network */ - MESH_EVENT_SCAN_DONE = 0x01, /**< This event comes after scanning operation completed */ - MESH_EVENT_CONNECTION_STATE = 0x02, /**< This event takes place when mesh network connection state is changed */ - MESH_EVENT_STATION_JOINED = 0x03, /**< This event takes place when new station joined */ - MESH_EVENT_STATION_LEFT = 0x04, /**< This event takes place when existing station left */ + MESH_MESH_ENABLED_EVENT = 0x00, /**< This event is received after enabling mesh network */ + MESH_SCAN_DONE_EVENT = 0x01, /**< This event comes after scanning operation completed */ + MESH_CONNECTION_STATE_EVENT = 0x02, /**< This event takes place when mesh network connection state is changed */ + MESH_STATION_JOIN_EVENT = 0x03, /**< This event takes place when new station joined */ + MESH_STATION_LEFT_EVENT = 0x04, /**< This event takes place when existing station left */ } mesh_event_e; /** @@ -139,7 +138,7 @@ typedef struct { } mesh_mesh_enabled_event_s; /** - * @brief The structure type for the MESH_EVENT_STATION_JOINED or MESH_EVENT_STATION_LEFT callback data. + * @brief The structure type for the MESH_STATION_JOIN_EVENT or MESH_STATION_LEFT_EVENT callback data. * @details Result of join or left event of other station. * * @since_tizen 4.0 @@ -149,7 +148,7 @@ typedef struct { } mesh_other_station_event_s; /** - * @brief The structure type for the MESH_EVENT_CONNECTION_STATE callback data. + * @brief The structure type for the MESH_CONNECTION_STATE_EVENT callback data. * @details The state of mesh network connection. * * @since_tizen 4.0 @@ -422,7 +421,7 @@ int mesh_network_set_channel(mesh_network_h network, int channel); * * @since_tizen 4.0 * - * @param[in] network The mesh network information handle. + * @param[in] netowrk The mesh network information handle. * @param[out] rssi The received signal strength indicator. * * @return 0 on success, otherwise a negative error value. @@ -584,7 +583,7 @@ int mesh_peer_get_address(mesh_peer_h peer, char **address); * @param[out] handle The mesh handle * @return @c 0 on success, otherwise negative error value * @retval #MESH_ERROR_NONE Successful - * @retval #MESH_ERROR_ALREADY_INITIALIZED Already initialized + * @retval #WIFI_MANAGER_ERROR_ALREADY_INITIALIZED Already initialized * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MESH_ERROR_INVALID_OPERATION Invalid operation * @retval #MESH_ERROR_OPERATION_FAILED Operation failed @@ -597,13 +596,13 @@ int mesh_initialize(mesh_h *handle); /** * @brief Deinitializes Mesh network. * @since_tizen 4.0 - * @param[in] handle The mesh handle + * @param[in] mesh The mesh handle * @return 0 on success, otherwise negative error value - * @retval #MESH_ERROR_NONE Successful - * @retval #MESH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MESH_ERROR_INVALID_OPERATION Invalid operation - * @retval #MESH_ERROR_OPERATION_FAILED Operation failed - * @retval #MESH_ERROR_NOT_SUPPORTED Not supported + * @retval #WIFI_MANAGER_ERROR_NONE Successful + * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation + * @retval #WIFI_MANAGER_ERROR_OPERATION_FAILED Operation failed + * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported */ int mesh_deinitialize(mesh_h handle); @@ -618,7 +617,7 @@ int mesh_deinitialize(mesh_h handle); * @see #MESH_EVENT_ENABLED * @see #MESH_EVENT_SCAN_DONE * @see #MESH_EVENT_STATION_JOINED - * @see #MESH_EVENT_STATION_LEFT + * @see #MESH_EVENT_STATION_DISJOINED * * @param[out] event_type The event identification * @param[out] event parameter data pointer @@ -676,7 +675,7 @@ int mesh_enable(mesh_h handle); /** * @brief disable the mesh service. - * @details All this function to stop mesh service + * @details all this function to stop mesh service * * @since_tizen 4.0 * @@ -901,7 +900,7 @@ int mesh_is_joined(mesh_h handle, bool* is_joined); * @since_tizen 4.0 * * @param[in] handle The mesh handle - * @param[out] network Joined mesh network connection handle. + * @param[in] is_joined The state of mesh network connection. * * * @return 0 on success, otherwise a negative error value. diff --git a/include/mesh_log.h b/include/mesh_log.h index 3006544..2093faa 100644 --- a/include/mesh_log.h +++ b/include/mesh_log.h @@ -29,8 +29,8 @@ if (expr) { \ LOGE("(%s)", #expr); \ return; \ - }\ - } while(0) + } \ + } while (0) #define RETV_IF(expr, val) \ do {\ @@ -38,15 +38,15 @@ LOGE("(%s)", #expr); \ return (val); \ } \ - } while(0) + } while (0) #define RETM_IF(expr, fmt, arg...) \ do {\ if (expr) { \ LOGE(fmt, ##arg); \ return; \ - }\ - } while(0) + } \ + } while (0) #define RETVM_IF(expr, val, fmt, arg...) \ do {\ @@ -54,7 +54,7 @@ LOGE(fmt, ##arg); \ return (val); \ } \ - } while(0) + } while (0) #define ERR_IF(expr) \ do { \ diff --git a/src/mesh_dbus.c b/src/mesh_dbus.c index 09b02fd..0bd95b1 100644 --- a/src/mesh_dbus.c +++ b/src/mesh_dbus.c @@ -305,10 +305,10 @@ static void _mesh_signal_handler(GDBusConnection *connection, RETM_IF(NULL == ev.data.mesh_enable, "Failed to memory allocation !"); ev.data.mesh_enable->result = __convert_service_error_type(result); - h->event_handler(MESH_EVENT_ENABLED, &ev); + h->event_handler(MESH_MESH_ENABLED_EVENT, &ev); free(ev.data.mesh_enable); } else if (0 == g_strcmp0(signal_name, "scan_done")) { - h->event_handler(MESH_EVENT_SCAN_DONE, NULL); + h->event_handler(MESH_SCAN_DONE_EVENT, NULL); } else if (0 == g_strcmp0(signal_name, "connection_state")) { char *mesh_id = NULL; char *bssid = NULL; @@ -328,7 +328,7 @@ static void _mesh_signal_handler(GDBusConnection *connection, ev.data.connection_state->security = (mesh_security_type_e)security; ev.data.connection_state->state = (mesh_connection_state_e)state; - h->event_handler(MESH_EVENT_CONNECTION_STATE, &ev); + h->event_handler(MESH_CONNECTION_STATE_EVENT, &ev); free(ev.data.connection_state); } else if (0 == g_strcmp0(signal_name, "sta_joined")) { char *bssid = NULL; @@ -337,7 +337,7 @@ static void _mesh_signal_handler(GDBusConnection *connection, RETM_IF(NULL == ev.data.sta_info, "Failed to memory allocation !"); g_variant_get(parameters, "(s)", &bssid); memcpy(ev.data.sta_info->bssid, bssid, MAX_BSSID_LEN); - h->event_handler(MESH_EVENT_STATION_JOINED, &ev); + h->event_handler(MESH_STATION_JOIN_EVENT, &ev); free(ev.data.sta_info); } else if (0 == g_strcmp0(signal_name, "sta_left")) { char *bssid = NULL; @@ -346,7 +346,7 @@ static void _mesh_signal_handler(GDBusConnection *connection, RETM_IF(NULL == ev.data.sta_info, "Failed to memory allocation !"); g_variant_get(parameters, "(s)", &bssid); memcpy(ev.data.sta_info->bssid, bssid, MAX_BSSID_LEN); - h->event_handler(MESH_EVENT_STATION_LEFT, &ev); + h->event_handler(MESH_STATION_LEFT_EVENT, &ev); free(ev.data.sta_info); } } diff --git a/test/main.c b/test/main.c index a28ffa5..f6256fc 100644 --- a/test/main.c +++ b/test/main.c @@ -62,11 +62,11 @@ static const char* _mesh_event_to_string(mesh_event_e e) { switch (e) { /* CHECK: List all enum values here */ - CASE_TO_STR(MESH_EVENT_ENABLED) - CASE_TO_STR(MESH_EVENT_SCAN_DONE) - CASE_TO_STR(MESH_EVENT_CONNECTION_STATE) - CASE_TO_STR(MESH_EVENT_STATION_JOINED) - CASE_TO_STR(MESH_EVENT_STATION_LEFT) + CASE_TO_STR(MESH_MESH_ENABLED_EVENT) + CASE_TO_STR(MESH_SCAN_DONE_EVENT) + CASE_TO_STR(MESH_CONNECTION_STATE_EVENT) + CASE_TO_STR(MESH_STATION_JOIN_EVENT) + CASE_TO_STR(MESH_STATION_LEFT_EVENT) default : return "MESH_EVENT_UNKNOWN"; } @@ -91,13 +91,13 @@ void event_cb(mesh_event_e event_type, mesh_event_data_s* event) msgp("Event received [%s]", _mesh_event_to_string(event_type)); switch (event_type) { - case MESH_EVENT_ENABLED: { + case MESH_MESH_ENABLED_EVENT: { msgp(" Mesh Network Enabled Result = %d", event->data.mesh_enable->result); } break; - case MESH_EVENT_SCAN_DONE: { + case MESH_SCAN_DONE_EVENT: { msgp(" Mesh Scan Done"); } break; - case MESH_EVENT_CONNECTION_STATE:{ + case MESH_CONNECTION_STATE_EVENT:{ msgp(" Connection state changed [%s]", _mesh_connection_event_to_string(event->data.connection_state->state)); msgp(" From Mesh ID[%-10s] BSSID[%s] Channel[%d] Security[%4s]", @@ -106,10 +106,10 @@ void event_cb(mesh_event_e event_type, mesh_event_data_s* event) event->data.connection_state->channel, (MESH_SECURITY_SAE == event->data.connection_state->security) ? "SAE" : "NONE"); } break; - case MESH_EVENT_STATION_JOINED: { + case MESH_STATION_JOIN_EVENT: { msgp(" New Station Joined = %s", event->data.sta_info->bssid); } break; - case MESH_EVENT_STATION_LEFT: { + case MESH_STATION_LEFT_EVENT: { msgp(" A Station Left = %s", event->data.sta_info->bssid); } break; default: diff --git a/test/menu.h b/test/menu.h index dbcd195..5959d55 100644 --- a/test/menu.h +++ b/test/menu.h @@ -41,36 +41,36 @@ __BEGIN_DECLS #define ANSI_COLOR_WHITE "\e[1;37m" -#define msg(fmt,args...) do { fprintf(stdout, fmt "\n", ##args); \ +#define msg(fmt, args...) do { fprintf(stdout, fmt "\n", ##args); \ fflush(stdout); } while (0) -#define msgn(fmt,args...) do { fprintf(stdout, fmt, ##args); \ +#define msgn(fmt, args...) do { fprintf(stdout, fmt, ##args); \ fflush(stdout); } while (0) /* Bold (red) */ -#define msgr(fmt,args...) do { fprintf(stdout, ANSI_COLOR_RED fmt \ +#define msgr(fmt, args...) do { fprintf(stdout, ANSI_COLOR_RED fmt \ ANSI_COLOR_NORMAL "\n", ##args); fflush(stdout); } while (0) /* Bold (green) */ -#define msgb(fmt,args...) do { fprintf(stdout, ANSI_COLOR_LIGHTGREEN fmt \ +#define msgb(fmt, args...) do { fprintf(stdout, ANSI_COLOR_LIGHTGREEN fmt \ ANSI_COLOR_NORMAL "\n", ##args); fflush(stdout); } while (0) /* Property message */ -#define msgp(fmt,args...) do { fprintf(stdout, ANSI_COLOR_LIGHTMAGENTA fmt \ +#define msgp(fmt, args...) do { fprintf(stdout, ANSI_COLOR_LIGHTMAGENTA fmt \ ANSI_COLOR_NORMAL "\n", ##args); fflush(stdout); } while (0) -#define msgt(n,fmt,args...) do { fprintf(stdout, "\e[%dC" fmt "\n", \ +#define msgt(n, fmt, args...) do { fprintf(stdout, "\e[%dC" fmt "\n", \ 3 + ((n) * 2), ##args); fflush(stdout); } while (0) -#define pmsg(fmt,args...) do { \ +#define pmsg(fmt, args...) do { \ if (is_pid_show()) { fprintf(stdout, "(%5d) ", get_tid()); } \ fprintf(stdout, fmt "\n", ##args); fflush(stdout); } while (0) -#define pmsgb(fmt,args...) do { \ +#define pmsgb(fmt, args...) do { \ if (is_pid_show()) { fprintf(stdout, "(%5d) ", get_tid()); } \ fprintf(stdout, ANSI_COLOR_LIGHTGREEN fmt \ ANSI_COLOR_NORMAL "\n", ##args); fflush(stdout); } while (0) -#define pmsgt(n,fmt,args...) do { \ +#define pmsgt(n, fmt, args...) do { \ if (is_pid_show()) { fprintf(stdout, "(%5d) ", get_tid()); } \ fprintf(stdout, "\e[%dC" fmt "\n", \ 3 + ((n) * 2), ##args); fflush(stdout); } while (0) @@ -90,7 +90,7 @@ __BEGIN_DECLS #define HR_SINGLE2 " ---------------------------------------" \ "------------------------ " -#define MAX_WIDTH strlen (HR_SINGLE) +#define MAX_WIDTH strlen(HR_SINGLE) #define MAX_TITLE ((MAX_WIDTH) - 10) #define POS_MORE ((MAX_WIDTH) - 3) #define RET_SUCCESS 0 @@ -107,18 +107,18 @@ struct menu_data { }; MManager* menu_manager_new(struct menu_data items[], GMainLoop *mainloop); -int menu_manager_run(MManager *mm); -int menu_manager_set_user_data(MManager *mm, void *user_data); -void* menu_manager_ref_user_data(MManager *mm); +int menu_manager_run(MManager *mm); +int menu_manager_set_user_data(MManager *mm, void *user_data); +void* menu_manager_ref_user_data(MManager *mm); gboolean on_menu_manager_keyboard(GIOChannel *src, GIOCondition con, gpointer data); -pid_t get_tid (); -void hide_pid (); -void show_pid (); -int is_pid_show (); -void menu_print_dump(int data_len, void *data); +pid_t get_tid(); +void hide_pid(); +void show_pid(); +int is_pid_show(); +void menu_print_dump(int data_len, void *data); __END_DECLS -- 2.34.1