gettext API users: don't explicitly cast ngettext()'s "n"
Change a few stray users of the inline gettext.h Q_() function to stop casting its "n" argument, the vast majority of the users of that wrapper API use the implicit cast to "unsigned long". The ngettext() function (which Q_() resolves to) takes an "unsigned long int", and so does our Q_() wrapper for it, see0c9ea33b90
(i18n: add stub Q_() wrapper for ngettext, 2011-03-09). The function isn't ours, but provided by e.g. GNU libintl. This amends code added in added in7171a0b0cf
(index-pack: correct "len" type in unpack_data(), 2016-07-13). The cast it added for the printf format to die() was needed, but not the cast to Q_(). Likewise the casts in strbuf.c added in8f354a1fae
(l10n: localizable upload progress messages, 2019-07-02) and for builtin/merge-recursive.c inccf7813139
(i18n: merge-recursive: mark error messages for translation, 2016-09-15) weren't needed. In the latter case the cast was copy/pasted from the argument to warning() itself, added inb74d779bd9
(MinGW: Fix compiler warning in merge-recursive, 2009-05-23). The cast for warning() is needed, but not the one for ngettext()'s "n" argument. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
c2162907e9
commit
6f69325258
@ -583,7 +583,7 @@ static void *unpack_data(struct object_entry *obj,
|
||||
if (!n)
|
||||
die(Q_("premature end of pack file, %"PRIuMAX" byte missing",
|
||||
"premature end of pack file, %"PRIuMAX" bytes missing",
|
||||
(unsigned int)len),
|
||||
len),
|
||||
(uintmax_t)len);
|
||||
from += n;
|
||||
len -= n;
|
||||
|
Reference in New Issue
Block a user