From 202cd3c17c367dfb2be4939e61bb4ef6712a5e7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 9 Sep 2012 18:29:40 +0100 Subject: [PATCH] install-plugins: constify _install_*sync() details array arguments --- gst-libs/gst/pbutils/install-plugins.c | 12 +++++++----- gst-libs/gst/pbutils/install-plugins.h | 4 ++-- tests/check/libs/pbutils.c | 7 +++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/gst-libs/gst/pbutils/install-plugins.c b/gst-libs/gst/pbutils/install-plugins.c index 58a2c81..2ba46d9 100644 --- a/gst-libs/gst/pbutils/install-plugins.c +++ b/gst-libs/gst/pbutils/install-plugins.c @@ -489,7 +489,7 @@ ptr_array_contains_string (GPtrArray * arr, const gchar * s) } static gboolean -gst_install_plugins_spawn_child (gchar ** details, +gst_install_plugins_spawn_child (const gchar * const *details, GstInstallPluginsContext * ctx, GPid * child_pid, gint * exit_status) { GPtrArray *arr; @@ -511,7 +511,7 @@ gst_install_plugins_spawn_child (gchar ** details, /* finally, add the detail strings, but without duplicates */ while (details != NULL && details[0] != NULL) { if (!ptr_array_contains_string (arr, details[0])) - g_ptr_array_add (arr, details[0]); + g_ptr_array_add (arr, (gpointer) details[0]); ++details; } @@ -618,8 +618,9 @@ gst_install_plugins_installer_exited (GPid pid, gint status, gpointer data) */ GstInstallPluginsReturn -gst_install_plugins_async (gchar ** details, GstInstallPluginsContext * ctx, - GstInstallPluginsResultFunc func, gpointer user_data) +gst_install_plugins_async (const gchar * const *details, + GstInstallPluginsContext * ctx, GstInstallPluginsResultFunc func, + gpointer user_data) { GstInstallPluginsAsyncHelper *helper; GPid pid; @@ -665,7 +666,8 @@ gst_install_plugins_async (gchar ** details, GstInstallPluginsContext * ctx, * Returns: the result of the installation. */ GstInstallPluginsReturn -gst_install_plugins_sync (gchar ** details, GstInstallPluginsContext * ctx) +gst_install_plugins_sync (const gchar * const *details, + GstInstallPluginsContext * ctx) { gint status; diff --git a/gst-libs/gst/pbutils/install-plugins.h b/gst-libs/gst/pbutils/install-plugins.h index 9fddbd0..173adb1 100644 --- a/gst-libs/gst/pbutils/install-plugins.h +++ b/gst-libs/gst/pbutils/install-plugins.h @@ -118,12 +118,12 @@ GType gst_install_plugins_context_get_type (void); typedef void (*GstInstallPluginsResultFunc) (GstInstallPluginsReturn result, gpointer user_data); -GstInstallPluginsReturn gst_install_plugins_async (gchar ** details, +GstInstallPluginsReturn gst_install_plugins_async (const gchar * const * details, GstInstallPluginsContext * ctx, GstInstallPluginsResultFunc func, gpointer user_data); -GstInstallPluginsReturn gst_install_plugins_sync (gchar ** details, +GstInstallPluginsReturn gst_install_plugins_sync (const gchar * const * details, GstInstallPluginsContext * ctx); const gchar * gst_install_plugins_return_get_name (GstInstallPluginsReturn ret); diff --git a/tests/check/libs/pbutils.c b/tests/check/libs/pbutils.c index 888be16..e6c5fac 100644 --- a/tests/check/libs/pbutils.c +++ b/tests/check/libs/pbutils.c @@ -480,7 +480,7 @@ result_cb (GstInstallPluginsReturn result, gpointer user_data) /* make sure our script gets called with the right parameters */ static void -test_pb_utils_install_plugins_do_callout (gchar ** details, +test_pb_utils_install_plugins_do_callout (const gchar * const *details, GstInstallPluginsContext * ctx, const gchar * script, GstInstallPluginsReturn expected_result) { @@ -548,9 +548,8 @@ GST_START_TEST (test_pb_utils_install_plugins) { GstInstallPluginsContext *ctx; GstInstallPluginsReturn ret; - gchar *details[] = { (char *) "detail1", (char *) "detail2", NULL }; - gchar *details_multi[] = - { (char *) "detail1", (char *) "detail1", (char *) "detail2", NULL }; + const gchar *details[] = { "detail1", "detail2", NULL }; + const gchar *details_multi[] = { "detail1", "detail1", "detail2", NULL }; ctx = gst_install_plugins_context_new (); -- 2.7.4