summaryrefslogtreecommitdiff
path: root/src/tr.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-11-02 19:50:48 +0000
committerJim Meyering <jim@meyering.net>2003-11-02 19:50:48 +0000
commit108be09181a97bcfc1f58254d8b4e87c2021f175 (patch)
tree6e71be106470c8fa88d1730dd00c939df651a929 /src/tr.c
parentfdc7d5bdd701d9fccdabad63bdf4b79eb84ea44e (diff)
downloadcoreutils-108be09181a97bcfc1f58254d8b4e87c2021f175.tar.xz
(append_normal_char, append_range, append_char_class)
(append_repeated_char, append_equiv_class, spec_init): Use more maintainable and usually-shorter `sizeof *var' rather than `sizeof EXPLICIT_TYPE'.
Diffstat (limited to 'src/tr.c')
-rw-r--r--src/tr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tr.c b/src/tr.c
index 5a0a6126a..099d65021 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -690,7 +690,7 @@ append_normal_char (struct Spec_list *list, unsigned int c)
{
struct List_element *new;
- new = xmalloc (sizeof (struct List_element));
+ new = xmalloc (sizeof *new);
new->next = NULL;
new->type = RE_NORMAL_CHAR;
new->u.normal_char = c;
@@ -721,7 +721,7 @@ append_range (struct Spec_list *list, unsigned int first, unsigned int last)
free (tmp2);
return 1;
}
- new = xmalloc (sizeof (struct List_element));
+ new = xmalloc (sizeof *new);
new->next = NULL;
new->type = RE_RANGE;
new->u.range.first_char = first;
@@ -747,7 +747,7 @@ append_char_class (struct Spec_list *list,
char_class = look_up_char_class (char_class_str, len);
if (char_class == CC_NO_CLASS)
return 1;
- new = xmalloc (sizeof (struct List_element));
+ new = xmalloc (sizeof *new);
new->next = NULL;
new->type = RE_CHAR_CLASS;
new->u.char_class = char_class;
@@ -768,7 +768,7 @@ append_repeated_char (struct Spec_list *list, unsigned int the_char,
{
struct List_element *new;
- new = xmalloc (sizeof (struct List_element));
+ new = xmalloc (sizeof *new);
new->next = NULL;
new->type = RE_REPEATED_CHAR;
new->u.repeated_char.the_repeated_char = the_char;
@@ -792,7 +792,7 @@ append_equiv_class (struct Spec_list *list,
if (len != 1)
return 1;
- new = xmalloc (sizeof (struct List_element));
+ new = xmalloc (sizeof *new);
new->next = NULL;
new->type = RE_EQUIV_CLASS;
new->u.equiv_code = *equiv_class_str;
@@ -1386,8 +1386,8 @@ get_s2_spec_stats (struct Spec_list *s2, size_t len_s1)
static void
spec_init (struct Spec_list *spec_list)
{
- spec_list->head = spec_list->tail =
- xmalloc (sizeof (struct List_element));
+ struct Spec_list *new = xmalloc (sizeof *new);
+ spec_list->head = spec_list->tail = new;
spec_list->head->next = NULL;
}