]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Update after gnulib changed.
authorBruno Haible <bruno@clisp.org>
Sat, 12 Dec 2020 12:30:15 +0000 (13:30 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Oct 2022 07:30:42 +0000 (09:30 +0200)
* 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 *'.

gettext-tools/src/msgexec.c
gettext-tools/src/msginit.c
gettext-tools/src/read-csharp.c
gettext-tools/src/read-java.c
gettext-tools/src/read-resources.c
gettext-tools/src/read-tcl.c
gettext-tools/src/urlget.c
gettext-tools/src/write-resources.c
gettext-tools/src/x-ruby.c

index c4ff14da2366f6526a56fbf4a699ba6a3751ed00..77494b2b78952ca2a35dabc2f3c7eaf1e8cdc219 100644 (file)
@@ -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 */
index bd17a08a7132dd233604834634a0a3740e73fb5e..8ca9a3b77f3a1f5e46da2fd3ee628a4dc9d55fa5 100644 (file)
@@ -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,
index 2db0602fc1921e6f75bd8a3264907244c0a453dc..c6723a15cb6c3d0edc6f247ac5368d6e38a3bf80 100644 (file)
@@ -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;
index 5af0501071b665e11e979bb08ded3820e2353044..be2ce1634419a6010c62f921cb4af1e7654d5ea9 100644 (file)
@@ -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;
index c0c5e360b36ca0ce28665f5abd44af655d8fde69..edb4763ad68a723cb56b63a00c38f29e9697159d 100644 (file)
@@ -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;
index 0cb95044e69e1e9b3b6ea22f4130877bc50a9161..fce245e059ed506055a795b0336679822ffc8d18 100644 (file)
@@ -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;
index e8c03c179c5a43012ea95d6a0e23b5666965fee8..04196c2d57a8273d8f8b4f2f4c57b1506dd67115 100644 (file)
@@ -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);
index 3a0c3c3ff95cce0cc9a192448b1bfd6289a6ad94..19cffd00459ed665f30962fc57a2af157b06b125 100644 (file)
@@ -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;
index 12a1a8e259b36df236f55dd2d7279387cb99f54b..e070122f4397e936a4a011864ff752ef1e6df0f6 100644 (file)
@@ -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;