Cosmetic: use X2NREALLOC (only two arguments) rather than x2nrealloc (with three).
authorJim Meyering <jim@meyering.net>
Fri, 12 Aug 2005 07:16:25 +0000 (07:16 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 12 Aug 2005 07:16:25 +0000 (07:16 +0000)
src/csplit.c
src/cut.c
src/expand.c
src/join.c
src/od.c
src/sort.c
src/unexpand.c

index f4fe722..9bca37c 100644 (file)
@@ -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;
index aab1f8e..0e656aa 100644 (file)
--- a/src/cut.c
+++ b/src/cut.c
    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
index cf360c9..863aec9 100644 (file)
@@ -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;
 }
 
index 7630ae6..87f6c77 100644 (file)
@@ -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]))
     {
index 667beb8..79c2435 100644 (file)
--- a/src/od.c
+++ b/src/od.c
@@ -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;
index 760faa9..c252441 100644 (file)
@@ -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;
 }
index e88efcf..5537ef8 100644 (file)
@@ -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)