From 7665da99ed70c1a5ffee47e99e1672244b444ed4 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 28 Sep 2009 20:12:54 +0200 Subject: [PATCH] Correct printf conversion specifiers for size_t types. --- src/data/dictionary.c | 2 +- src/language/data-io/file-handle.q | 2 +- src/language/data-io/print.c | 8 ++++---- src/language/stats/flip.c | 2 +- tests/libpspp/sparse-xarray-test.c | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 67af049b..ab653d87 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -119,7 +119,7 @@ dict_dump (const struct dictionary *d) { const struct variable *v = d->var[i]; - printf ("Name: %s;\tdict_idx: %d; case_idx: %d\n", + printf ("Name: %s;\tdict_idx: %zu; case_idx: %zu\n", var_get_name (v), var_get_dict_index (v), var_get_case_index (v)); diff --git a/src/language/data-io/file-handle.q b/src/language/data-io/file-handle.q index 3e053ed5..33aa1d16 100644 --- a/src/language/data-io/file-handle.q +++ b/src/language/data-io/file-handle.q @@ -129,7 +129,7 @@ cmd_file_handle (struct lexer *lexer, struct dataset *ds) { if (cmd.n_lrecl[0] == LONG_MIN) msg (SE, _("The specified file mode requires LRECL. " - "Assuming %d-character records."), + "Assuming %zu-character records."), properties.record_width); else if (cmd.n_lrecl[0] < 1 || cmd.n_lrecl[0] >= (1UL << 31)) msg (SE, _("Record length (%ld) must be between 1 and %lu bytes. " diff --git a/src/language/data-io/print.c b/src/language/data-io/print.c index e345477b..2cfa0177 100644 --- a/src/language/data-io/print.c +++ b/src/language/data-io/print.c @@ -435,12 +435,12 @@ dump_table (struct print_trns *trns, const struct file_handle *fh) } if (fh != NULL) - tab_title (t, ngettext ("Writing %d record to %s.", - "Writing %d records to %s.", trns->record_cnt), + tab_title (t, ngettext ("Writing %zu record to %s.", + "Writing %zu records to %s.", trns->record_cnt), trns->record_cnt, fh_get_name (fh)); else - tab_title (t, ngettext ("Writing %d record.", - "Writing %d records.", trns->record_cnt), + tab_title (t, ngettext ("Writing %zu record.", + "Writing %zu records.", trns->record_cnt), trns->record_cnt); tab_submit (t); } diff --git a/src/language/stats/flip.c b/src/language/stats/flip.c index 3e595968..c8cb03b9 100644 --- a/src/language/stats/flip.c +++ b/src/language/stats/flip.c @@ -211,7 +211,7 @@ cmd_flip (struct lexer *lexer, struct dataset *ds) else { char s[VAR_NAME_LEN + 1]; - sprintf (s, "VAR%03d", i); + sprintf (s, "VAR%03zu", i); dict_create_var_assert (dict, s, 0); } diff --git a/tests/libpspp/sparse-xarray-test.c b/tests/libpspp/sparse-xarray-test.c index dd5a2a99..279863e9 100644 --- a/tests/libpspp/sparse-xarray-test.c +++ b/tests/libpspp/sparse-xarray-test.c @@ -182,7 +182,7 @@ check_state (struct mc *mc, struct test_state *ts, const struct test_model *tm) for (col = 0; col < params->n_columns; col++) if (data[col] != model->data[row][col]) { - mc_error (mc, "xarray %d: element %zu,%zu (of %zu,%zu) " + mc_error (mc, "xarray %d: element %d,%d (of %d,%d) " "differs: %d should be %d", i, row, col, n_rows, n_columns, data[col], model->data[row][col]); @@ -201,7 +201,7 @@ check_state (struct mc *mc, struct test_state *ts, const struct test_model *tm) ds_clear (&ds); for (col = 0; col < n_columns; col++) ds_put_format (&ds, " %d", model->data[row][col]); - mc_error (mc, "xarray %d: row %zu:%s", i, row, ds_cstr (&ds)); + mc_error (mc, "xarray %d: row %d:%s", i, row, ds_cstr (&ds)); } mc_error (mc, "xarray %d: actual:", i); @@ -216,7 +216,7 @@ check_state (struct mc *mc, struct test_state *ts, const struct test_model *tm) ds_clear (&ds); for (col = 0; col < n_columns; col++) ds_put_format (&ds, " %d", data[col]); - mc_error (mc, "xarray %d: row %zu:%s", i, row, ds_cstr (&ds)); + mc_error (mc, "xarray %d: row %d:%s", i, row, ds_cstr (&ds)); } ds_destroy (&ds); @@ -273,8 +273,8 @@ sparse_xarray_mc_init (struct mc *mc) struct test_model tm; int i; - mc_name_operation (mc, "empty sparse_xarray with n_columns=%zu, " - "max_memory_rows=%zu", + mc_name_operation (mc, "empty sparse_xarray with n_columns=%d, " + "max_memory_rows=%d", params->n_columns, params->max_memory_rows); ts = xmalloc (sizeof *ts); for (i = 0; i < params->n_xarrays; i++) -- 2.30.2