summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-11-02 20:16:19 +0000
committerJim Meyering <jim@meyering.net>2003-11-02 20:16:19 +0000
commit08fd60e693a2f4d7b1107f7500bef4ed9c32eb5e (patch)
tree8eaca6458c64ff7f55f700cfa2f4069602b93750
parent9ecbfc3886311773ad9ea4db47f2a6f10b43fb0f (diff)
downloadcoreutils-08fd60e693a2f4d7b1107f7500bef4ed9c32eb5e.tar.xz
(inittables): Use `sizeof *var' rather than `sizeof EXPLICIT_TYPE'.
The former is more maintainable and usually shorter. (sort): Split a long line.
-rw-r--r--src/sort.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sort.c b/src/sort.c
index f2268f1df..735be3854 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -573,7 +573,7 @@ inittables (void)
name[j] = '\0';
}
qsort ((void *) monthtab, MONTHS_PER_YEAR,
- sizeof (struct month), struct_month_cmp);
+ sizeof *monthtab, struct_month_cmp);
}
#endif
}
@@ -1992,7 +1992,8 @@ sort (char * const *files, int nfiles, char const *output_file)
char const *file = *files;
FILE *fp = xfopen (file, "r");
FILE *tfp;
- size_t bytes_per_line = 2 * sizeof (struct line) - sizeof (struct line) / 2;
+ size_t bytes_per_line = (2 * sizeof (struct line)
+ - sizeof (struct line) / 2);
if (! buf.alloc)
initbuf (&buf, bytes_per_line,