char *argv0;
#endif
-GPid
+static GPid
get_a_child (gint ttl)
{
GPid pid;
#endif /* G_OS_WIN32 */
}
-gboolean
+static gboolean
child_watch_callback (GPid pid, gint status, gpointer data)
{
#ifdef VERBOSE
test_small_writes (void)
{
GIOChannel *io;
- GIOStatus status;
+ GIOStatus status = G_IO_STATUS_ERROR;
guint cnt;
gchar tmp;
GError *error = NULL;
static void cleanup_crawlers (GMainContext *context);
-gboolean
+static gboolean
read_all (GIOChannel *channel, char *buf, gsize len)
{
gsize bytes_read = 0;
return TRUE;
}
-gboolean
+static gboolean
write_all (GIOChannel *channel, char *buf, gsize len)
{
gsize bytes_written = 0;
return TRUE;
}
-gboolean
+static gboolean
adder_callback (GIOChannel *source,
GIOCondition condition,
gpointer data)
return TRUE;
}
-gboolean
+static gboolean
timeout_callback (gpointer data)
{
AddrData *addr_data = data;
return TRUE;
}
-gpointer
+static gpointer
adder_thread (gpointer data)
{
GMainContext *context;
return NULL;
}
-void
+static void
io_pipe (GIOChannel **channels)
{
gint fds[2];
g_io_channel_set_close_on_unref (channels[1], TRUE);
}
-void
+static void
do_add (GIOChannel *in, gint a, gint b)
{
char buf1[32];
write_all (in, buf2, 32);
}
-gboolean
+static gboolean
adder_response (GIOChannel *source,
GIOCondition condition,
gpointer data)
return TRUE;
}
-void
+static void
create_adder_thread (void)
{
GError *err = NULL;
gchar* global_state;
+G_MODULE_EXPORT void g_clash_func (void);
+
G_MODULE_EXPORT void
g_clash_func (void)
{
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);
int n_freed;
} tdata[N_THREADS];
-void*
+static void *
thread_func (void *arg)
{
struct ThreadData *td = 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;
}
int
-main()
+main (void)
{
int t;
}
static void
-test_g_static_rw_lock ()
+test_g_static_rw_lock (void)
{
GThread *threads[THREADS];
guint i;
}
/* run all the tests */
-void
-run_all_tests()
+static void
+run_all_tests (void)
{
test_g_mutex ();
test_g_static_rec_mutex ();
}
static void
-test_thread_idle_time ()
+test_thread_idle_time (void)
{
guint limit = 50;
guint interval = 10000;