From: Bruno Haible Date: Wed, 7 Jun 2023 23:30:24 +0000 (+0200) Subject: Tweak comments. X-Git-Tag: v0.22~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36ea306f3284a69641e1059f47374fb089692895;p=thirdparty%2Fgettext.git Tweak comments. --- diff --git a/gettext-tools/src/format-awk.c b/gettext-tools/src/format-awk.c index 39d267b84..bcf43540b 100644 --- a/gettext-tools/src/format-awk.c +++ b/gettext-tools/src/format-awk.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-boost.c b/gettext-tools/src/format-boost.c index 3f3b9781e..71680239d 100644 --- a/gettext-tools/src/format-boost.c +++ b/gettext-tools/src/format-boost.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-c-parse.h b/gettext-tools/src/format-c-parse.h index 2e164222a..42d2e1d29 100644 --- a/gettext-tools/src/format-c-parse.h +++ b/gettext-tools/src/format-c-parse.h @@ -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. */ diff --git a/gettext-tools/src/format-elisp.c b/gettext-tools/src/format-elisp.c index 346c7f663..01ea279df 100644 --- a/gettext-tools/src/format-elisp.c +++ b/gettext-tools/src/format-elisp.c @@ -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; ) { diff --git a/gettext-tools/src/format-gcc-internal.c b/gettext-tools/src/format-gcc-internal.c index 18325cc81..9dbd99b13 100644 --- a/gettext-tools/src/format-gcc-internal.c +++ b/gettext-tools/src/format-gcc-internal.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-java-printf.c b/gettext-tools/src/format-java-printf.c index 64452f8a3..580fb3b07 100644 --- a/gettext-tools/src/format-java-printf.c +++ b/gettext-tools/src/format-java-printf.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-java.c b/gettext-tools/src/format-java.c index cd117850e..bba2a4308 100644 --- a/gettext-tools/src/format-java.c +++ b/gettext-tools/src/format-java.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-javascript.c b/gettext-tools/src/format-javascript.c index c359c2475..0f716c9bb 100644 --- a/gettext-tools/src/format-javascript.c +++ b/gettext-tools/src/format-javascript.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-kde.c b/gettext-tools/src/format-kde.c index b8ad4f26c..9fa1ecb3d 100644 --- a/gettext-tools/src/format-kde.c +++ b/gettext-tools/src/format-kde.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-librep.c b/gettext-tools/src/format-librep.c index ed2cb39c0..948ce0135 100644 --- a/gettext-tools/src/format-librep.c +++ b/gettext-tools/src/format-librep.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-pascal.c b/gettext-tools/src/format-pascal.c index a217afa1f..d5ba4a860 100644 --- a/gettext-tools/src/format-pascal.c +++ b/gettext-tools/src/format-pascal.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-perl.c b/gettext-tools/src/format-perl.c index 10bc82e4a..0a8a78c9e 100644 --- a/gettext-tools/src/format-perl.c +++ b/gettext-tools/src/format-perl.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-php.c b/gettext-tools/src/format-php.c index 6c07d2c2c..668b13c04 100644 --- a/gettext-tools/src/format-php.c +++ b/gettext-tools/src/format-php.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-python.c b/gettext-tools/src/format-python.c index e1499ea7e..aac84e6f3 100644 --- a/gettext-tools/src/format-python.c +++ b/gettext-tools/src/format-python.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-ruby.c b/gettext-tools/src/format-ruby.c index 729b9ded2..537b7bd5a 100644 --- a/gettext-tools/src/format-ruby.c +++ b/gettext-tools/src/format-ruby.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-sh.c b/gettext-tools/src/format-sh.c index 640d31412..ce6bf3fb3 100644 --- a/gettext-tools/src/format-sh.c +++ b/gettext-tools/src/format-sh.c @@ -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 , 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; ) { diff --git a/gettext-tools/src/format-tcl.c b/gettext-tools/src/format-tcl.c index 46630b227..a1d87b301 100644 --- a/gettext-tools/src/format-tcl.c +++ b/gettext-tools/src/format-tcl.c @@ -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 , 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; ) {