summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-08-30 10:56:14 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-09-04 09:05:15 (GMT)
commit3b93b48112dbb3339e4c458bbd9591b76e1af1e5 (patch)
treea690f222834dd450df25f97d3d4168e5f43557ee
parentdcba9d915ef9b4a6d38a05c2e900cce96e035d89 (diff)
downloadconnman-3b93b48112dbb3339e4c458bbd9591b76e1af1e5.zip
connman-3b93b48112dbb3339e4c458bbd9591b76e1af1e5.tar.gz
connman-3b93b48112dbb3339e4c458bbd9591b76e1af1e5.tar.bz2
Use g_slist_prepend() where appropriate
Convert usage of g_slist_append() to g_slist_prepend() where appropriate. gdbus, dnsproxy, resolver, rtnl, session and session unit test have ordering requirements and thus not touched.
-rw-r--r--plugins/bluetooth.c2
-rw-r--r--plugins/wifi.c2
-rw-r--r--src/config.c2
-rw-r--r--src/detect.c2
-rw-r--r--src/device.c2
-rw-r--r--src/inet.c2
-rw-r--r--src/ipconfig.c2
-rw-r--r--src/network.c2
-rw-r--r--src/proxy.c4
-rw-r--r--src/resolver.c6
-rw-r--r--src/service.c2
-rw-r--r--src/technology.c4
12 files changed, 16 insertions, 16 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index 2af0201..47343bb 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -636,7 +636,7 @@ static void remove_device_networks(struct connman_device *device)
if (connman_network_get_device(network) != device)
continue;
- key_list = g_slist_append(key_list, key);
+ key_list = g_slist_prepend(key_list, key);
}
for (list = key_list; list != NULL; list = list->next) {
diff --git a/plugins/wifi.c b/plugins/wifi.c
index eec1cfb..f5690b5 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1659,7 +1659,7 @@ static void network_added(GSupplicantNetwork *supplicant_network)
return;
}
- wifi->networks = g_slist_append(wifi->networks, network);
+ wifi->networks = g_slist_prepend(wifi->networks, network);
}
if (name != NULL && name[0] != '\0')
diff --git a/src/config.c b/src/config.c
index a329674..9ea75f9 100644
--- a/src/config.c
+++ b/src/config.c
@@ -400,7 +400,7 @@ static int load_service(GKeyFile *keyfile, const char *group,
if (config->protected == TRUE)
protected_services =
- g_slist_append(protected_services, service);
+ g_slist_prepend(protected_services, service);
connman_info("Adding service configuration %s", service->ident);
diff --git a/src/detect.c b/src/detect.c
index f4b5d29..94a113e 100644
--- a/src/detect.c
+++ b/src/detect.c
@@ -80,7 +80,7 @@ static void detect_newlink(unsigned short type, int index,
return;
}
- device_list = g_slist_append(device_list, device);
+ device_list = g_slist_prepend(device_list, device);
}
static void detect_dellink(unsigned short type, int index,
diff --git a/src/device.c b/src/device.c
index f0f7891..12bc7da 100644
--- a/src/device.c
+++ b/src/device.c
@@ -425,7 +425,7 @@ struct connman_device *connman_device_create(const char *node,
device->networks = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, free_network);
- device_list = g_slist_append(device_list, device);
+ device_list = g_slist_prepend(device_list, device);
return device;
}
diff --git a/src/inet.c b/src/inet.c
index 1f9bd0d..226e505 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -1793,7 +1793,7 @@ GSList *__connman_inet_ipv6_get_prefixes(struct nd_router_advert *hdr,
str = g_strdup_printf("%s/%d", prefix,
pinfo->nd_opt_pi_prefix_len);
- prefixes = g_slist_append(prefixes, str);
+ prefixes = g_slist_prepend(prefixes, str);
DBG("prefix %s", str);
diff --git a/src/ipconfig.c b/src/ipconfig.c
index d95e1e1..e2b6576 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -807,7 +807,7 @@ void __connman_ipconfig_newaddr(int index, int family, const char *label,
else
return;
- ipdevice->address_list = g_slist_append(ipdevice->address_list,
+ ipdevice->address_list = g_slist_prepend(ipdevice->address_list,
ipaddress);
connman_info("%s {add} address %s/%u label %s family %d",
diff --git a/src/network.c b/src/network.c
index df9f923..69cb70a 100644
--- a/src/network.c
+++ b/src/network.c
@@ -382,7 +382,7 @@ struct connman_network *connman_network_create(const char *identifier,
network->type = type;
network->identifier = ident;
- network_list = g_slist_append(network_list, network);
+ network_list = g_slist_prepend(network_list, network);
return network;
}
diff --git a/src/proxy.c b/src/proxy.c
index fd58a70..500d4e6 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -128,7 +128,7 @@ unsigned int connman_proxy_lookup(const char *interface, const char *url,
}
DBG("token %u", lookup->token);
- lookup_list = g_slist_append(lookup_list, lookup);
+ lookup_list = g_slist_prepend(lookup_list, lookup);
return lookup->token;
}
@@ -179,7 +179,7 @@ void connman_proxy_driver_lookup_notify(struct connman_service *service,
if (lookup->cb)
lookup->cb(result, lookup->user_data);
- matches = g_slist_append(matches, lookup);
+ matches = g_slist_prepend(matches, lookup);
}
}
diff --git a/src/resolver.c b/src/resolver.c
index a9d1341..2d52457 100644
--- a/src/resolver.c
+++ b/src/resolver.c
@@ -244,7 +244,7 @@ static gboolean resolver_expire_cb(gpointer user_data)
DBG("interface %s domain %s server %s",
entry->interface, entry->domain, entry->server);
- list = g_slist_append(NULL, entry);
+ list = g_slist_prepend(NULL, entry);
index = connman_inet_ifindex(entry->interface);
if (index >= 0) {
@@ -462,7 +462,7 @@ int connman_resolver_remove(const char *interface, const char *domain,
if (g_strcmp0(entry->server, server) != 0)
continue;
- matches = g_slist_append(matches, entry);
+ matches = g_slist_prepend(matches, entry);
break;
}
@@ -495,7 +495,7 @@ int connman_resolver_remove_all(const char *interface)
if (g_strcmp0(entry->interface, interface) != 0)
continue;
- matches = g_slist_append(matches, entry);
+ matches = g_slist_prepend(matches, entry);
}
if (matches == NULL)
diff --git a/src/service.c b/src/service.c
index 48187c4..595381d 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2089,7 +2089,7 @@ int __connman_service_counter_register(const char *counter)
DBG("counter %s", counter);
- counter_list = g_slist_append(counter_list, (gpointer)counter);
+ counter_list = g_slist_prepend(counter_list, (gpointer)counter);
iter = g_sequence_get_begin_iter(service_list);
diff --git a/src/technology.c b/src/technology.c
index 8d5de78..c140015 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -959,7 +959,7 @@ static struct connman_technology *technology_get(enum connman_service_type type)
return NULL;
}
- technology_list = g_slist_append(technology_list, technology);
+ technology_list = g_slist_prepend(technology_list, technology);
technology_added_signal(technology);
@@ -1102,7 +1102,7 @@ int __connman_technology_add_device(struct connman_device *device)
if (!technology->enable_persistent)
__connman_device_disable(device);
- technology->device_list = g_slist_append(technology->device_list,
+ technology->device_list = g_slist_prepend(technology->device_list,
device);
return 0;