Commit 8bef35f2 authored by Gerd Moellmann's avatar Gerd Moellmann

(xmalloc, xrealloc): Rewritten.

(declaration): Remove parameter IS_EXTERN.
(class_definition): Remove unused variable.
parent c750667e
......@@ -498,7 +498,7 @@ void skip_matching P_ ((void));
void member P_ ((struct sym *, int));
void class_body P_ ((struct sym *, int));
void class_definition P_ ((struct sym *, int, int, int));
void declaration P_ ((int, int));
void declaration P_ ((int));
unsigned parm_list P_ ((int *));
char *operator_name P_ ((int *));
struct sym *parse_classname P_ ((void));
......@@ -534,10 +534,12 @@ xmalloc (nbytes)
int nbytes;
{
void *p = malloc (nbytes);
if (p)
return p;
yyerror ("out of memory");
exit (1);
if (p == NULL)
{
yyerror ("out of memory");
exit (1);
}
return p;
}
......@@ -549,10 +551,12 @@ xrealloc (p, sz)
int sz;
{
p = realloc (p, sz);
if (p)
return p;
yyerror ("out of memory");
exit (1);
if (p == NULL)
{
yyerror ("out of memory");
exit (1);
}
return p;
}
......@@ -2931,7 +2935,6 @@ class_definition (containing, tag, flags, nested)
int flags;
int nested;
{
register int token;
struct sym *current;
struct sym *base_class;
......@@ -2957,7 +2960,7 @@ class_definition (containing, tag, flags, nested)
while (!done)
{
switch (token = LA1)
switch (LA1)
{
case VIRTUAL: case PUBLIC: case PROTECTED: case PRIVATE:
MATCH ();
......@@ -3025,8 +3028,7 @@ class_definition (containing, tag, flags, nested)
/* Parse a declaration. */
void
declaration (is_extern, flags)
int is_extern;
declaration (flags)
int flags;
{
char *id = NULL;
......@@ -3301,7 +3303,7 @@ globals (start_flags)
return 0;
default:
declaration (0, flags);
declaration (flags);
flags = start_flags;
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment