vec->type = $1.type;
vec->length = $1.length;
- vec->ptr = malloc ($1.length + 1);
+ vec->ptr = (char *) malloc ($1.length + 1);
memcpy (vec->ptr, $1.ptr, $1.length + 1);
}
for convenience. */
char *p;
++$$.len;
- $$.tokens = realloc ($$.tokens,
- $$.len * sizeof (struct typed_stoken));
+ $$.tokens = XRESIZEVEC (struct typed_stoken,
+ $$.tokens, $$.len);
- p = malloc ($2.length + 1);
+ p = (char *) malloc ($2.length + 1);
memcpy (p, $2.ptr, $2.length + 1);
$$.tokens[$$.len - 1].type = $2.type;
if (!type_aggregate_p (type))
error (_("`%s' is not defined as an aggregate type."),
TYPE_SAFE_NAME (type));
- buf = alloca ($4.length + 2);
+ buf = (char *) alloca ($4.length + 2);
tmp_token.ptr = buf;
tmp_token.length = $4.length + 1;
buf[0] = '~';
}
write_exp_elt_opcode (pstate, OP_VAR_VALUE);
- /* We want to use the selected frame, not
- another more inner frame which happens to
- be in the same block. */
- write_exp_elt_block (pstate, NULL);
+ write_exp_elt_block (pstate, sym.block);
write_exp_elt_sym (pstate, sym.symbol);
write_exp_elt_opcode (pstate, OP_VAR_VALUE);
}
static void
write_destructor_name (struct parser_state *par_state, struct stoken token)
{
- char *copy = alloca (token.length + 1);
+ char *copy = (char *) alloca (token.length + 1);
copy[0] = '~';
memcpy (©[1], token.ptr, token.length);
char *buf;
st.length = strlen (operator_string) + strlen (op);
- buf = malloc (st.length + 1);
+ buf = (char *) malloc (st.length + 1);
strcpy (buf, operator_string);
strcat (buf, op);
st.ptr = buf;
struct type *unsigned_type;
char *p;
- p = alloca (len);
+ p = (char *) alloca (len);
memcpy (p, buf, len);
if (parsed_float)
/* Copy to the obstack, and then free the intermediate
expansion. */
- copy = obstack_copy0 (&expansion_obstack, expansion, strlen (expansion));
+ copy = (char *) obstack_copy0 (&expansion_obstack, expansion,
+ strlen (expansion));
xfree (expansion);
/* Save the old lexptr value, so we can return to it when we're done
the FIFO, and delete the other constituent tokens. */
if (checkpoint > 0)
{
- current.value.sval.ptr = obstack_copy0 (&expansion_obstack,
- current.value.sval.ptr,
- current.value.sval.length);
+ current.value.sval.ptr
+ = (const char *) obstack_copy0 (&expansion_obstack,
+ current.value.sval.ptr,
+ current.value.sval.length);
VEC_replace (token_and_value, token_fifo, 0, ¤t);
if (checkpoint > 1)
case CHAR:
case STRING:
{
- char *copy = alloca (value.tsval.length + 1);
+ char *copy = (char *) alloca (value.tsval.length + 1);
memcpy (copy, value.tsval.ptr, value.tsval.length);
copy[value.tsval.length] = '\0';