summaryrefslogtreecommitdiff
path: root/lib/csharpexec.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-12-12 04:18:54 +0100
committerBruno Haible <bruno@clisp.org>2020-12-12 04:18:54 +0100
commitc893594d0c33139efbc8d75e43eaed487116b58b (patch)
tree6e8f5d55f44b65d6e9567822b5da2cbf24351fbf /lib/csharpexec.c
parent46c7e327c76f115bbdc6eee75fffa382559aa9d8 (diff)
downloadgnulib-c893594d0c33139efbc8d75e43eaed487116b58b.tar.gz
sh-quote, execute, spawn-pipe, etc.: Make better use of 'const'.
* lib/sh-quote.h (shell_quote_argv): Does not need write access to the elements of argv. * lib/sh-quote.c (shell_quote_argv): Likewise. * lib/windows-spawn.h (prepare_spawn): Add 'const' the argument type and the return type. * lib/windows-spawn.c (prepare_spawn): Likewise. * lib/os2-spawn.h (prepare_spawn): Likewise. * lib/os2-spawn.c (prepare_spawn): Likewise. * lib/execute.h (execute): Does not need write access to the elements of prog_argv. * lib/execute.c (execute): Likewise. * lib/spawn-pipe.h (create_pipe_out, create_pipe_in, create_pipe_bidi): Likewise. * lib/spawn-pipe.c (create_pipe, create_pipe_bidi, create_pipe_in, create_pipe_out): Likewise. * lib/pipe-filter.h (pipe_filter_ii_execute, pipe_filter_gi_create): Likewise. * lib/pipe-filter-ii.c (pipe_filter_ii_execute): Likewise. * lib/pipe-filter-gi.c (pipe_filter_gi_create): Likewise. * lib/javaexec.h (execute_fn): Does not need write access to the elements of prog_argv. * lib/javaexec.c (execute_java_class): Update variable types and remove casts to 'char *'. * lib/csharpexec.h (execute_fn): Does not need write access to the elements of prog_argv. * lib/csharpexec.c (execute_csharp_using_mono, execute_csharp_using_sscli): Update variable types and remove casts to 'char *'. * lib/javacomp.c (compile_using_envjavac, compile_using_gcj, compile_using_javac, compile_using_jikes, is_envjavac_gcj, is_envjavac_gcj43, is_gcj_present, is_gcj_43, is_javac_present, is_jikes_present): Update variable types and remove casts to 'char *'. * lib/javaversion.c (execute_and_read_line): Does not need write access to the elements of prog_argv. * lib/csharpcomp.c (compile_csharp_using_mono, compile_csharp_using_sscli): Update variable types and remove casts to 'char *'. * tests/test-sh-quote.c (main): Update variable types and remove casts to 'char *'. * tests/test-execute-main.c (main): Update variable types and remove casts to 'char *'. * tests/test-spawn-pipe-main.c (test_pipe): Update variable types and remove casts to 'char *'. * NEWS: Mention the changes.
Diffstat (limited to 'lib/csharpexec.c')
-rw-r--r--lib/csharpexec.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/csharpexec.c b/lib/csharpexec.c
index 5e2aa2c753..b6fcc47333 100644
--- a/lib/csharpexec.c
+++ b/lib/csharpexec.c
@@ -100,7 +100,7 @@ execute_csharp_using_mono (const char *assembly_path,
{
/* Test for presence of mono:
"mono --version >/dev/null 2>/dev/null" */
- char *argv[3];
+ const char *argv[3];
int exitstatus;
argv[0] = "mono";
@@ -116,7 +116,8 @@ execute_csharp_using_mono (const char *assembly_path,
if (mono_present)
{
char *old_monopath;
- char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
+ const char **argv =
+ (const char **) xmalloca ((2 + nargs + 1) * sizeof (const char *));
unsigned int i;
bool err;
@@ -124,9 +125,9 @@ execute_csharp_using_mono (const char *assembly_path,
old_monopath = set_monopath (libdirs, libdirs_count, false, verbose);
argv[0] = "mono";
- argv[1] = (char *) assembly_path;
+ argv[1] = assembly_path;
for (i = 0; i <= nargs; i++)
- argv[2 + i] = (char *) args[i];
+ argv[2 + i] = args[i];
if (verbose)
{
@@ -163,7 +164,7 @@ execute_csharp_using_sscli (const char *assembly_path,
{
/* Test for presence of clix:
"clix >/dev/null 2>/dev/null ; test $? = 1" */
- char *argv[2];
+ const char *argv[2];
int exitstatus;
argv[0] = "clix";
@@ -178,7 +179,8 @@ execute_csharp_using_sscli (const char *assembly_path,
if (clix_present)
{
char *old_clixpath;
- char **argv = (char **) xmalloca ((2 + nargs + 1) * sizeof (char *));
+ const char **argv =
+ (const char **) xmalloca ((2 + nargs + 1) * sizeof (const char *));
unsigned int i;
bool err;
@@ -186,9 +188,9 @@ execute_csharp_using_sscli (const char *assembly_path,
old_clixpath = set_clixpath (libdirs, libdirs_count, false, verbose);
argv[0] = "clix";
- argv[1] = (char *) assembly_path;
+ argv[1] = assembly_path;
for (i = 0; i <= nargs; i++)
- argv[2 + i] = (char *) args[i];
+ argv[2 + i] = args[i];
if (verbose)
{