aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-05-04 06:46:14 +0000
committerRichard M. Stallman1995-05-04 06:46:14 +0000
commit03cdafdfe54b4eb4ec454ee73f780416be3d7c43 (patch)
treecaf3fa7e8e42dcd26e5892222db3166afeadd32b /lib-src
parent921e69c309d6bb944cc2c887d60476e1fb69e544 (diff)
downloademacs-03cdafdfe54b4eb4ec454ee73f780416be3d7c43.tar.gz
emacs-03cdafdfe54b4eb4ec454ee73f780416be3d7c43.zip
(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 ();
139char *etags_strchr (), *etags_strrchr (); 139char *etags_strchr (), *etags_strrchr ();
140char *etags_getcwd (); 140char *etags_getcwd ();
141char *relative_filename (), *absolute_filename (), *absolute_dirname (); 141char *relative_filename (), *absolute_filename (), *absolute_dirname ();
142char *xmalloc (), *xrealloc (); 142long *xmalloc (), *xrealloc ();
143 143
144typedef void Lang_function (); 144typedef void Lang_function ();
145#if FALSE /* many compilers barf on this */ 145#if FALSE /* many compilers barf on this */
@@ -2068,8 +2068,9 @@ C_entries (c_ext, inf)
2068 while (token_name.size < strsize) 2068 while (token_name.size < strsize)
2069 { 2069 {
2070 token_name.size *= 2; 2070 token_name.size *= 2;
2071 token_name.buffer=xrealloc(token_name.buffer, 2071 token_name.buffer
2072 token_name.size); 2072 = (char *) xrealloc (token_name.buffer,
2073 token_name.size);
2073 } 2074 }
2074 strcpy (token_name.buffer, structtag); 2075 strcpy (token_name.buffer, structtag);
2075 strcat (token_name.buffer, "::"); 2076 strcat (token_name.buffer, "::");
@@ -2082,8 +2083,9 @@ C_entries (c_ext, inf)
2082 while (token_name.size < toklen + 1) 2083 while (token_name.size < toklen + 1)
2083 { 2084 {
2084 token_name.size *= 2; 2085 token_name.size *= 2;
2085 token_name.buffer=xrealloc(token_name.buffer, 2086 token_name.buffer
2086 token_name.size); 2087 = (char *) xrealloc (token_name.buffer,
2088 token_name.size);
2087 } 2089 }
2088 strncpy (token_name.buffer, 2090 strncpy (token_name.buffer,
2089 newlb.buffer+tokoff, toklen); 2091 newlb.buffer+tokoff, toklen);
@@ -3814,22 +3816,22 @@ absolute_dirname (file, cwd)
3814} 3816}
3815 3817
3816/* Like malloc but get fatal error if memory is exhausted. */ 3818/* Like malloc but get fatal error if memory is exhausted. */
3817char * 3819long *
3818xmalloc (size) 3820xmalloc (size)
3819 unsigned int size; 3821 unsigned int size;
3820{ 3822{
3821 char *result = (char *) malloc (size); 3823 long *result = (long *) malloc (size);
3822 if (result == NULL) 3824 if (result == NULL)
3823 fatal ("virtual memory exhausted", 0); 3825 fatal ("virtual memory exhausted", 0);
3824 return result; 3826 return result;
3825} 3827}
3826 3828
3827char * 3829long *
3828xrealloc (ptr, size) 3830xrealloc (ptr, size)
3829 char *ptr; 3831 char *ptr;
3830 unsigned int size; 3832 unsigned int size;
3831{ 3833{
3832 char *result = (char *) realloc (ptr, size); 3834 long *result = (long *) realloc (ptr, size);
3833 if (result == NULL) 3835 if (result == NULL)
3834 fatal ("virtual memory exhausted"); 3836 fatal ("virtual memory exhausted");
3835 return result; 3837 return result;