struct control *p;
if (control_used == control_allocated)
- controls = x2nrealloc (controls, &control_allocated, sizeof *controls);
+ controls = X2NREALLOC (controls, &control_allocated);
p = &controls[control_used++];
p->regexpr = NULL;
p->repeat = 0;
space if necessary. Update local variable N_RP. When allocating,
update global variable N_RP_ALLOCATED. */
-#define ADD_RANGE_PAIR(rp, low, high) \
- do \
- { \
- if (n_rp >= n_rp_allocated) \
- { \
- (rp) = x2nrealloc (rp, &n_rp_allocated, sizeof *(rp)); \
- } \
- rp[n_rp].lo = (low); \
- rp[n_rp].hi = (high); \
- ++n_rp; \
- } \
+#define ADD_RANGE_PAIR(rp, low, high) \
+ do \
+ { \
+ if (n_rp >= n_rp_allocated) \
+ { \
+ (rp) = X2NREALLOC (rp, &n_rp_allocated); \
+ } \
+ rp[n_rp].lo = (low); \
+ rp[n_rp].hi = (high); \
+ ++n_rp; \
+ } \
while (0)
struct range_pair
add_tab_stop (uintmax_t tabval)
{
if (first_free_tab == n_tabs_allocated)
- tab_list = x2nrealloc (tab_list, &n_tabs_allocated, sizeof *tab_list);
+ tab_list = X2NREALLOC (tab_list, &n_tabs_allocated);
tab_list[first_free_tab++] = tabval;
}
{
if (line->nfields >= line->nfields_allocated)
{
- line->fields = x2nrealloc (line->fields, &line->nfields_allocated,
- sizeof (struct field));
+ line->fields = X2NREALLOC (line->fields, &line->nfields_allocated);
}
line->fields[line->nfields].beg = field;
line->fields[line->nfields].len = len;
getseq (FILE *fp, struct seq *seq)
{
if (seq->count == seq->alloc)
- seq->lines = x2nrealloc (seq->lines, &seq->alloc, sizeof *seq->lines);
+ seq->lines = X2NREALLOC (seq->lines, &seq->alloc);
if (get_line (fp, &seq->lines[seq->count]))
{
const char *next;
if (n_specs_allocated <= n_specs)
- spec = x2nrealloc (spec, &n_specs_allocated, sizeof *spec);
+ spec = X2NREALLOC (spec, &n_specs_allocated);
if (! decode_one_format (s_orig, s, &next, &spec[n_specs]))
return false;
add_temp_dir (char const *dir)
{
if (temp_dir_count == temp_dir_alloc)
- temp_dirs = x2nrealloc (temp_dirs, &temp_dir_alloc, sizeof *temp_dirs);
+ temp_dirs = X2NREALLOC (temp_dirs, &temp_dir_alloc);
temp_dirs[temp_dir_count++] = dir;
}
uintmax_t column_width = prev_column <= tabval ? tabval - prev_column : 0;
if (first_free_tab == n_tabs_allocated)
- tab_list = x2nrealloc (tab_list, &n_tabs_allocated, sizeof *tab_list);
+ tab_list = X2NREALLOC (tab_list, &n_tabs_allocated);
tab_list[first_free_tab++] = tabval;
if (max_column_width < column_width)