Commit 3c89788f authored by Kjartan Maraas's avatar Kjartan Maraas Committed by Colin Walters
Browse files

Bug 19502 - Sparse warning cleanups



This patch makes various things that should be static static,
corrects some "return FALSE" where it should be NULL, etc.
Signed-off-by: Colin Walters's avatarColin Walters <walters@verbum.org>
parent 83d7da43
......@@ -66,7 +66,7 @@ typedef struct
#define VALID_KEY_CHAR 1
#define VALID_LOCALE_CHAR 2
unsigned char valid[256] = {
static unsigned char valid[256] = {
0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x3 , 0x2 , 0x0 ,
......
......@@ -1643,7 +1643,7 @@ bus_driver_handle_get_id (DBusConnection *connection,
* frequency of use (but doesn't matter with only a few items
* anyhow)
*/
struct
static struct
{
const char *name;
const char *in_args;
......
......@@ -2927,7 +2927,7 @@ dbus_connection_get_server_id (DBusConnection *connection)
{
char *id;
_dbus_return_val_if_fail (connection != NULL, FALSE);
_dbus_return_val_if_fail (connection != NULL, NULL);
CONNECTION_LOCK (connection);
id = _dbus_strdup (_dbus_transport_get_server_id (connection->transport));
......@@ -3340,7 +3340,7 @@ dbus_connection_send_with_reply_and_block (DBusConnection *connection,
*
* @param connection the connection.
*/
DBusDispatchStatus
static DBusDispatchStatus
_dbus_connection_flush_unlocked (DBusConnection *connection)
{
/* We have to specify DBUS_ITERATION_DO_READING here because
......
......@@ -1075,7 +1075,7 @@ _dbus_keyring_test (void)
dbus_error_init (&error);
ring1 = _dbus_keyring_new_for_credentials (NULL, &context,
&error);
_dbus_assert (ring1);
_dbus_assert (ring1 != NULL);
_dbus_assert (error.name == NULL);
id = _dbus_keyring_get_best_key (ring1, &error);
......@@ -1087,7 +1087,7 @@ _dbus_keyring_test (void)
}
ring2 = _dbus_keyring_new_for_credentials (NULL, &context, &error);
_dbus_assert (ring2);
_dbus_assert (ring2 != NULL);
_dbus_assert (error.name == NULL);
if (ring1->n_keys != ring2->n_keys)
......
......@@ -1245,7 +1245,7 @@ _dbus_string_append_printf_valist (DBusString *str,
va_list args)
{
int len;
va_list args_copy;
va_list args_copy = 0;
DBUS_STRING_PREAMBLE (str);
......
......@@ -1234,4 +1234,5 @@ fail:
_dbus_string_free (&cmdline);
_dbus_string_free (&path);
return FALSE;
}
\ No newline at end of file
}
......@@ -242,7 +242,7 @@ check_address (const char *address, DBusError *error)
_dbus_assert (*address != '\0');
if (!dbus_parse_address (address, &entries, &len, error))
return FALSE; /* not a valid address */
return NULL; /* not a valid address */
for (i = 0; i < len; i++)
{
......
......@@ -37,7 +37,7 @@ typedef struct {
int expected_queue[NUM_CONN];
} CommandAndResult;
CommandAndResult test_data[] = {
static CommandAndResult test_data[] = {
{ADD_CONNECTION, 0, ALLOW_REPLACEMENT | REPLACE_EXISTING,
PRIMARY_OWNER, {0,-1,-1,-1}},
{ADD_CONNECTION, 0, REPLACE_EXISTING,
......
......@@ -11,7 +11,7 @@ die (const char *message)
}
static void
open_destroy_shared_session_bus_connection ()
open_destroy_shared_session_bus_connection (void)
{
DBusError error;
DBusConnection *connection;
......
......@@ -335,7 +335,7 @@ do_waitpid (pid_t pid)
static pid_t bus_pid_to_kill = -1;
static void
kill_bus()
kill_bus(void)
{
verbose ("Killing message bus and exiting babysitter\n");
kill (bus_pid_to_kill, SIGTERM);
......
......@@ -195,7 +195,7 @@ usage (char *name, int ecode)
exit (ecode);
}
dbus_bool_t sigint_received = FALSE;
static dbus_bool_t sigint_received = FALSE;
static void
sigint_handler (int signum)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment