Fix more warning-addition fallout

I'm normally a big fan of small atomic commits, but I also want to get
things done this afternoon...

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687441
Reviewed-by: Colin Walters <walters@verbum.org>
This commit is contained in:
Simon McVittie 2012-11-02 15:45:14 +00:00
parent 733acc2316
commit 837db1a026
8 changed files with 33 additions and 24 deletions

View File

@ -51,7 +51,7 @@ gint alive;
char *argv0;
#endif
GPid
static GPid
get_a_child (gint ttl)
{
GPid pid;
@ -89,7 +89,7 @@ get_a_child (gint ttl)
#endif /* G_OS_WIN32 */
}
gboolean
static gboolean
child_watch_callback (GPid pid, gint status, gpointer data)
{
#ifdef VERBOSE

View File

@ -15,7 +15,7 @@ static void
test_small_writes (void)
{
GIOChannel *io;
GIOStatus status;
GIOStatus status = G_IO_STATUS_ERROR;
guint cnt;
gchar tmp;
GError *error = NULL;

View File

@ -54,7 +54,7 @@ struct _TestData
static void cleanup_crawlers (GMainContext *context);
gboolean
static gboolean
read_all (GIOChannel *channel, char *buf, gsize len)
{
gsize bytes_read = 0;
@ -78,7 +78,7 @@ read_all (GIOChannel *channel, char *buf, gsize len)
return TRUE;
}
gboolean
static gboolean
write_all (GIOChannel *channel, char *buf, gsize len)
{
gsize bytes_written = 0;
@ -97,7 +97,7 @@ write_all (GIOChannel *channel, char *buf, gsize len)
return TRUE;
}
gboolean
static gboolean
adder_callback (GIOChannel *source,
GIOCondition condition,
gpointer data)
@ -122,7 +122,7 @@ adder_callback (GIOChannel *source,
return TRUE;
}
gboolean
static gboolean
timeout_callback (gpointer data)
{
AddrData *addr_data = data;
@ -132,7 +132,7 @@ timeout_callback (gpointer data)
return TRUE;
}
gpointer
static gpointer
adder_thread (gpointer data)
{
GMainContext *context;
@ -194,7 +194,7 @@ adder_thread (gpointer data)
return NULL;
}
void
static void
io_pipe (GIOChannel **channels)
{
gint fds[2];
@ -212,7 +212,7 @@ io_pipe (GIOChannel **channels)
g_io_channel_set_close_on_unref (channels[1], TRUE);
}
void
static void
do_add (GIOChannel *in, gint a, gint b)
{
char buf1[32];
@ -225,7 +225,7 @@ do_add (GIOChannel *in, gint a, gint b)
write_all (in, buf2, 32);
}
gboolean
static gboolean
adder_response (GIOChannel *source,
GIOCondition condition,
gpointer data)
@ -261,7 +261,7 @@ adder_response (GIOChannel *source,
return TRUE;
}
void
static void
create_adder_thread (void)
{
GError *err = NULL;

View File

@ -32,6 +32,8 @@
gchar* global_state;
G_MODULE_EXPORT void g_clash_func (void);
G_MODULE_EXPORT void
g_clash_func (void)
{

View File

@ -112,13 +112,15 @@ int
main (int argc,
char *argv[])
{
GThread *threads[N_THREADS];
G_GNUC_UNUSED GThread *threads[N_THREADS];
int i;
void *p;
/* test simple initializer */
initializer1();
initializer1();
/* test pointer initializer */
void *p = initializer2();
p = initializer2();
g_assert (p == &dummy_value);
p = initializer2();
g_assert (p == &dummy_value);

View File

@ -37,7 +37,7 @@ struct ThreadData
int n_freed;
} tdata[N_THREADS];
void*
static void *
thread_func (void *arg)
{
struct ThreadData *td = arg;
@ -45,18 +45,23 @@ thread_func (void *arg)
/* g_print ("Thread %d starting\n", td->thread_id); */
for (i = 0; i < N_ALLOCS; i++)
{
int bytes;
char *mem;
int f;
int t;
if (rand() % (N_ALLOCS / 20) == 0)
g_print ("%c", 'a' - 1 + td->thread_id);
/* allocate block of random size and randomly fill */
int bytes = rand() % MAX_BLOCK_SIZE + 1;
char *mem = g_slice_alloc (bytes);
int f;
bytes = rand() % MAX_BLOCK_SIZE + 1;
mem = g_slice_alloc (bytes);
for (f = 0; f < bytes; f++)
mem[f] = rand();
/* associate block with random thread */
int t = rand() % N_THREADS;
t = rand() % N_THREADS;
g_mutex_lock (&tdata[t].to_free_mutex);
tdata[t].to_free[tdata[t].n_to_free] = mem;
tdata[t].bytes_to_free[tdata[t].n_to_free] = bytes;
@ -87,7 +92,7 @@ thread_func (void *arg)
}
int
main()
main (void)
{
int t;

View File

@ -277,7 +277,7 @@ test_g_static_rw_lock_thread (gpointer data)
}
static void
test_g_static_rw_lock ()
test_g_static_rw_lock (void)
{
GThread *threads[THREADS];
guint i;
@ -368,8 +368,8 @@ test_g_thread_once (void)
}
/* run all the tests */
void
run_all_tests()
static void
run_all_tests (void)
{
test_g_mutex ();
test_g_static_rec_mutex ();

View File

@ -332,7 +332,7 @@ test_thread_idle_timeout (gpointer data)
}
static void
test_thread_idle_time ()
test_thread_idle_time (void)
{
guint limit = 50;
guint interval = 10000;