On Friday, September 10, 2010 18:21:32 Michael Walle wrote: > +int urj_part_data_register_realloc (urj_data_register_t *dr, int len);
i'd call the 2nd param "new_len"
> +int
> +urj_part_data_register_realloc (urj_data_register_t *dr, int len)
> +{
> + urj_tap_register_free (dr->in);
> + dr->in = NULL;
> + urj_tap_register_free (dr->out);
> + dr->out = NULL;
> +
> + dr->in = urj_tap_register_alloc (len);
> + if (!dr->in)
> + return URJ_STATUS_FAIL;
> +
> + dr->out = urj_tap_register_alloc (len);
> + if (!dr->out)
> + return URJ_STATUS_FAIL;
> +
> + return URJ_STATUS_OK;
> +}
the standard realloc() preserves the contents. shouldnt this also preserve
the register contents of the in/out tap registers ?
perhaps you should extend this to also add a tap_register_realloc() ... then
this implementation merely calls that on the in/out tap registers, and you can
keep the preservation logic only once.
-mike
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________ UrJTAG-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/urjtag-development
