[glib] Mark some functions 'static' in glib/tests
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Mark some functions 'static' in glib/tests
- Date: Mon, 17 Oct 2011 01:41:20 +0000 (UTC)
commit 3d93c44374964b5846aea61f32ecb294efe148db
Author: Ryan Lortie <desrt desrt ca>
Date: Sun Oct 16 20:57:40 2011 -0400
Mark some functions 'static' in glib/tests
This has uncovered two unused testcases in option-context.c. They are
currently broken and require more investigation (which is probably why
they are unused).
glib/tests/642026.c | 2 +-
glib/tests/collate.c | 4 +-
glib/tests/cond.c | 2 +-
glib/tests/logging.c | 8 ++--
glib/tests/markup-subparser.c | 2 +-
glib/tests/option-context.c | 91 +++++++++++++++++++++--------------------
glib/tests/sequence.c | 2 +-
glib/tests/slice.c | 2 +-
glib/tests/strfuncs.c | 2 +-
glib/tests/string.c | 2 +-
10 files changed, 59 insertions(+), 58 deletions(-)
---
diff --git a/glib/tests/642026.c b/glib/tests/642026.c
index 4764680..05f9f25 100644
--- a/glib/tests/642026.c
+++ b/glib/tests/642026.c
@@ -46,7 +46,7 @@ static gpointer thread_func (gpointer nil)
return nil;
}
-void
+static void
testcase (void)
{
g_test_bug ("642026");
diff --git a/glib/tests/collate.c b/glib/tests/collate.c
index eaae049..7750c40 100644
--- a/glib/tests/collate.c
+++ b/glib/tests/collate.c
@@ -14,7 +14,7 @@ typedef struct {
const gchar *str;
} Line;
-int
+static int
compare_collate (const void *a, const void *b)
{
const Line *line_a = a;
@@ -23,7 +23,7 @@ compare_collate (const void *a, const void *b)
return g_utf8_collate (line_a->str, line_b->str);
}
-int
+static int
compare_key (const void *a, const void *b)
{
const Line *line_a = a;
diff --git a/glib/tests/cond.c b/glib/tests/cond.c
index 26a5dbf..33a7676 100644
--- a/glib/tests/cond.c
+++ b/glib/tests/cond.c
@@ -173,7 +173,7 @@ barrier_wait (Barrier *barrier)
static Barrier b;
static gint check;
-gpointer
+static gpointer
cond2_func (gpointer data)
{
gint value = GPOINTER_TO_INT (data);
diff --git a/glib/tests/logging.c b/glib/tests/logging.c
index 9d13b8f..56340b6 100644
--- a/glib/tests/logging.c
+++ b/glib/tests/logging.c
@@ -172,7 +172,7 @@ test_printerr_handler (void)
static char *fail_str = "foo";
static char *log_str = "bar";
-gboolean
+static gboolean
good_failure_handler (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *msg,
@@ -185,7 +185,7 @@ good_failure_handler (const gchar *log_domain,
return FALSE;
}
-gboolean
+static gboolean
bad_failure_handler (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *msg,
@@ -198,7 +198,7 @@ bad_failure_handler (const gchar *log_domain,
return FALSE;
}
-void
+static void
test_handler (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *msg,
@@ -209,7 +209,7 @@ test_handler (const gchar *log_domain,
g_assert ((char *)user_data == log_str);
}
-void
+static void
bug653052 (void)
{
g_test_bug ("653052");
diff --git a/glib/tests/markup-subparser.c b/glib/tests/markup-subparser.c
index 631a61b..3218880 100644
--- a/glib/tests/markup-subparser.c
+++ b/glib/tests/markup-subparser.c
@@ -275,7 +275,7 @@ typedef struct
const char *error_message;
} TestCase;
-void
+static void
test (gconstpointer user_data)
{
const TestCase *tc = user_data;
diff --git a/glib/tests/option-context.c b/glib/tests/option-context.c
index bf24ec3..a42faeb 100644
--- a/glib/tests/option-context.c
+++ b/glib/tests/option-context.c
@@ -188,7 +188,7 @@ gboolean ignore_test1_boolean;
gboolean ignore_test2_boolean;
gchar *ignore_test3_string;
-gchar **
+static gchar **
split_string (const char *str, int *argc)
{
gchar **argv;
@@ -204,7 +204,7 @@ split_string (const char *str, int *argc)
return argv;
}
-gchar *
+static gchar *
join_stringv (int argc, char **argv)
{
int i;
@@ -224,7 +224,7 @@ join_stringv (int argc, char **argv)
}
/* Performs a shallow copy */
-char **
+static char **
copy_stringv (char **argv, int argc)
{
return g_memdup (argv, sizeof (char *) * (argc + 1));
@@ -256,7 +256,7 @@ error_test1_post_parse (GOptionContext *context,
return FALSE;
}
-void
+static void
error_test1 (void)
{
GOptionContext *context;
@@ -317,7 +317,7 @@ error_test2_post_parse (GOptionContext *context,
return FALSE;
}
-void
+static void
error_test2 (void)
{
GOptionContext *context;
@@ -378,7 +378,7 @@ error_test3_post_parse (GOptionContext *context,
return FALSE;
}
-void
+static void
error_test3 (void)
{
GOptionContext *context;
@@ -414,7 +414,7 @@ error_test3 (void)
g_option_context_free (context);
}
-void
+static void
arg_test1 (void)
{
GOptionContext *context;
@@ -443,7 +443,7 @@ arg_test1 (void)
g_option_context_free (context);
}
-void
+static void
arg_test2 (void)
{
GOptionContext *context;
@@ -474,7 +474,7 @@ arg_test2 (void)
g_option_context_free (context);
}
-void
+static void
arg_test3 (void)
{
GOptionContext *context;
@@ -506,7 +506,7 @@ arg_test3 (void)
}
-void
+static void
arg_test4 (void)
{
GOptionContext *context;
@@ -535,7 +535,7 @@ arg_test4 (void)
g_option_context_free (context);
}
-void
+static void
arg_test5 (void)
{
GOptionContext *context;
@@ -580,7 +580,7 @@ arg_test5 (void)
g_option_context_free (context);
}
-void
+static void
arg_test6 (void)
{
GOptionContext *context;
@@ -619,7 +619,7 @@ callback_parse1 (const gchar *option_name, const gchar *value,
return TRUE;
}
-void
+static void
callback_test1 (void)
{
GOptionContext *context;
@@ -657,7 +657,7 @@ callback_parse2 (const gchar *option_name, const gchar *value,
return TRUE;
}
-void
+static void
callback_test2 (void)
{
GOptionContext *context;
@@ -697,7 +697,7 @@ callback_parse_optional (const gchar *option_name, const gchar *value,
return TRUE;
}
-void
+static void
callback_test_optional_1 (void)
{
GOptionContext *context;
@@ -730,7 +730,7 @@ callback_test_optional_1 (void)
g_option_context_free (context);
}
-void
+static void
callback_test_optional_2 (void)
{
GOptionContext *context;
@@ -763,7 +763,7 @@ callback_test_optional_2 (void)
g_option_context_free (context);
}
-void
+static void
callback_test_optional_3 (void)
{
GOptionContext *context;
@@ -797,7 +797,7 @@ callback_test_optional_3 (void)
}
-void
+static void
callback_test_optional_4 (void)
{
GOptionContext *context;
@@ -830,7 +830,7 @@ callback_test_optional_4 (void)
g_option_context_free (context);
}
-void
+static void
callback_test_optional_5 (void)
{
GOptionContext *context;
@@ -865,7 +865,7 @@ callback_test_optional_5 (void)
g_option_context_free (context);
}
-void
+static void
callback_test_optional_6 (void)
{
GOptionContext *context;
@@ -900,7 +900,7 @@ callback_test_optional_6 (void)
g_option_context_free (context);
}
-void
+static void
callback_test_optional_7 (void)
{
GOptionContext *context;
@@ -935,7 +935,7 @@ callback_test_optional_7 (void)
g_option_context_free (context);
}
-void
+static void
callback_test_optional_8 (void)
{
GOptionContext *context;
@@ -970,7 +970,7 @@ callback_test_optional_8 (void)
g_option_context_free (context);
}
-void
+static void
callback_test_optional_9 (void)
{
GOptionContext *context;
@@ -1000,7 +1000,7 @@ callback_test_optional_9 (void)
g_option_context_free (context);
}
-void
+static void
callback_test_optional_10 (void)
{
GOptionContext *context;
@@ -1039,7 +1039,7 @@ callback_remaining_test1_callback (const gchar *option_name, const gchar *value,
return TRUE;
}
-void
+static void
callback_remaining_test1 (void)
{
GOptionContext *context;
@@ -1149,7 +1149,7 @@ callback_returns_false (void)
}
-void
+static void
ignore_test1 (void)
{
GOptionContext *context;
@@ -1184,7 +1184,7 @@ ignore_test1 (void)
g_option_context_free (context);
}
-void
+static void
ignore_test2 (void)
{
GOptionContext *context;
@@ -1217,7 +1217,7 @@ ignore_test2 (void)
g_option_context_free (context);
}
-void
+static void
ignore_test3 (void)
{
GOptionContext *context;
@@ -1256,7 +1256,7 @@ ignore_test3 (void)
}
void
-array_test1 (void)
+static array_test1 (void)
{
GOptionContext *context;
gboolean retval;
@@ -1288,7 +1288,7 @@ array_test1 (void)
g_option_context_free (context);
}
-void
+static void
add_test1 (void)
{
GOptionContext *context;
@@ -1307,7 +1307,7 @@ add_test1 (void)
g_option_context_free (context);
}
-void
+static void
empty_test2 (void)
{
GOptionContext *context;
@@ -1318,7 +1318,7 @@ empty_test2 (void)
g_option_context_free (context);
}
-void
+static void
empty_test3 (void)
{
GOptionContext *context;
@@ -1335,7 +1335,7 @@ empty_test3 (void)
}
/* check that non-option arguments are left in argv by default */
-void
+static void
rest_test1 (void)
{
GOptionContext *context;
@@ -1370,7 +1370,7 @@ rest_test1 (void)
}
/* check that -- works */
-void
+static void
rest_test2 (void)
{
GOptionContext *context;
@@ -1406,7 +1406,7 @@ rest_test2 (void)
}
/* check that -- stripping works */
-void
+static void
rest_test2a (void)
{
GOptionContext *context;
@@ -1440,7 +1440,7 @@ rest_test2a (void)
g_option_context_free (context);
}
-void
+static void
rest_test2b (void)
{
GOptionContext *context;
@@ -1475,7 +1475,7 @@ rest_test2b (void)
g_option_context_free (context);
}
-void
+static void
rest_test2c (void)
{
GOptionContext *context;
@@ -1509,7 +1509,7 @@ rest_test2c (void)
g_option_context_free (context);
}
-void
+static void
rest_test2d (void)
{
GOptionContext *context;
@@ -1545,7 +1545,7 @@ rest_test2d (void)
/* check that G_OPTION_REMAINING collects non-option arguments */
-void
+static void
rest_test3 (void)
{
GOptionContext *context;
@@ -1583,7 +1583,7 @@ rest_test3 (void)
/* check that G_OPTION_REMAINING and -- work together */
-void
+static void
rest_test4 (void)
{
GOptionContext *context;
@@ -1620,7 +1620,7 @@ rest_test4 (void)
}
/* test that G_OPTION_REMAINING works with G_OPTION_ARG_FILENAME_ARRAY */
-void
+static void
rest_test5 (void)
{
GOptionContext *context;
@@ -1656,7 +1656,7 @@ rest_test5 (void)
g_option_context_free (context);
}
-void
+static void
unknown_short_test (void)
{
GOptionContext *context;
@@ -1682,7 +1682,8 @@ unknown_short_test (void)
}
/* test that lone dashes are treated as non-options */
-void lonely_dash_test (void)
+static void
+lonely_dash_test (void)
{
GOptionContext *context;
gboolean retval;
@@ -1707,7 +1708,7 @@ void lonely_dash_test (void)
g_option_context_free (context);
}
-void
+static void
missing_arg_test (void)
{
GOptionContext *context;
@@ -1755,7 +1756,7 @@ static gboolean cb (const gchar *option_name,
return TRUE;
}
-void
+static void
dash_arg_test (void)
{
GOptionContext *context;
diff --git a/glib/tests/sequence.c b/glib/tests/sequence.c
index 029f12b..b961548 100644
--- a/glib/tests/sequence.c
+++ b/glib/tests/sequence.c
@@ -55,7 +55,7 @@ check_node (GSequenceNode *node)
}
}
-void
+static void
g_sequence_check (GSequence *seq)
{
GSequenceNode *node = seq->end_node;
diff --git a/glib/tests/slice.c b/glib/tests/slice.c
index c1f81ab..9f4670c 100644
--- a/glib/tests/slice.c
+++ b/glib/tests/slice.c
@@ -1,6 +1,6 @@
#include <glib.h>
-void
+static void
test_slice_config (void)
{
if (g_test_trap_fork (1000000, G_TEST_TRAP_SILENCE_STDERR))
diff --git a/glib/tests/strfuncs.c b/glib/tests/strfuncs.c
index 3c51e2e..1dd2fca 100644
--- a/glib/tests/strfuncs.c
+++ b/glib/tests/strfuncs.c
@@ -854,7 +854,7 @@ test_strv_length (void)
static char *locales[] = {"sv_SE", "en_US", "fa_IR", "C", "ru_RU"};
-void
+static void
check_strtod_string (gchar *number,
double res,
gboolean check_end,
diff --git a/glib/tests/string.c b/glib/tests/string.c
index 9a5944c..3d5d26e 100644
--- a/glib/tests/string.c
+++ b/glib/tests/string.c
@@ -106,7 +106,7 @@ test_string_new (void)
g_string_free (string2, TRUE);
}
-void
+static void
my_string_printf (GString *string,
const gchar *format,
...)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]