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 <walters@verbum.org>
This commit is contained in:
Kjartan Maraas 2009-04-21 12:52:22 -04:00 committed by Colin Walters
parent 83d7da43c4
commit 3c89788fa4
11 changed files with 14 additions and 13 deletions

View file

@ -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 ,

View file

@ -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;

View file

@ -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

View file

@ -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)

View file

@ -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);

View file

@ -1234,4 +1234,5 @@ fail:
_dbus_string_free (&cmdline);
_dbus_string_free (&path);
return FALSE;
}
}

View 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++)
{

View file

@ -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,

View file

@ -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;

View file

@ -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);

View file

@ -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)