diff options
author | Jim Meyering <jim@meyering.net> | 2005-08-12 07:16:25 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-08-12 07:16:25 +0000 |
commit | 0b08c3815214197faf9baf5cd77ddac6ae6f7c1d (patch) | |
tree | 12bcef60191f67fb8184bd12adaa0bfda5c40ce1 /src | |
parent | 6f7fd1a8667c45df0207fef3399b6167dbd283f3 (diff) | |
download | coreutils-0b08c3815214197faf9baf5cd77ddac6ae6f7c1d.tar.xz |
Cosmetic: use X2NREALLOC (only two arguments) rather than x2nrealloc (with three).
Diffstat (limited to 'src')
-rw-r--r-- | src/csplit.c | 2 | ||||
-rw-r--r-- | src/cut.c | 22 | ||||
-rw-r--r-- | src/expand.c | 2 | ||||
-rw-r--r-- | src/join.c | 5 | ||||
-rw-r--r-- | src/od.c | 2 | ||||
-rw-r--r-- | src/sort.c | 2 | ||||
-rw-r--r-- | src/unexpand.c | 2 |
7 files changed, 18 insertions, 19 deletions
diff --git a/src/csplit.c b/src/csplit.c index f4fe7221c..9bca37cd0 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -1033,7 +1033,7 @@ new_control_record (void) 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; @@ -54,17 +54,17 @@ 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 diff --git a/src/expand.c b/src/expand.c index cf360c913..863aec933 100644 --- a/src/expand.c +++ b/src/expand.c @@ -140,7 +140,7 @@ static void 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; } diff --git a/src/join.c b/src/join.c index 7630ae643..87f6c77cd 100644 --- a/src/join.c +++ b/src/join.c @@ -188,8 +188,7 @@ extract_field (struct line *line, char *field, size_t len) { 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; @@ -283,7 +282,7 @@ static bool 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])) { @@ -974,7 +974,7 @@ decode_format_string (const char *s) 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; diff --git a/src/sort.c b/src/sort.c index 760faa98f..c252441cb 100644 --- a/src/sort.c +++ b/src/sort.c @@ -510,7 +510,7 @@ static void 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; } diff --git a/src/unexpand.c b/src/unexpand.c index e88efcfe1..5537ef828 100644 --- a/src/unexpand.c +++ b/src/unexpand.c @@ -152,7 +152,7 @@ add_tab_stop (uintmax_t tabval) 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) |