From: Bruno Haible Date: Sat, 12 Dec 2020 12:30:15 +0000 (+0100) Subject: Update after gnulib changed. X-Git-Tag: v0.21.1~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50d359dae6ddff9a84bdc5bbc10f7ebea3d6cf83;p=thirdparty%2Fgettext.git Update after gnulib changed. * gettext-tools/src/read-csharp.c (execute_and_read_po_output): Does not need write access to the elements of prog_argv. * gettext-tools/src/read-java.c (execute_and_read_po_output): Likewise. * gettext-tools/src/read-resources.c (execute_and_read_po_output): Likewise. * gettext-tools/src/write-resources.c (execute_writing_input): Likewise. * gettext-tools/src/urlget.c (execute_it): Likewise. (fetch): Update variable types and remove casts to 'char *'. * gettext-tools/src/msginit.c (project_id, project_id_version, get_user_email, language_team_address, plural_forms): Likewise. * gettext-tools/src/read-tcl.c (msgdomain_read_tcl): Likewise. * gettext-tools/src/x-ruby.c (extract_ruby): Likewise. * gettext-tools/src/msgexec.c (sub_argv): Change type to 'const char **'. (main): Remove casts to 'char *'. --- diff --git a/gettext-tools/src/msgexec.c b/gettext-tools/src/msgexec.c index c4ff14da2..77494b2b7 100644 --- a/gettext-tools/src/msgexec.c +++ b/gettext-tools/src/msgexec.c @@ -69,7 +69,7 @@ static const char *sub_name; static const char *sub_path; /* Argument list for the subprogram. */ -static char **sub_argv; +static const char **sub_argv; static int sub_argc; static bool newline; @@ -201,7 +201,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\ /* Build argument list for the program. */ sub_argc = argc - optind; - sub_argv = XNMALLOC (sub_argc + 1, char *); + sub_argv = XNMALLOC (sub_argc + 1, const char *); for (i = 0; i < sub_argc; i++) sub_argv[i] = argv[optind + i]; sub_argv[i] = NULL; @@ -236,7 +236,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\ sub_path = find_in_path (sub_name); /* Finish argument list for the program. */ - sub_argv[0] = (char *) sub_path; + sub_argv[0] = sub_path; } exitcode = 0; /* = EXIT_SUCCESS */ diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c index bd17a08a7..8ca9a3b77 100644 --- a/gettext-tools/src/msginit.c +++ b/gettext-tools/src/msginit.c @@ -924,7 +924,7 @@ project_id (const char *header) { const char *gettextlibdir; char *prog; - char *argv[3]; + const char *argv[3]; pid_t child; int fd[1]; FILE *fp; @@ -1006,7 +1006,7 @@ project_id_version (const char *header) { const char *gettextlibdir; char *prog; - char *argv[4]; + const char *argv[4]; pid_t child; int fd[1]; FILE *fp; @@ -1178,7 +1178,7 @@ get_user_email () #if !(defined _WIN32 && ! defined __CYGWIN__) { const char *prog = relocate (LIBDIR "/gettext/user-email"); - char *argv[4]; + const char *argv[4]; pid_t child; int fd[1]; FILE *fp; @@ -1189,8 +1189,8 @@ get_user_email () /* Ask the user for his email address. */ argv[0] = BOURNE_SHELL; - argv[1] = (char *) prog; - argv[2] = (char *) _("\ + argv[1] = prog; + argv[2] = _("\ The new message catalog should contain your email address, so that users can\n\ give you feedback about the translations, and so that maintainers can contact\n\ you in case of unexpected technical problems.\n"); @@ -1284,7 +1284,7 @@ language_team_address () #if !(defined _WIN32 && ! defined __CYGWIN__) { const char *prog = relocate (PROJECTSDIR "/team-address"); - char *argv[7]; + const char *argv[7]; pid_t child; int fd[1]; FILE *fp; @@ -1295,11 +1295,11 @@ language_team_address () /* Call the team-address shell script. */ argv[0] = BOURNE_SHELL; - argv[1] = (char *) prog; - argv[2] = (char *) relocate (PROJECTSDIR); - argv[3] = (char *) relocate (LIBDIR "/gettext"); - argv[4] = (char *) catalogname; - argv[5] = (char *) language; + argv[1] = prog; + argv[2] = relocate (PROJECTSDIR); + argv[3] = relocate (LIBDIR "/gettext"); + argv[4] = catalogname; + argv[5] = language; argv[6] = NULL; child = create_pipe_in (prog, BOURNE_SHELL, argv, NULL, DEV_NULL, false, true, false, fd); @@ -1435,7 +1435,7 @@ plural_forms () { const char *gettextlibdir; char *dirs[3], *last_dir; - char *argv[4]; + const char *argv[4]; pid_t child; int fd[1]; FILE *fp; @@ -1466,7 +1466,7 @@ plural_forms () because on Cygwin in a build with --enable-shared, the libtool wrapper of cldr-plurals.exe apparently needs this. */ argv[0] = prog; - argv[1] = (char *) language; + argv[1] = language; argv[2] = last_dir; argv[3] = NULL; child = create_pipe_in (prog, prog, argv, NULL, diff --git a/gettext-tools/src/read-csharp.c b/gettext-tools/src/read-csharp.c index 2db0602fc..c6723a15c 100644 --- a/gettext-tools/src/read-csharp.c +++ b/gettext-tools/src/read-csharp.c @@ -54,7 +54,8 @@ struct locals static bool execute_and_read_po_output (const char *progname, - const char *prog_path, char **prog_argv, + const char *prog_path, + const char * const *prog_argv, void *private_data) { struct locals *l = (struct locals *) private_data; diff --git a/gettext-tools/src/read-java.c b/gettext-tools/src/read-java.c index 5af050107..be2ce1634 100644 --- a/gettext-tools/src/read-java.c +++ b/gettext-tools/src/read-java.c @@ -53,7 +53,8 @@ struct locals static bool execute_and_read_po_output (const char *progname, - const char *prog_path, char **prog_argv, + const char *prog_path, + const char * const *prog_argv, void *private_data) { struct locals *l = (struct locals *) private_data; diff --git a/gettext-tools/src/read-resources.c b/gettext-tools/src/read-resources.c index c0c5e360b..edb4763ad 100644 --- a/gettext-tools/src/read-resources.c +++ b/gettext-tools/src/read-resources.c @@ -55,7 +55,8 @@ struct locals static bool execute_and_read_po_output (const char *progname, - const char *prog_path, char **prog_argv, + const char *prog_path, + const char * const *prog_argv, void *private_data) { struct locals *l = (struct locals *) private_data; diff --git a/gettext-tools/src/read-tcl.c b/gettext-tools/src/read-tcl.c index 0cb95044e..fce245e05 100644 --- a/gettext-tools/src/read-tcl.c +++ b/gettext-tools/src/read-tcl.c @@ -56,7 +56,7 @@ msgdomain_read_tcl (const char *locale_name, const char *directory) char *frobbed_locale_name; char *p; char *file_name; - char *argv[4]; + const char *argv[4]; pid_t child; int fd[1]; FILE *fp; diff --git a/gettext-tools/src/urlget.c b/gettext-tools/src/urlget.c index e8c03c179..04196c2d5 100644 --- a/gettext-tools/src/urlget.c +++ b/gettext-tools/src/urlget.c @@ -246,7 +246,7 @@ static int java_exitcode; static bool execute_it (const char *progname, - const char *prog_path, char **prog_argv, + const char *prog_path, const char * const *prog_argv, void *private_data) { (void) private_data; @@ -314,7 +314,7 @@ fetch (const char *url, const char *file) if (!wget_tested) { /* Test for presence of wget: "wget --version > /dev/null" */ - char *argv[3]; + const char *argv[3]; int exitstatus; argv[0] = "wget"; @@ -328,7 +328,7 @@ fetch (const char *url, const char *file) if (wget_present) { - char *argv[10]; + const char *argv[10]; int exitstatus; argv[0] = "wget"; @@ -336,7 +336,7 @@ fetch (const char *url, const char *file) argv[2] = "--output-document"; argv[3] = "-"; argv[4] = "--timeout"; argv[5] = "30"; argv[6] = "--user-agent"; argv[7] = "urlget"; - argv[8] = (char *) url; + argv[8] = url; argv[9] = NULL; exitstatus = execute ("wget", "wget", argv, NULL, true, false, false, false, true, false, NULL); @@ -359,7 +359,7 @@ fetch (const char *url, const char *file) if (!lynx_tested) { /* Test for presence of lynx: "lynx --version > /dev/null" */ - char *argv[3]; + const char *argv[3]; int exitstatus; argv[0] = "lynx"; @@ -373,13 +373,13 @@ fetch (const char *url, const char *file) if (lynx_present) { - char *argv[5]; + const char *argv[5]; int exitstatus; argv[0] = "lynx"; argv[1] = "-useragent=urlget"; argv[2] = "-source"; - argv[3] = (char *) url; + argv[3] = url; argv[4] = NULL; exitstatus = execute ("lynx", "lynx", argv, NULL, true, false, false, false, true, false, NULL); @@ -402,7 +402,7 @@ fetch (const char *url, const char *file) if (!curl_tested) { /* Test for presence of curl: "curl --version > /dev/null" */ - char *argv[3]; + const char *argv[3]; int exitstatus; argv[0] = "curl"; @@ -416,13 +416,13 @@ fetch (const char *url, const char *file) if (curl_present) { - char *argv[6]; + const char *argv[6]; int exitstatus; argv[0] = "curl"; argv[1] = "--silent"; argv[2] = "--user-agent"; argv[3] = "urlget"; - argv[4] = (char *) url; + argv[4] = url; argv[5] = NULL; exitstatus = execute ("curl", "curl", argv, NULL, true, false, false, false, true, false, NULL); diff --git a/gettext-tools/src/write-resources.c b/gettext-tools/src/write-resources.c index 3a0c3c3ff..19cffd004 100644 --- a/gettext-tools/src/write-resources.c +++ b/gettext-tools/src/write-resources.c @@ -61,7 +61,7 @@ struct locals static bool execute_writing_input (const char *progname, - const char *prog_path, char **prog_argv, + const char *prog_path, const char * const *prog_argv, void *private_data) { struct locals *l = (struct locals *) private_data; diff --git a/gettext-tools/src/x-ruby.c b/gettext-tools/src/x-ruby.c index 12a1a8e25..e070122f4 100644 --- a/gettext-tools/src/x-ruby.c +++ b/gettext-tools/src/x-ruby.c @@ -94,7 +94,7 @@ extract_ruby (const char *real_filename, const char *logical_filename, mdlp2 = msgdomain_list_alloc (true); for (pass = 0; pass < 2; pass++) { - char *argv[4]; + const char *argv[4]; unsigned int i; pid_t child; int fd[1]; @@ -102,20 +102,20 @@ extract_ruby (const char *real_filename, const char *logical_filename, int exitstatus; /* Prepare arguments. */ - argv[0] = (char *) progname; + argv[0] = progname; i = 1; if (pass > 0) - argv[i++] = (char *) "--add-comments=xgettext:"; + argv[i++] = "--add-comments=xgettext:"; else { if (add_all_comments) - argv[i++] = (char *) "--add-comments"; + argv[i++] = "--add-comments"; else if (comment_tag != NULL) argv[i++] = xasprintf ("--add-comments=%s", comment_tag); } - argv[i++] = (char *) real_filename; + argv[i++] = real_filename; argv[i] = NULL;