summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-21 11:45:12 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-21 11:45:13 +0100
commitb3b9fc03da4b7de2056edff25af030b9f4bd8063 (patch)
tree092badfbdf0bddcb381ddb72c7eb80fd09ed2d49 /bus
parent44f2531016e55e3dbfea3bcb60ba9f679f7d4b87 (diff)
parent2829a59951304d11df0483e74ba1acdf25d50acc (diff)
downloaddbus-b3b9fc03da4b7de2056edff25af030b9f4bd8063.tar.gz
Merge branch 'more-unused-39231'
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Diffstat (limited to 'bus')
-rw-r--r--bus/activation-helper.c4
-rw-r--r--bus/activation.c8
-rw-r--r--bus/connection.c19
-rw-r--r--bus/driver.c24
-rw-r--r--bus/services.c7
-rw-r--r--bus/test.c8
6 files changed, 25 insertions, 45 deletions
diff --git a/bus/activation-helper.c b/bus/activation-helper.c
index 7012227e..ab9d6010 100644
--- a/bus/activation-helper.c
+++ b/bus/activation-helper.c
@@ -144,10 +144,10 @@ out_all:
static dbus_bool_t
clear_environment (DBusError *error)
{
- const char *debug_env = NULL;
const char *starter_env = NULL;
-
#ifdef DBUS_ENABLE_VERBOSE_MODE
+ const char *debug_env = NULL;
+
/* are we debugging */
debug_env = _dbus_getenv ("DBUS_VERBOSE");
#endif
diff --git a/bus/activation.c b/bus/activation.c
index 97f9606b..2744e214 100644
--- a/bus/activation.c
+++ b/bus/activation.c
@@ -2538,14 +2538,18 @@ bus_activation_service_reload_test (const DBusString *test_data_dir)
_dbus_assert_not_reached ("could not initiate service reload test");
if (!do_service_reload_test (&directory, FALSE))
- ; /* Do nothing? */
+ {
+ /* Do nothing? */
+ }
/* Do OOM tests */
if (!init_service_reload_test (&directory))
_dbus_assert_not_reached ("could not initiate service reload test");
if (!do_service_reload_test (&directory, TRUE))
- ; /* Do nothing? */
+ {
+ /* Do nothing? */
+ }
/* Cleanup test directory */
if (!cleanup_service_reload_test (&directory))
diff --git a/bus/connection.c b/bus/connection.c
index 81f595d2..26839529 100644
--- a/bus/connection.c
+++ b/bus/connection.c
@@ -403,14 +403,6 @@ free_connection_data (void *data)
dbus_free (d);
}
-static void
-call_timeout_callback (DBusTimeout *timeout,
- void *data)
-{
- /* can return FALSE on OOM but we just let it fire again later */
- dbus_timeout_handle (timeout);
-}
-
BusConnections*
bus_connections_new (BusContext *context)
{
@@ -838,12 +830,7 @@ bus_connection_get_unix_groups (DBusConnection *connection,
int *n_groups,
DBusError *error)
{
- BusConnectionData *d;
unsigned long uid;
-
- d = BUS_CONNECTION_DATA (connection);
-
- _dbus_assert (d != NULL);
*groups = NULL;
*n_groups = 0;
@@ -1459,13 +1446,7 @@ bus_connections_check_limits (BusConnections *connections,
DBusConnection *requesting_completion,
DBusError *error)
{
- BusConnectionData *d;
unsigned long uid;
-
- d = BUS_CONNECTION_DATA (requesting_completion);
- _dbus_assert (d != NULL);
-
- _dbus_assert (d->name == NULL);
if (connections->n_completed >=
bus_context_get_max_completed_connections (connections->context))
diff --git a/bus/driver.c b/bus/driver.c
index 9ecfd55f..574e0f3d 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -827,7 +827,6 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
DBusMessageIter iter;
DBusMessageIter dict_iter;
DBusMessageIter dict_entry_iter;
- int msg_type;
int array_type;
int key_type;
DBusList *keys, *key_link;
@@ -842,9 +841,13 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
/* The message signature has already been checked for us,
* so let's just assert it's right.
*/
- msg_type = dbus_message_iter_get_arg_type (&iter);
+#ifndef DBUS_DISABLE_ASSERT
+ {
+ int msg_type = dbus_message_iter_get_arg_type (&iter);
- _dbus_assert (msg_type == DBUS_TYPE_ARRAY);
+ _dbus_assert (msg_type == DBUS_TYPE_ARRAY);
+ }
+#endif
dbus_message_iter_recurse (&iter, &dict_iter);
@@ -1930,7 +1933,7 @@ bus_driver_handle_message (DBusConnection *connection,
DBusMessage *message,
DBusError *error)
{
- const char *name, *sender, *interface;
+ const char *name, *interface;
const InterfaceHandler *ih;
const MessageHandler *mh;
dbus_bool_t found_interface = FALSE;
@@ -1957,13 +1960,17 @@ bus_driver_handle_message (DBusConnection *connection,
_dbus_assert (dbus_message_get_member (message) != NULL);
name = dbus_message_get_member (message);
- sender = dbus_message_get_sender (message);
- _dbus_verbose ("Driver got a method call: %s\n",
- dbus_message_get_member (message));
+ _dbus_verbose ("Driver got a method call: %s\n", name);
/* security checks should have kept this from getting here */
- _dbus_assert (sender != NULL || strcmp (name, "Hello") == 0);
+#ifndef DBUS_DISABLE_ASSERT
+ {
+ const char *sender = dbus_message_get_sender (message);
+
+ _dbus_assert (sender != NULL || strcmp (name, "Hello") == 0);
+ }
+#endif
for (ih = interface_handlers; ih->name != NULL; ih++)
{
@@ -2009,7 +2016,6 @@ bus_driver_handle_message (DBusConnection *connection,
}
}
- unknown:
_dbus_verbose ("No driver handler for message \"%s\"\n",
name);
diff --git a/bus/services.c b/bus/services.c
index 0a049257..68a7022a 100644
--- a/bus/services.c
+++ b/bus/services.c
@@ -385,7 +385,6 @@ bus_registry_acquire_service (BusRegistry *registry,
{
dbus_bool_t retval;
DBusConnection *old_owner_conn;
- DBusConnection *current_owner_conn;
BusClientPolicy *policy;
BusService *service;
BusActivation *activation;
@@ -510,12 +509,10 @@ bus_registry_acquire_service (BusRegistry *registry,
primary_owner = bus_service_get_primary_owner (service);
if (primary_owner == NULL)
goto out;
-
- current_owner_conn = primary_owner->conn;
-
+
if (old_owner_conn == NULL)
{
- _dbus_assert (current_owner_conn == connection);
+ _dbus_assert (primary_owner->conn == connection);
*result = DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER;
}
diff --git a/bus/test.c b/bus/test.c
index 049fae6f..e1b8a130 100644
--- a/bus/test.c
+++ b/bus/test.c
@@ -40,8 +40,6 @@ static dbus_bool_t
add_client_watch (DBusWatch *watch,
void *data)
{
- DBusConnection *connection = data;
-
return _dbus_loop_add_watch (client_loop, watch);
}
@@ -49,8 +47,6 @@ static void
remove_client_watch (DBusWatch *watch,
void *data)
{
- DBusConnection *connection = data;
-
_dbus_loop_remove_watch (client_loop, watch);
}
@@ -58,8 +54,6 @@ static dbus_bool_t
add_client_timeout (DBusTimeout *timeout,
void *data)
{
- DBusConnection *connection = data;
-
return _dbus_loop_add_timeout (client_loop, timeout);
}
@@ -67,8 +61,6 @@ static void
remove_client_timeout (DBusTimeout *timeout,
void *data)
{
- DBusConnection *connection = data;
-
_dbus_loop_remove_timeout (client_loop, timeout);
}