2005-11-30 John (J5) Palmieri <johnp@redhat.com>
+ * dbus/dbus-auth.c, dbus/dbus-connection.c, dbus/dbus-keyring.c,
+ dbus/dbus-server-debug-pipe.c, glib/dbus-binding-tool-glib.c
+ glib/dbus-glib-tool.c, glib/dbus-gparser.c, glib/dbus-gproxy.c
+ test/test-segfault.c, test/test-utils.c,
+ test/glib/test-dbus-glib.c, tools/dbus-cleanup-sockets.c
+ tools/dbus-launch.c, tools/dbus-tree-view.c, tools/dbus-viewer.c:
+ Various cleanup of dead code and compiler warnings (patch from
+ Kjartan Maraas <kmaraas at gnome.org>)
+
+2005-11-30 John (J5) Palmieri <johnp@redhat.com>
* glib/dbus-gmain.c (connection_setup_add_watch): plugged a leak
(patch from Carlos Garnacho Parro <carlosg at gnome.org>
if (auth->keyring == NULL)
{
- DBusError error;
-
dbus_error_init (&error);
auth->keyring = _dbus_keyring_new_homedir (data,
&auth->context,
_dbus_return_val_if_fail (connection != NULL, NULL);
_dbus_return_val_if_fail (message != NULL, NULL);
- _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE);
+ _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, NULL);
_dbus_return_val_if_error_is_set (error, NULL);
if (!dbus_connection_send_with_reply (connection, message,
if (!_dbus_string_init (&homedir))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return FALSE;
+ return NULL;
}
_dbus_string_init_const (&dotdir, ".dbus-keyrings");
if (keyring)
_dbus_keyring_unref (keyring);
_dbus_string_free (&homedir);
- return FALSE;
+ return NULL;
}
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
_dbus_transport_unref (server_transport);
_dbus_transport_unref (client_transport);
- return FALSE;
+ return NULL;
}
connection = _dbus_connection_new_for_transport (server_transport);
InterfaceInfo *interface;
GSList *methods;
GSList *tmp;
- int count;
char *iface_prefix;
channel = data->channel;
interface = (InterfaceInfo *) base;
methods = interface_info_get_methods (interface);
- count = 0;
iface_prefix = iface_to_c_prefix (interface_info_get_name (interface));
int
main (int argc, char **argv)
{
- const char *prev_arg;
const char *output_file;
const char *prefix;
char *output_file_tmp;
outputmode = DBUS_BINDING_OUTPUT_NONE;
end_of_args = FALSE;
files = NULL;
- prev_arg = NULL;
output_file = NULL;
prefix = "";
ignore_unsupported = FALSE;
else
files = g_slist_prepend (files, (char*) arg);
- prev_arg = arg;
-
++i;
}
return retval;
}
+#if 0
static gboolean
check_no_attributes (const char *element_name,
const char **attribute_names,
return TRUE;
}
+#endif
struct Parser
{
{
const char *name;
MethodInfo *method;
- NodeInfo *top;
if (parser->interface == NULL ||
parser->node_stack == NULL ||
return FALSE;
}
- top = parser->node_stack->data;
-
method = method_info_new (name);
interface_info_add_method (parser->interface, method);
method_info_unref (method);
{
const char *name;
SignalInfo *signal;
- NodeInfo *top;
if (parser->interface == NULL ||
parser->node_stack == NULL ||
return FALSE;
}
- top = parser->node_stack->data;
-
signal = signal_info_new (name);
interface_info_add_signal (parser->interface, signal);
signal_info_unref (signal);
const char *access;
const char *type;
PropertyInfo *property;
- NodeInfo *top;
PropertyAccessFlags access_flags;
if (parser->interface == NULL ||
return FALSE;
}
- top = parser->node_stack->data;
-
property = property_info_new (name, type, access_flags);
interface_info_add_property (parser->interface, property);
property_info_unref (property);
static void
unassociate_proxies (gpointer key, gpointer val, gpointer user_data)
{
- const char *tri;
DBusGProxyList *list;
const char *name;
GSList *tmp;
DBusGProxyUnassociateData *data;
- tri = key;
list = val;
data = user_data;
name = data->name;
gpointer data)
{
GError *error;
- char *echo_data;
guint val;
g_assert (!strcmp (data, "moo"));
error = NULL;
- echo_data = NULL;
if (!dbus_g_proxy_end_call (proxy, call, &error,
G_TYPE_UINT, &val,
G_TYPE_INVALID))
/* This is simply a process that segfaults */
+#include <stdlib.h>
#include <signal.h>
#include <sys/time.h>
raise (SIGSEGV);
- p = 0;
+ p = NULL;
*p = 'a';
return 0;
connection_timeout_callback (DBusTimeout *timeout,
void *data)
{
- CData *cd = data;
-
/* Can return FALSE on OOM but we just let it fire again later */
dbus_timeout_handle (timeout);
}
int
main (int argc, char **argv)
{
- const char *prev_arg;
int i;
int saw_doubledash;
const char *dirname;
saw_doubledash = FALSE;
dirname = NULL;
- prev_arg = NULL;
i = 1;
while (i < argc)
{
dirname = arg;
}
- prev_arg = arg;
-
++i;
}
while (TRUE)
{
- size_t chunk;
+ ssize_t chunk;
size_t to_read;
again:
while (TRUE)
{
- size_t chunk;
+ ssize_t chunk;
size_t to_read;
again:
int x_fd;
fd_set read_set;
fd_set err_set;
- int ret;
struct sigaction act;
sigset_t empty_mask;
#ifdef DBUS_BUILD_X11
act.sa_handler = signal_handler;
act.sa_mask = empty_mask;
act.sa_flags = 0;
- sigaction (SIGHUP, &act, 0);
+ sigaction (SIGHUP, &act, NULL);
#ifdef DBUS_BUILD_X11
xdisplay = XOpenDisplay (NULL);
FD_SET (x_fd, &err_set);
}
- ret = select (MAX (tty_fd, x_fd) + 1,
- &read_set, NULL, &err_set, NULL);
+ select (MAX (tty_fd, x_fd) + 1,
+ &read_set, NULL, &err_set, NULL);
if (got_sighup)
{
const char **path,
NodeInfo *node)
{
- GtkTreeStore *store;
-
- store = GTK_TREE_STORE (model);
-
if (path[0] == NULL)
{
/* Setting '/' */
int
main (int argc, char **argv)
{
- const char *prev_arg;
int i;
GSList *files;
gboolean end_of_args;
services = FALSE;
end_of_args = FALSE;
files = NULL;
- prev_arg = NULL;
i = 1;
while (i < argc)
{
else
files = g_slist_prepend (files, (char*) arg);
- prev_arg = arg;
-
++i;
}