changeset 4376:7bd7d6bc542c

(readtokens): Remove anachronistic casts of xmalloc, xrealloc, and xcalloc return values.
author Jim Meyering <jim@meyering.net>
date Sat, 07 Jun 2003 10:16:29 +0000
parents a7c41aea8daa
children fcdb31846b5f
files lib/readtokens.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lib/readtokens.c
+++ b/lib/readtokens.c
@@ -1,5 +1,5 @@
 /* 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
@@ -62,7 +62,7 @@
      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'.
@@ -184,8 +184,8 @@
   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 (;;)
@@ -195,8 +195,8 @@
       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)
@@ -206,7 +206,7 @@
 	  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));