static struct tspec *spec;
/* The number of format specs. */
-static size_t n_specs;
+static idx_t n_specs;
/* The allocated length of SPEC. */
-static size_t n_specs_allocated;
+static idx_t n_specs_allocated;
/* The number of input bytes formatted per output line. It must be
a multiple of the least common multiple of the sizes associated with
char const *next;
if (n_specs_allocated <= n_specs)
- spec = X2NREALLOC (spec, &n_specs_allocated);
+ spec = xpalloc (spec, &n_specs_allocated, 1, -1, sizeof *spec);
if (! decode_one_format (s_orig, s, &next, &spec[n_specs]))
return false;
else
{
prev_pair_equal = false;
- for (size_t i = 0; i < n_specs; i++)
+ for (idx_t i = 0; i < n_specs; i++)
{
int datum_width = width_bytes[spec[i].size];
int fields_per_block = bytes_per_block / datum_width;
{
int l_c_m = 1;
- for (size_t i = 0; i < n_specs; i++)
+ for (idx_t i = 0; i < n_specs; i++)
l_c_m = lcm (l_c_m, width_bytes[spec[i].size]);
return l_c_m;
}
main (int argc, char **argv)
{
int n_files;
- size_t i;
int l_c_m;
idx_t desired_width IF_LINT ( = 0);
bool modern = false;
atexit (close_stdout);
- for (i = 0; i <= MAX_INTEGRAL_TYPE_SIZE; i++)
+ for (idx_t i = 0; i <= MAX_INTEGRAL_TYPE_SIZE; i++)
integral_type_size[i] = NO_SIZE;
integral_type_size[sizeof (char)] = CHAR;
integral_type_size[sizeof (unsigned_long_long_int)] = LONG_LONG;
#endif
- for (i = 0; i <= MAX_FP_TYPE_SIZE; i++)
+ for (idx_t i = 0; i <= MAX_FP_TYPE_SIZE; i++)
fp_type_size[i] = NO_SIZE;
#if FLOAT16_SUPPORTED
}
/* Compute padding necessary to align output block. */
- for (i = 0; i < n_specs; i++)
+ for (idx_t i = 0; i < n_specs; i++)
{
int fields_per_block = bytes_per_block / width_bytes[spec[i].size];
int block_width = (spec[i].field_width + 1) * fields_per_block;
if (width_per_block < block_width)
width_per_block = block_width;
}
- for (i = 0; i < n_specs; i++)
+ for (idx_t i = 0; i < n_specs; i++)
{
int fields_per_block = bytes_per_block / width_bytes[spec[i].size];
int block_width = spec[i].field_width * fields_per_block;
#ifdef DEBUG
printf ("lcm=%d, width_per_block=%zu\n", l_c_m, width_per_block);
- for (i = 0; i < n_specs; i++)
+ for (idx_t i = 0; i < n_specs; i++)
{
int fields_per_block = bytes_per_block / width_bytes[spec[i].size];
affirm (bytes_per_block % width_bytes[spec[i].size] == 0);