X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdata-in.c;h=1e8fe67983350fefb5ae4ce117b312bbb0711f9f;hb=c489ad9041918ca8c80dadceade988daab1d25f8;hp=cc3a3e40775d63f134bbe71095ad82593ca59fc9;hpb=a19b858e0ac3c69e4a28c0ca6d8674427268a863;p=pspp-builds.git diff --git a/src/data/data-in.c b/src/data/data-in.c index cc3a3e40..1e8fe679 100644 --- a/src/data/data-in.c +++ b/src/data/data-in.c @@ -39,8 +39,6 @@ #include "gettext.h" #define _(msgid) gettext (msgid) - -#include /* Specialized error routine. */ @@ -50,26 +48,26 @@ static void dls_error (const struct data_in *, const char *format, ...) static void vdls_error (const struct data_in *i, const char *format, va_list args) { - struct error e; - struct string title; + struct msg m; + struct string text; if (i->flags & DI_IGNORE_ERROR) return; - ds_init (&title, 64); + ds_init (&text, 64); if (i->f1 == i->f2) - ds_printf (&title, _("(column %d"), i->f1); + ds_printf (&text, _("(column %d"), i->f1); else - ds_printf (&title, _("(columns %d-%d"), i->f1, i->f2); - ds_printf (&title, _(", field type %s) "), fmt_to_string (&i->format)); - - e.class = DE; - err_location (&e.where); - e.title = ds_c_str (&title); + ds_printf (&text, _("(columns %d-%d"), i->f1, i->f2); + ds_printf (&text, _(", field type %s) "), fmt_to_string (&i->format)); + ds_vprintf (&text, format, args); - err_vmsg (&e, format, args); + m.category = MSG_DATA; + m.severity = MSG_ERROR; + msg_location (&m.where); + m.text = ds_c_str (&text); - ds_destroy (&title); + msg_emit (&m); } static void @@ -570,10 +568,14 @@ parse_RB (struct data_in *i) return true; } + static inline bool parse_A (struct data_in *i) { - buf_copy_rpad (i->v->s, i->format.w, i->s, i->e - i->s); + const int bytes = width_to_bytes(i->format.w); + + copy_mangle (i->v->s, bytes, i->s, i->e - i->s); + return true; }