/* readtokens.c -- Functions for reading tokens from an input stream.
- Copyright (C) 1990-1991, 1999, 2001, 2003 Jim Meyering.
+ Copyright (C) 1990-1991, 1999, 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
token_buffer *tokenbuffer;
{
tokenbuffer->size = INITIAL_TOKEN_LENGTH;
- tokenbuffer->buffer = ((char *) xmalloc (INITIAL_TOKEN_LENGTH));
+ tokenbuffer->buffer = xmalloc (INITIAL_TOKEN_LENGTH);
}
/* Read a token from `stream' into `tokenbuffer'.
else
projected_n_tokens = 64;
sz = projected_n_tokens;
- tokens = (char **) xmalloc (sz * sizeof (char *));
- lengths = (long *) xmalloc (sz * sizeof (long));
+ tokens = xmalloc (sz * sizeof (char *));
+ lengths = xmalloc (sz * sizeof (long));
init_tokenbuffer (token);
for (;;)
if (n_tokens >= sz)
{
sz *= 2;
- tokens = (char **) xrealloc (tokens, sz * sizeof (char *));
- lengths = (long *) xrealloc (lengths, sz * sizeof (long));
+ tokens = xrealloc (tokens, sz * sizeof (char *));
+ lengths = xrealloc (lengths, sz * sizeof (long));
}
if (token_length < 0)
lengths[n_tokens] = -1;
break;
}
- tmp = (char *) xmalloc ((token_length + 1) * sizeof (char));
+ tmp = xmalloc ((token_length + 1) * sizeof (char));
lengths[n_tokens] = token_length;
tokens[n_tokens] = strncpy (tmp, token->buffer,
(unsigned) (token_length + 1));