during the process of parsing; the lower levels of the tree always
come first in the result. */
-#include <stdio.h>
#include "defs.h"
#include "symtab.h"
+#include "gdbtypes.h"
#include "frame.h"
#include "expression.h"
#include "value.h"
#include "language.h"
#include "parser-defs.h"
+static void
+prefixify_expression PARAMS ((struct expression *));
+
+static int
+length_of_subexp PARAMS ((struct expression *, int));
+
+static void
+prefixify_subexp PARAMS ((struct expression *, struct expression *, int, int));
+
/* Assign machine-independent names to certain registers
(unless overridden by the REGISTER_NAMES table) */
register struct funcall *call = funcall_chain;
funcall_chain = call->next;
arglist_len = call->arglist_len;
- free (call);
+ free ((PTR)call);
return val;
}
for (call = funcall_chain; call; call = next)
{
next = call->next;
- free (call);
+ free ((PTR)call);
}
}
\f
if (expout_ptr >= expout_size)
{
expout_size *= 2;
- expout = (struct expression *) xrealloc (expout,
+ expout = (struct expression *) xrealloc ((char *) expout,
sizeof (struct expression)
+ expout_size * sizeof (union exp_element));
}
{
expout_size = max (expout_size * 2, expout_ptr + 10);
expout = (struct expression *)
- xrealloc (expout, (sizeof (struct expression)
+ xrealloc ((char *) expout, (sizeof (struct expression)
+ (expout_size * sizeof (union exp_element))));
}
- bcopy (str.ptr, (char *) &expout->elts[expout_ptr - lenelt], len);
+ memcpy ((char *) &expout->elts[expout_ptr - lenelt], str.ptr, len);
((char *) &expout->elts[expout_ptr - lenelt])[len] = 0;
write_exp_elt_longcst ((LONGEST) len);
}
copy_name (token)
struct stoken token;
{
- bcopy (token.ptr, namecopy, token.length);
+ memcpy (namecopy, token.ptr, token.length);
namecopy[token.length] = 0;
return namecopy;
}
/* Reverse an expression from suffix form (in which it is constructed)
to prefix form (in which we can conveniently print or execute it). */
-static void prefixify_subexp ();
-
-void
+static void
prefixify_expression (expr)
register struct expression *expr;
{
temp = (struct expression *) alloca (len);
/* Copy the original expression into temp. */
- bcopy (expr, temp, len);
+ memcpy (temp, expr, len);
prefixify_subexp (temp, expr, inpos, outpos);
}
/* Return the number of exp_elements in the subexpression of EXPR
whose last exp_element is at index ENDPOS - 1 in EXPR. */
-int
+static int
length_of_subexp (expr, endpos)
register struct expression *expr;
register int endpos;
/* Copy the final operator itself, from the end of the input
to the beginning of the output. */
inend -= oplen;
- bcopy (&inexpr->elts[inend], &outexpr->elts[outbeg],
- oplen * sizeof (union exp_element));
+ memcpy (&outexpr->elts[outbeg], &inexpr->elts[inend],
+ oplen * sizeof (union exp_element));
outbeg += oplen;
/* Find the lengths of the arg subexpressions. */
discard_cleanups (old_chain);
expout->nelts = expout_ptr;
expout = (struct expression *)
- xrealloc (expout,
+ xrealloc ((char *) expout,
sizeof (struct expression)
+ expout_ptr * sizeof (union exp_element));
prefixify_expression (expout);
{
type_stack_size *= 2;
type_stack = (union type_stack_elt *)
- xrealloc (type_stack, type_stack_size * sizeof (*type_stack));
+ xrealloc ((char *) type_stack, type_stack_size * sizeof (*type_stack));
}
type_stack[type_stack_depth++].piece = tp;
}
{
type_stack_size *= 2;
type_stack = (union type_stack_elt *)
- xrealloc (type_stack, type_stack_size * sizeof (*type_stack));
+ xrealloc ((char *) type_stack, type_stack_size * sizeof (*type_stack));
}
type_stack[type_stack_depth++].int_val = n;
}