sh-quote, execute, spawn-pipe, etc.: Make better use of 'const'.
commitc893594d0c33139efbc8d75e43eaed487116b58b
authorBruno Haible <bruno@clisp.org>
Sat, 12 Dec 2020 03:18:54 +0000 (12 04:18 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 12 Dec 2020 03:18:54 +0000 (12 04:18 +0100)
tree6e8f5d55f44b65d6e9567822b5da2cbf24351fbf
parent46c7e327c76f115bbdc6eee75fffa382559aa9d8
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.
25 files changed:
ChangeLog
NEWS
lib/csharpcomp.c
lib/csharpexec.c
lib/csharpexec.h
lib/execute.c
lib/execute.h
lib/javacomp.c
lib/javaexec.c
lib/javaexec.h
lib/javaversion.c
lib/os2-spawn.c
lib/os2-spawn.h
lib/pipe-filter-gi.c
lib/pipe-filter-ii.c
lib/pipe-filter.h
lib/sh-quote.c
lib/sh-quote.h
lib/spawn-pipe.c
lib/spawn-pipe.h
lib/windows-spawn.c
lib/windows-spawn.h
tests/test-execute-main.c
tests/test-sh-quote.c
tests/test-spawn-pipe-main.c