From: Ben Pfaff Date: Wed, 27 Apr 2011 04:52:27 +0000 (-0700) Subject: Use %zu, not %d, to format a size_t. X-Git-Tag: v0.7.8~25 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=519f1686924c643a885c25defa3af6633d9a11db;p=pspp-builds.git Use %zu, not %d, to format a size_t. Found on Mac OS X with help from Jeremy Lavergne. --- diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c index ee0bfb13..0c6aa808 100644 --- a/src/data/sys-file-reader.c +++ b/src/data/sys-file-reader.c @@ -500,7 +500,7 @@ sfm_open_reader (struct file_handle *fh, struct dictionary **dictp, if (claimed_oct_cnt != -1 && claimed_oct_cnt != n_vars && info->version_major != 13) sys_warn (r, -1, _("File header claims %d variable positions but " - "%d were read from file."), + "%zu were read from file."), claimed_oct_cnt, n_vars); /* Create an index of dictionary variable widths for @@ -779,7 +779,7 @@ read_value_label_record (struct sfm_reader *r, record->n_vars = read_int (r); if (record->n_vars < 1 || record->n_vars > n_vars) sys_error (r, r->pos - 4, - _("Number of variables associated with a value label (%d) " + _("Number of variables associated with a value label (%zu) " "is not between 1 and the number of variables (%zu)."), record->n_vars, n_vars); record->vars = pool_nmalloc (r->pool, record->n_vars, sizeof *record->vars); @@ -1729,7 +1729,7 @@ lookup_var_by_index (struct sfm_reader *r, off_t offset, if (idx < 1 || idx > n_var_recs) { sys_error (r, offset, - _("Variable index %d not in valid range 1...%d."), + _("Variable index %d not in valid range 1...%zu."), idx, n_var_recs); return NULL; } diff --git a/src/language/control/repeat.c b/src/language/control/repeat.c index ff1bbc08..68e69a4f 100644 --- a/src/language/control/repeat.c +++ b/src/language/control/repeat.c @@ -159,8 +159,8 @@ parse_specification (struct lexer *lexer, struct dictionary *dict, first_dv = dv; else if (first_dv->n_values != dv->n_values) { - msg (SE, _("Dummy variable `%s' had %d substitutions, so `%s' must " - "also, but %d were specified."), + msg (SE, _("Dummy variable `%s' had %zu substitutions, so `%s' must " + "also, but %zu were specified."), first_dv->name, first_dv->n_values, dv->name, dv->n_values); goto error; diff --git a/src/language/data-io/file-handle.q b/src/language/data-io/file-handle.q index 7e7cdcdf..786955bc 100644 --- a/src/language/data-io/file-handle.q +++ b/src/language/data-io/file-handle.q @@ -136,7 +136,7 @@ cmd_file_handle (struct lexer *lexer, struct dataset *ds) 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. " - "Assuming %d-character records."), + "Assuming %zu-character records."), cmd.n_lrecl[0], (1UL << 31) - 1, properties.record_width); else properties.record_width = cmd.n_lrecl[0]; diff --git a/src/language/dictionary/sys-file-info.c b/src/language/dictionary/sys-file-info.c index 7b428df5..3f00106e 100644 --- a/src/language/dictionary/sys-file-info.c +++ b/src/language/dictionary/sys-file-info.c @@ -394,7 +394,7 @@ display_attributes (struct tab_table *t, const struct attrset *set, int flags, for (i = 0; i < n_values; i++) { if (n_values > 1) - tab_text_format (t, c, r, TAB_LEFT, "%s[%d]", name, i + 1); + tab_text_format (t, c, r, TAB_LEFT, "%s[%zu]", name, i + 1); else tab_text (t, c, r, TAB_LEFT, name); tab_text (t, c + 1, r, TAB_LEFT, attribute_get_value (attr, i)); diff --git a/src/language/stats/factor.c b/src/language/stats/factor.c index 1145a48e..d1a35a87 100644 --- a/src/language/stats/factor.c +++ b/src/language/stats/factor.c @@ -1490,7 +1490,7 @@ show_explained_variance (const struct cmd_factor * factor, struct idata *idata, c = 0; - tab_text_format (t, c++, i + heading_rows, TAB_LEFT | TAT_TITLE, _("%d"), i + 1); + tab_text_format (t, c++, i + heading_rows, TAB_LEFT | TAT_TITLE, _("%zu"), i + 1); i_cum += i_percent; e_cum += e_percent;