summaryrefslogtreecommitdiff
path: root/src/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/clock.c')
-rw-r--r--src/clock.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/clock.c b/src/clock.c
index 2ce61d9e..0fde2c34 100644
--- a/src/clock.c
+++ b/src/clock.c
@@ -2,7 +2,7 @@
*
* Connection Manager
*
- * Copyright (C) 2007-2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -96,7 +96,7 @@ static void clock_properties_load(void)
enum timezone_updates timezone_value;
keyfile = __connman_storage_load_global();
- if (keyfile == NULL)
+ if (!keyfile)
return;
str = g_key_file_get_string(keyfile, "global", "TimeUpdates", NULL);
@@ -125,17 +125,17 @@ static void clock_properties_save(void)
const char *str;
keyfile = __connman_storage_load_global();
- if (keyfile == NULL)
+ if (!keyfile)
keyfile = g_key_file_new();
str = time_updates2string(time_updates_config);
- if (str != NULL)
+ if (str)
g_key_file_set_string(keyfile, "global", "TimeUpdates", str);
else
g_key_file_remove_key(keyfile, "global", "TimeUpdates", NULL);
str = timezone_updates2string(timezone_updates_config);
- if (str != NULL)
+ if (str)
g_key_file_set_string(keyfile, "global", "TimezoneUpdates",
str);
else
@@ -157,10 +157,10 @@ static void append_timeservers(DBusMessageIter *iter, void *user_data)
int i;
char **timeservers = __connman_timeserver_system_get();
- if (timeservers == NULL)
+ if (!timeservers)
return;
- for (i = 0; timeservers[i] != NULL; i++) {
+ for (i = 0; timeservers[i]; i++) {
dbus_message_iter_append_basic(iter,
DBUS_TYPE_STRING, &timeservers[i]);
}
@@ -179,7 +179,7 @@ static DBusMessage *get_properties(DBusConnection *conn,
DBG("conn %p", conn);
reply = dbus_message_new_method_return(msg);
- if (reply == NULL)
+ if (!reply)
return NULL;
dbus_message_iter_init_append(reply, &array);
@@ -194,16 +194,16 @@ static DBusMessage *get_properties(DBusConnection *conn,
}
str = time_updates2string(time_updates_config);
- if (str != NULL)
+ if (str)
connman_dbus_dict_append_basic(&dict, "TimeUpdates",
DBUS_TYPE_STRING, &str);
- if (timezone_config != NULL)
+ if (timezone_config)
connman_dbus_dict_append_basic(&dict, "Timezone",
DBUS_TYPE_STRING, &timezone_config);
str = timezone_updates2string(timezone_updates_config);
- if (str != NULL)
+ if (str)
connman_dbus_dict_append_basic(&dict, "TimezoneUpdates",
DBUS_TYPE_STRING, &str);
@@ -224,7 +224,7 @@ static DBusMessage *set_property(DBusConnection *conn,
DBG("conn %p", conn);
- if (dbus_message_iter_init(msg, &iter) == FALSE)
+ if (!dbus_message_iter_init(msg, &iter))
return __connman_error_invalid_arguments(msg);
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
@@ -240,7 +240,7 @@ static DBusMessage *set_property(DBusConnection *conn,
type = dbus_message_iter_get_arg_type(&value);
- if (g_str_equal(name, "Time") == TRUE) {
+ if (g_str_equal(name, "Time")) {
struct timeval tv;
dbus_uint64_t newval;
@@ -261,7 +261,7 @@ static DBusMessage *set_property(DBusConnection *conn,
connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
CONNMAN_CLOCK_INTERFACE, "Time",
DBUS_TYPE_UINT64, &newval);
- } else if (g_str_equal(name, "TimeUpdates") == TRUE) {
+ } else if (g_str_equal(name, "TimeUpdates")) {
const char *strval;
enum time_updates newval;
@@ -283,7 +283,7 @@ static DBusMessage *set_property(DBusConnection *conn,
connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
CONNMAN_CLOCK_INTERFACE, "TimeUpdates",
DBUS_TYPE_STRING, &strval);
- } else if (g_str_equal(name, "Timezone") == TRUE) {
+ } else if (g_str_equal(name, "Timezone")) {
const char *strval;
if (type != DBUS_TYPE_STRING)
@@ -295,8 +295,8 @@ static DBusMessage *set_property(DBusConnection *conn,
dbus_message_iter_get_basic(&value, &strval);
if (__connman_timezone_change(strval) < 0)
- return __connman_error_invalid_arguments(msg);
- } else if (g_str_equal(name, "TimezoneUpdates") == TRUE) {
+ return __connman_error_invalid_arguments(msg);
+ } else if (g_str_equal(name, "TimezoneUpdates")) {
const char *strval;
enum timezone_updates newval;
@@ -318,7 +318,7 @@ static DBusMessage *set_property(DBusConnection *conn,
connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
CONNMAN_CLOCK_INTERFACE, "TimezoneUpdates",
DBUS_TYPE_STRING, &strval);
- } else if (g_str_equal(name, "Timeservers") == TRUE) {
+ } else if (g_str_equal(name, "Timeservers")) {
DBusMessageIter entry;
char **str = NULL;
GSList *list = NULL;
@@ -344,10 +344,10 @@ static DBusMessage *set_property(DBusConnection *conn,
dbus_message_iter_next(&entry);
}
- if (list != NULL) {
+ if (list) {
str = g_new0(char *, count+1);
- while (list != NULL) {
+ while (list) {
count--;
str[count] = list->data;
list = g_slist_delete_link(list, list);
@@ -356,7 +356,7 @@ static DBusMessage *set_property(DBusConnection *conn,
__connman_timeserver_system_set(str);
- if (str != NULL)
+ if (str)
g_strfreev(str);
connman_dbus_property_changed_array(CONNMAN_MANAGER_PATH,
@@ -393,7 +393,7 @@ void __connman_clock_update_timezone(void)
g_free(timezone_config);
timezone_config = __connman_timezone_lookup();
- if (timezone_config == NULL)
+ if (!timezone_config)
return;
connman_dbus_property_changed_basic(CONNMAN_MANAGER_PATH,
@@ -406,7 +406,7 @@ int __connman_clock_init(void)
DBG("");
connection = connman_dbus_get_connection();
- if (connection == NULL)
+ if (!connection)
return -1;
__connman_timezone_init();
@@ -426,7 +426,7 @@ void __connman_clock_cleanup(void)
{
DBG("");
- if (connection == NULL)
+ if (!connection)
return;
g_dbus_unregister_interface(connection, CONNMAN_MANAGER_PATH,