summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2021-02-15 14:27:31 +0000
committerPhilip Withnall <pwithnall@endlessos.org>2021-02-16 13:44:00 +0000
commiteebb66280d14ddfeb3545ac98c7be04a337d95ce (patch)
treecb181303c5d8dae9ff52236cc6952b8ab4af71bb
parentea9fd4c2f24b20e55a842248d196534ea4229b80 (diff)
downloadglib-eebb66280d14ddfeb3545ac98c7be04a337d95ce.tar.gz
gspawn-win32: Various minor internal const-correctness fixes
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-rw-r--r--glib/gspawn-win32.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/glib/gspawn-win32.c b/glib/gspawn-win32.c
index 104d5f383..0f6579eab 100644
--- a/glib/gspawn-win32.c
+++ b/glib/gspawn-win32.c
@@ -191,8 +191,8 @@ protect_argv_string (const gchar *string)
}
static gint
-protect_argv (gchar **argv,
- gchar ***new_argv)
+protect_argv (const gchar * const *argv,
+ gchar ***new_argv)
{
gint i;
gint argc = 0;
@@ -398,10 +398,10 @@ set_child_error (gintptr report[2],
}
static gboolean
-utf8_charv_to_wcharv (char **utf8_charv,
- wchar_t ***wcharv,
- int *error_index,
- GError **error)
+utf8_charv_to_wcharv (const gchar * const *utf8_charv,
+ wchar_t ***wcharv,
+ int *error_index,
+ GError **error)
{
wchar_t **retval = NULL;
@@ -436,16 +436,16 @@ utf8_charv_to_wcharv (char **utf8_charv,
static gboolean
do_spawn_directly (gint *exit_status,
- gboolean do_return_handle,
- GSpawnFlags flags,
- gchar **argv,
- char **envp,
- char **protected_argv,
- GPid *child_pid,
- GError **error)
+ gboolean do_return_handle,
+ GSpawnFlags flags,
+ const gchar * const *argv,
+ const gchar * const *envp,
+ const gchar * const *protected_argv,
+ GPid *child_pid,
+ GError **error)
{
const int mode = (exit_status == NULL) ? P_NOWAIT : P_WAIT;
- char **new_argv;
+ const gchar * const *new_argv;
gintptr rc = -1;
int errsv;
GError *conv_error = NULL;
@@ -612,7 +612,7 @@ fork_exec (gint *exit_status,
/* We can do without the helper process */
gboolean retval =
do_spawn_directly (exit_status, do_return_handle, flags,
- argv, envp, protected_argv,
+ argv, envp, (const gchar * const *) protected_argv,
child_pid, error);
g_strfreev (protected_argv);
return retval;
@@ -746,7 +746,7 @@ fork_exec (gint *exit_status,
g_print ("argv[%d]: %s\n", i, (new_argv[i] ? new_argv[i] : "NULL"));
}
- if (!utf8_charv_to_wcharv (new_argv, &wargv, &conv_error_index, &conv_error))
+ if (!utf8_charv_to_wcharv ((const gchar * const *) new_argv, &wargv, &conv_error_index, &conv_error))
{
if (conv_error_index == ARG_WORKING_DIRECTORY)
g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_CHDIR,