summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-05-04 06:46:14 +0000
committerRichard M. Stallman <rms@gnu.org>1995-05-04 06:46:14 +0000
commit03cdafdfe54b4eb4ec454ee73f780416be3d7c43 (patch)
treecaf3fa7e8e42dcd26e5892222db3166afeadd32b /lib-src
parent921e69c309d6bb944cc2c887d60476e1fb69e544 (diff)
downloademacs-03cdafdfe54b4eb4ec454ee73f780416be3d7c43.tar.gz
(C_entries): Cast result of xrealloc.
(xmalloc, xrealloc): Declare them to return long *.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index e6b3c10143d..9e9390c99c9 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -139,7 +139,7 @@ char *savenstr (), *savestr ();
char *etags_strchr (), *etags_strrchr ();
char *etags_getcwd ();
char *relative_filename (), *absolute_filename (), *absolute_dirname ();
-char *xmalloc (), *xrealloc ();
+long *xmalloc (), *xrealloc ();
typedef void Lang_function ();
#if FALSE /* many compilers barf on this */
@@ -2068,8 +2068,9 @@ C_entries (c_ext, inf)
while (token_name.size < strsize)
{
token_name.size *= 2;
- token_name.buffer=xrealloc(token_name.buffer,
- token_name.size);
+ token_name.buffer
+ = (char *) xrealloc (token_name.buffer,
+ token_name.size);
}
strcpy (token_name.buffer, structtag);
strcat (token_name.buffer, "::");
@@ -2082,8 +2083,9 @@ C_entries (c_ext, inf)
while (token_name.size < toklen + 1)
{
token_name.size *= 2;
- token_name.buffer=xrealloc(token_name.buffer,
- token_name.size);
+ token_name.buffer
+ = (char *) xrealloc (token_name.buffer,
+ token_name.size);
}
strncpy (token_name.buffer,
newlb.buffer+tokoff, toklen);
@@ -3814,22 +3816,22 @@ absolute_dirname (file, cwd)
}
/* Like malloc but get fatal error if memory is exhausted. */
-char *
+long *
xmalloc (size)
unsigned int size;
{
- char *result = (char *) malloc (size);
+ long *result = (long *) malloc (size);
if (result == NULL)
fatal ("virtual memory exhausted", 0);
return result;
}
-char *
+long *
xrealloc (ptr, size)
char *ptr;
unsigned int size;
{
- char *result = (char *) realloc (ptr, size);
+ long *result = (long *) realloc (ptr, size);
if (result == NULL)
fatal ("virtual memory exhausted");
return result;