X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fprint.c;h=262d5397f460114859ea6f9a48ae3ef7cb165fd8;hb=fd0958dc7caa5806b82b9757e2b937c5b7def369;hp=3c36b98bab9eb918e064f09e43a6907f73c84038;hpb=cbdfa35f7fb46948d1ee8aee7b7438cf1a5fd44c;p=pspp diff --git a/src/language/data-io/print.c b/src/language/data-io/print.c index 3c36b98bab..262d5397f4 100644 --- a/src/language/data-io/print.c +++ b/src/language/data-io/print.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -317,7 +317,8 @@ parse_variable_argument (const struct dictionary *dict, if (lex_is_number () || token == '(') { - if (!parse_var_placements (tmp_pool, var_cnt, &formats, &format_cnt)) + if (!parse_var_placements (tmp_pool, var_cnt, false, + &formats, &format_cnt)) return false; add_space = false; } @@ -345,7 +346,7 @@ parse_variable_argument (const struct dictionary *dict, struct prt_out_spec *spec; var = vars[var_idx++]; - if (!check_specifier_width (f, var->width, true)) + if (!fmt_check_width_compat (f, var->width)) return false; spec = pool_alloc (trns->pool, sizeof *spec); @@ -362,7 +363,8 @@ parse_variable_argument (const struct dictionary *dict, that usually contains a period. */ spec->sysmis_as_spaces = (which_formats == WRITE && var->type == NUMERIC - && !fmt_is_binary (spec->format.type)); + && (fmt_get_category (spec->format.type) + != FMT_CAT_BINARY)); ll_push_tail (&trns->specs, &spec->ll); @@ -397,6 +399,7 @@ dump_table (struct print_trns *trns, const struct file_handle *fh) row = 1; ll_for_each (spec, struct prt_out_spec, ll, &trns->specs) { + char fmt_string[FMT_STRING_LEN_MAX + 1]; int width; switch (spec->type) { @@ -408,7 +411,7 @@ dump_table (struct print_trns *trns, const struct file_handle *fh) case PRT_VAR: tab_text (t, 0, row, TAB_LEFT, spec->var->name); tab_text (t, 3, row, TAB_LEFT | TAB_FIX, - fmt_to_string (&spec->format)); + fmt_to_string (&spec->format, fmt_string)); width = spec->format.w; break; default: @@ -457,7 +460,7 @@ print_trns_proc (void *trns_, struct ccase *c, casenumber case_num UNUSED) const union value *input = case_data (c, spec->var->fv); char *output = ds_put_uninit (&trns->line, spec->format.w); if (!spec->sysmis_as_spaces || input->f != SYSMIS) - data_out (output, &spec->format, input); + data_out (input, &spec->format, output); else memset (output, ' ', spec->format.w); if (spec->add_space)