diff options
author | Bruno Haible <bruno@clisp.org> | 2004-09-07 11:49:00 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:11:54 +0200 |
commit | 0c65102f0edb29e3b1d644cc167f1113c17e4440 (patch) | |
tree | 544bd2e128340d6fe083029afa4601bd6a47149d /gettext-tools/src/format-qt.c | |
parent | 5eab4880854b4ca997214acf024307eee15508ed (diff) | |
download | external_gettext-0c65102f0edb29e3b1d644cc167f1113c17e4440.zip external_gettext-0c65102f0edb29e3b1d644cc167f1113c17e4440.tar.gz external_gettext-0c65102f0edb29e3b1d644cc167f1113c17e4440.tar.bz2 |
Change the calling convention of the formatstring_parser's 'check' method.
Add format string checking facility to the gettextpo library.
Diffstat (limited to 'gettext-tools/src/format-qt.c')
-rw-r--r-- | gettext-tools/src/format-qt.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/gettext-tools/src/format-qt.c b/gettext-tools/src/format-qt.c index 6cd174f..d8116f5 100644 --- a/gettext-tools/src/format-qt.c +++ b/gettext-tools/src/format-qt.c @@ -26,8 +26,6 @@ #include "format.h" #include "xalloc.h" #include "xerror.h" -#include "error.h" -#include "error-progname.h" #include "gettext.h" #define _(str) gettext (str) @@ -110,8 +108,9 @@ format_get_number_of_directives (void *descr) } static bool -format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, - bool equality, bool noisy, const char *pretty_msgstr) +format_check (void *msgid_descr, void *msgstr_descr, bool equality, + formatstring_error_logger_t error_logger, + const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -127,16 +126,11 @@ format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, yield a "Argument missing" warning at runtime. */ if (arg_used1 != arg_used2) { - if (noisy) - { - error_with_progname = false; - error_at_line (0, 0, pos->file_name, pos->line_number, - arg_used1 - ? _("a format specification for argument %u doesn't exist in '%s'") - : _("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"), - i, pretty_msgstr); - error_with_progname = true; - } + if (error_logger) + error_logger (arg_used1 + ? _("a format specification for argument %u doesn't exist in '%s'") + : _("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"), + i, pretty_msgstr); err = true; break; } |