From 73ee64012597b9d1a1ba924b0fcd8f6dfe7daf68 Mon Sep 17 00:00:00 2001 From: cookie Date: Mon, 28 Mar 2016 14:52:39 +0900 Subject: [PATCH] Fix the Tizen30 C API Coding Style Change-Id: Ib3e27c5f3059730c5a17bd9da8fea75e1da97523 Signed-off-by: cookie --- include/download.h | 15 +++++---------- src/download-wrapping.c | 49 ++++++++++++++++++++++--------------------------- 2 files changed, 27 insertions(+), 37 deletions(-) diff --git a/include/download.h b/include/download.h index 453bfb1..2a79ba3 100755 --- a/include/download.h +++ b/include/download.h @@ -42,8 +42,7 @@ extern "C" * @brief Enumeration for error codes of URL download. * @since_tizen 2.3 */ -typedef enum -{ +typedef enum { DOWNLOAD_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ DOWNLOAD_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ DOWNLOAD_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ @@ -78,8 +77,7 @@ typedef enum * @brief Enumeration for download states. * @since_tizen 2.3 */ -typedef enum -{ +typedef enum { DOWNLOAD_STATE_NONE, /**< Unhandled exception */ DOWNLOAD_STATE_READY, /**< Ready to download */ DOWNLOAD_STATE_QUEUED, /**< Queued to start downloading */ @@ -94,8 +92,7 @@ typedef enum * @brief Enumeration for network type for downloading. * @since_tizen 2.3 */ -typedef enum -{ +typedef enum { DOWNLOAD_NETWORK_DATA_NETWORK, /**< Download is available through data network */ DOWNLOAD_NETWORK_WIFI, /**< Download is available through WiFi */ DOWNLOAD_NETWORK_WIFI_DIRECT, /**< Download is available through WiFi-Direct */ @@ -110,8 +107,7 @@ typedef enum * @see download_set_notification_type() * @see download_get_notification_type() */ -typedef enum -{ +typedef enum { DOWNLOAD_NOTIFICATION_TYPE_NONE = 0, /**< Do not register notification */ DOWNLOAD_NOTIFICATION_TYPE_COMPLETE_ONLY, /**< Completion notification for success state and failed state */ DOWNLOAD_NOTIFICATION_TYPE_ALL /**< All download notifications for ongoing state, success state and failed state */ @@ -125,8 +121,7 @@ typedef enum * @see download_set_notification_app_control() * @see download_get_notification_app_control() */ -typedef enum -{ +typedef enum { DOWNLOAD_NOTIFICATION_APP_CONTROL_TYPE_ONGOING = 0, /**< App control action for failed and ongoing notification */ DOWNLOAD_NOTIFICATION_APP_CONTROL_TYPE_COMPLETE, /**< App control action for completed notification */ DOWNLOAD_NOTIFICATION_APP_CONTROL_TYPE_FAILED /**< App control action for failed notification*/ diff --git a/src/download-wrapping.c b/src/download-wrapping.c index 0afada1..8802ecd 100755 --- a/src/download-wrapping.c +++ b/src/download-wrapping.c @@ -105,33 +105,28 @@ int download_set_network_type(int download_id, system_info_get_platform_bool (WIFI_FEATURE, &bIsWifiFeatureSupported); system_info_get_platform_bool (WIFI_DIRECT_FEATURE, &bIsWifiDirectFeatureSupported); - switch (net_type) - { - case DOWNLOAD_NETWORK_DATA_NETWORK: - if ( !bIsTelephonyFeatureSupported ) - { - return DOWNLOAD_ERROR_NOT_SUPPORTED; - } - break; - case DOWNLOAD_NETWORK_WIFI: - if ( !bIsWifiFeatureSupported ) - { - return DOWNLOAD_ERROR_NOT_SUPPORTED; - } - break; - case DOWNLOAD_NETWORK_WIFI_DIRECT: - if ( !bIsWifiDirectFeatureSupported ) - { - return DOWNLOAD_ERROR_NOT_SUPPORTED; - } - break; - case DOWNLOAD_NETWORK_ALL: - if ( !bIsTelephonyFeatureSupported && !bIsWifiFeatureSupported && !bIsWifiDirectFeatureSupported ) - { - return DOWNLOAD_ERROR_NOT_SUPPORTED; - } - break; - } + switch (net_type) { + case DOWNLOAD_NETWORK_DATA_NETWORK: + if (!bIsTelephonyFeatureSupported) { + return DOWNLOAD_ERROR_NOT_SUPPORTED; + } + break; + case DOWNLOAD_NETWORK_WIFI: + if (!bIsWifiFeatureSupported) { + return DOWNLOAD_ERROR_NOT_SUPPORTED; + } + break; + case DOWNLOAD_NETWORK_WIFI_DIRECT: + if (!bIsWifiDirectFeatureSupported) { + return DOWNLOAD_ERROR_NOT_SUPPORTED; + } + break; + case DOWNLOAD_NETWORK_ALL: + if (!bIsTelephonyFeatureSupported && !bIsWifiFeatureSupported && !bIsWifiDirectFeatureSupported) { + return DOWNLOAD_ERROR_NOT_SUPPORTED; + } + break; + } return dp_interface_set_network_type(download_id, (int)net_type); } -- 2.7.4