From 6e8b2daa66d1483671f9efd73ec8f606ca8b026a Mon Sep 17 00:00:00 2001 From: "pr.jung" Date: Tue, 22 Dec 2015 15:21:05 +0900 Subject: [PATCH] Fix as Tizen coding rule. Change-Id: I8a07e55244c1dd6a55dd23e153e20ca48ef13d99 Signed-off-by: pr.jung --- src/callback.c | 4 ++-- src/dbus.c | 4 ++-- src/device.c | 26 ++++++++++++-------------- src/display.c | 2 +- src/haptic.c | 6 ++---- src/led.c | 2 +- src/power.c | 2 +- 7 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/callback.c b/src/callback.c index b9867da..8958be4 100644 --- a/src/callback.c +++ b/src/callback.c @@ -104,7 +104,7 @@ static void display_changed_cb(keynode_t *key, void *data) val = vconf_keynode_get_int(key); - switch(val) { + switch (val) { case 1: state = DISPLAY_STATE_NORMAL; break; case 2: state = DISPLAY_STATE_SCREEN_DIM; @@ -159,7 +159,7 @@ static int register_signal(const char *bus_name, GDBusConnection *conn; int id; -#if !GLIB_CHECK_VERSION(2,35,0) +#if !GLIB_CHECK_VERSION(2, 35, 0) g_type_init(); #endif diff --git a/src/dbus.c b/src/dbus.c index f5fda67..497096f 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -90,7 +90,7 @@ int dbus_method_sync(const char *dest, const char *path, GVariant *output; int result; -#if !GLIB_CHECK_VERSION(2,35,0) +#if !GLIB_CHECK_VERSION(2, 35, 0) g_type_init(); #endif @@ -180,7 +180,7 @@ int dbus_method_async_with_reply(const char *dest, const char *path, struct pending_call_data *pdata; int result; -#if !GLIB_CHECK_VERSION(2,35,0) +#if !GLIB_CHECK_VERSION(2, 35, 0) g_type_init(); #endif diff --git a/src/device.c b/src/device.c index a58f2d1..0eca063 100644 --- a/src/device.c +++ b/src/device.c @@ -30,7 +30,7 @@ return DEVICE_ERROR_NOT_SUPPORTED; \ return DEVICE_ERROR_OPERATION_FAILED; \ } \ - } while(0) + } while (0) int device_get_display_numbers(int* device_number) { @@ -117,15 +117,14 @@ static void battery_changed_inside_cb(keynode_t* key, void* user_data) if (keyname != NULL && changed_callback != NULL && strcmp(keyname, VCONFKEY_SYSMAN_BATTERY_CAPACITY) == 0) { int percent = 0; - if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CAPACITY, &percent) == 0) { + if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CAPACITY, &percent) == 0) changed_callback(percent, changed_callback_user_data); - } } } int device_battery_set_cb(device_battery_cb callback, void* user_data) { - // VCONFKEY_SYSMAN_BATTERY_CAPACITY + /* VCONFKEY_SYSMAN_BATTERY_CAPACITY */ int err; if (callback == NULL) return DEVICE_ERROR_INVALID_PARAMETER; @@ -163,19 +162,19 @@ int device_battery_get_warning_status(device_battery_warn_e *status) if (err < 0) return DEVICE_ERROR_OPERATION_FAILED; - if (value == VCONFKEY_SYSMAN_BAT_POWER_OFF) { + if (value == VCONFKEY_SYSMAN_BAT_POWER_OFF) *status = DEVICE_BATTERY_WARN_EMPTY; - } else if (value == VCONFKEY_SYSMAN_BAT_CRITICAL_LOW) { + else if (value == VCONFKEY_SYSMAN_BAT_CRITICAL_LOW) *status = DEVICE_BATTERY_WARN_CRITICAL; - } else if (value == VCONFKEY_SYSMAN_BAT_WARNING_LOW) { + else if (value == VCONFKEY_SYSMAN_BAT_WARNING_LOW) *status = DEVICE_BATTERY_WARN_LOW; - } else if (value == VCONFKEY_SYSMAN_BAT_NORMAL) { + else if (value == VCONFKEY_SYSMAN_BAT_NORMAL) *status = DEVICE_BATTERY_WARN_NORMAL; - } else if (value == VCONFKEY_SYSMAN_BAT_FULL) { + else if (value == VCONFKEY_SYSMAN_BAT_FULL) *status = DEVICE_BATTERY_WARN_FULL; - } else { + else return DEVICE_ERROR_OPERATION_FAILED; - } + return DEVICE_ERROR_NONE; } @@ -189,15 +188,14 @@ static void battery_warn_changed_inside_cb(keynode_t* key, void* user_data) if (keyname != NULL && warn_changed_callback != NULL && strcmp(keyname, VCONFKEY_SYSMAN_BATTERY_STATUS_LOW) == 0) { int bat_state = 0; - if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, &bat_state) == 0) { + if (vconf_get_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, &bat_state) == 0) warn_changed_callback(bat_state-1, warn_changed_callback_user_data); - } } } int device_battery_warning_set_cb(device_battery_warn_cb callback, void* user_data) { - // VCONFKEY_SYSMAN_BATTERY_STATUS_LOW + /* VCONFKEY_SYSMAN_BATTERY_STATUS_LOW */ int err; if (callback == NULL) diff --git a/src/display.c b/src/display.c index 7cc728e..ee89036 100644 --- a/src/display.c +++ b/src/display.c @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License. */ diff --git a/src/haptic.c b/src/haptic.c index b7d8b58..5543c8f 100644 --- a/src/haptic.c +++ b/src/haptic.c @@ -30,14 +30,12 @@ #define METHOD_STOP_DEVICE "StopDevice" #define METHOD_VIBRATE_MONOTONE "VibrateMonotone" -enum feedback_e -{ +enum feedback_e { HAPTIC_FEEDBACK_MIN = 0, HAPTIC_FEEDBACK_MAX = 100, }; -enum priority_e -{ +enum priority_e { HAPTIC_PRIORITY_MIN = 0, HAPTIC_PRIORITY_MIDDLE, HAPTIC_PRIORITY_HIGH, diff --git a/src/led.c b/src/led.c index f0245b3..fd97551 100644 --- a/src/led.c +++ b/src/led.c @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License. */ diff --git a/src/power.c b/src/power.c index 9fcd05f..8fee499 100644 --- a/src/power.c +++ b/src/power.c @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License. */ -- 2.7.4