]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Tweak comments.
authorBruno Haible <bruno@clisp.org>
Wed, 7 Jun 2023 23:30:24 +0000 (01:30 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 7 Jun 2023 23:30:24 +0000 (01:30 +0200)
17 files changed:
gettext-tools/src/format-awk.c
gettext-tools/src/format-boost.c
gettext-tools/src/format-c-parse.h
gettext-tools/src/format-elisp.c
gettext-tools/src/format-gcc-internal.c
gettext-tools/src/format-java-printf.c
gettext-tools/src/format-java.c
gettext-tools/src/format-javascript.c
gettext-tools/src/format-kde.c
gettext-tools/src/format-librep.c
gettext-tools/src/format-pascal.c
gettext-tools/src/format-perl.c
gettext-tools/src/format-php.c
gettext-tools/src/format-python.c
gettext-tools/src/format-ruby.c
gettext-tools/src/format-sh.c
gettext-tools/src/format-tcl.c

index 39d267b84fcee957e9fe179815993c284448ccfc..bcf43540b9040e4a68b5f8f7ff1a18f27113d39a 100644 (file)
@@ -1,5 +1,5 @@
 /* awk format strings.
-   Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2002.
 
    This program is free software: you can redistribute it and/or modify
@@ -108,6 +108,7 @@ format_parse (const char *format, bool translated, char *fdi,
   unnumbered_arg_count = 0;
 
   for (; *format != '\0';)
+    /* Invariant: spec.numbered_arg_count == 0 || unnumbered_arg_count == 0.  */
     if (*format++ == '%')
       {
         /* A directive.  */
@@ -493,7 +494,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index 3f3b9781effb91af570c1f48bb1e1b14698c060e..71680239d981d63b2b5e1422f539ae161cd8fff0 100644 (file)
@@ -1,5 +1,5 @@
 /* Boost format strings.
-   Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -129,6 +129,7 @@ format_parse (const char *format, bool translated, char *fdi,
   unnumbered_arg_count = 0;
 
   for (; *format != '\0';)
+    /* Invariant: spec.numbered_arg_count == 0 || unnumbered_arg_count == 0.  */
     if (*format++ == '%')
       {
         /* A directive.  */
@@ -602,7 +603,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index 2e164222aca5546fc13955abeff1456a6c323dc6..42d2e1d2912f473f89ddafc23337ff82967c8c68 100644 (file)
@@ -198,6 +198,7 @@ format_parse_entrails (const char *format, bool translated,
   allocated = 0;
 
   for (; *format != '\0';)
+    /* Invariant: spec.unnumbered_arg_count == 0 || numbered_arg_count == 0.  */
     if (*format++ == '%')
       {
         /* A directive.  */
index 346c7f6635b6384ccbc56dd52dae92e88e237ac5..01ea279df564586bf44b0e7c6dad768020de7d03 100644 (file)
@@ -332,7 +332,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index 18325cc81a42908b09504b7473bd0e92c37b6591..9dbd99b13748bc7d07cadbc6ffc89d88f0afacdd 100644 (file)
@@ -1,5 +1,5 @@
 /* GCC internal format strings.
-   Copyright (C) 2003-2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2003-2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -174,6 +174,7 @@ format_parse (const char *format, bool translated, char *fdi,
   unnumbered_arg_count = 0;
 
   for (; *format != '\0';)
+    /* Invariant: spec.numbered_arg_count == 0 || unnumbered_arg_count == 0.  */
     if (*format++ == '%')
       {
         /* A directive.  */
@@ -611,7 +612,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index 64452f8a331cb2968dc14362b3425c1e4cd2f8c9..580fb3b0762bd76c30f152b68ee4756a0dfa0991 100644 (file)
@@ -1,6 +1,5 @@
 /* Java printf format strings.
-   Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2018-2020 Free Software
-   Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2018-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -564,7 +563,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index cd117850e781d308cd77f82d8af97b10232eae60..bba2a4308920483a5b7e763c4f8dddb0ef8853fe 100644 (file)
@@ -1,5 +1,5 @@
 /* Java MessageFormat format strings.
-   Copyright (C) 2001-2004, 2006-2007, 2009, 2019 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007, 2009, 2019, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -730,7 +730,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index c359c24755057ae7c7d540db37f26b00730c5437..0f716c9bb96ed937113781ee311a5e54d9997f93 100644 (file)
@@ -1,5 +1,5 @@
 /* JavaScript format strings.
-   Copyright (C) 2001-2004, 2006-2010, 2013, 2016, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2010, 2013, 2016, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Andreas Stricker <andy@knitter.ch>, 2010.
    It's based on python format module from Bruno Haible.
 
@@ -110,6 +110,7 @@ format_parse (const char *format, bool translated, char *fdi,
   unnumbered_arg_count = 0;
 
   for (; *format != '\0';)
+    /* Invariant: spec.numbered_arg_count == 0 || unnumbered_arg_count == 0.  */
     if (*format++ == '%')
       {
         /* A directive.  */
@@ -340,7 +341,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index b8ad4f26cb604402ac0495a6fd5ae5655976a282..9fa1ecb3d1bc28adbad4baea080acc08adc5d044 100644 (file)
@@ -1,5 +1,5 @@
 /* KDE format strings.
-   Copyright (C) 2003-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2003-2004, 2006-2007, 2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software: you can redistribute it and/or modify
@@ -207,7 +207,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n2 = spec2->numbered_arg_count;
       unsigned int missing = 0; /* only used if !equality */
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index ed2cb39c04cd7ff6a7bd56b1555a28be62b5951e..948ce0135bb79c38a1d507cee913fa0f319ab2c4 100644 (file)
@@ -1,5 +1,5 @@
 /* librep format strings.
-   Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -296,7 +296,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index a217afa1ff99dd99abeabd52d2fd72c1a5fde7db..d5ba4a860076436633fac171f34b364260e51a96 100644 (file)
@@ -1,6 +1,5 @@
 /* Object Pascal format strings.
-   Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2018-2020 Free Software
-   Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007, 2009-2010, 2018-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -380,7 +379,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index 10bc82e4a102d3ad3612082336a0c6f8e86fdbc4..0a8a78c9eafb1ecec601dac903cbe09f702f459b 100644 (file)
@@ -1,5 +1,5 @@
 /* Perl format strings.
-   Copyright (C) 2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2007, 2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -566,7 +566,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index 6c07d2c2c719a63b8e45655b2d008083b9da7528..668b13c0468fbf6a84c833cbb5465e21b75444bf 100644 (file)
@@ -1,5 +1,5 @@
 /* PHP format strings.
-   Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2002.
 
    This program is free software: you can redistribute it and/or modify
@@ -332,7 +332,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index e1499ea7e82d62a916941429028a1904a8e03b4b..aac84e6f3660a63acfe8b0e97f0ee354fd34c6c7 100644 (file)
@@ -1,5 +1,5 @@
 /* Python format strings.
-   Copyright (C) 2001-2004, 2006-2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -446,7 +446,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
           unsigned int n1 = spec1->named_arg_count;
           unsigned int n2 = spec2->named_arg_count;
 
-          /* Check the argument names are the same.
+          /* Check that the argument names are the same.
              Both arrays are sorted.  We search for the first difference.  */
           for (i = 0, j = 0; i < n1 || j < n2; )
             {
index 729b9ded245b0b1f9fdba06879a7e24c71ae8dec..537b7bd5ace0c76f9becc2f3273e3cb280e61ac4 100644 (file)
@@ -1,5 +1,5 @@
 /* Ruby format strings.
-   Copyright (C) 2001-2004, 2006-2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2020.
 
    This program is free software: you can redistribute it and/or modify
@@ -170,6 +170,7 @@ format_parse (const char *format, bool translated, char *fdi,
   allocated = 0;
 
   for (; *format != '\0';)
+    /* Invariant: spec.numbered_arg_count == 0 || unnumbered_arg_count == 0.  */
     if (*format++ == '%')
       {
         /* A directive.  */
@@ -884,7 +885,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
           unsigned int n1 = spec1->named_arg_count;
           unsigned int n2 = spec2->named_arg_count;
 
-          /* Check the argument names are the same.
+          /* Check that the argument names are the same.
              Both arrays are sorted.  We search for the first difference.  */
           for (i = 0, j = 0; i < n1 || j < n2; )
             {
index 640d3141277a7011fad7744741fc2797c8c3f20b..ce6bf3fb3355afe1cd28f3b5f41b062d6843de70 100644 (file)
@@ -1,5 +1,5 @@
 /* Shell format strings.
-   Copyright (C) 2003-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2003-2004, 2006-2007, 2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -283,7 +283,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->named_arg_count;
       unsigned int n2 = spec2->named_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument names are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {
index 46630b2273368ec2c8534c6966abc68ddd13b403..a1d87b30134e55dec298d0d1fd2dd88e88464d42 100644 (file)
@@ -1,5 +1,5 @@
 /* Tcl format strings.
-   Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020, 2023 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2002.
 
    This program is free software: you can redistribute it and/or modify
@@ -116,6 +116,7 @@ format_parse (const char *format, bool translated, char *fdi,
   number = 1;
 
   for (; *format != '\0';)
+    /* Invariant: !seen_numbered_arg || !seen_unnumbered_arg.  */
     if (*format++ == '%')
       {
         /* A directive.  */
@@ -374,7 +375,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
       unsigned int n1 = spec1->numbered_arg_count;
       unsigned int n2 = spec2->numbered_arg_count;
 
-      /* Check the argument names are the same.
+      /* Check that the argument numbers are the same.
          Both arrays are sorted.  We search for the first difference.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
         {