qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 42/58] vmstate: port stellaris gamepad


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH 42/58] vmstate: port stellaris gamepad
Date: Sat, 26 Feb 2011 12:56:41 +0200

On Thu, Feb 24, 2011 at 7:57 PM, Juan Quintela <address@hidden> wrote:
> Signed-off-by: Juan Quintela <address@hidden>
> ---
>  hw/stellaris_input.c |   50 
> ++++++++++++++++++++++++--------------------------
>  1 files changed, 24 insertions(+), 26 deletions(-)
>
> diff --git a/hw/stellaris_input.c b/hw/stellaris_input.c
> index 16aae96..b5b3bd7 100644
> --- a/hw/stellaris_input.c
> +++ b/hw/stellaris_input.c
> @@ -13,7 +13,7 @@
>  typedef struct {
>     qemu_irq irq;
>     int keycode;
> -    int pressed;
> +    uint8_t pressed;
>  } gamepad_button;
>
>  typedef struct {
> @@ -47,30 +47,29 @@ static void stellaris_gamepad_put_key(void * opaque, int 
> keycode)
>     s->extension = 0;
>  }
>
> -static void stellaris_gamepad_save(QEMUFile *f, void *opaque)
> -{
> -    gamepad_state *s = (gamepad_state *)opaque;
> -    int i;
> -
> -    qemu_put_be32(f, s->extension);
> -    for (i = 0; i < s->num_buttons; i++)
> -        qemu_put_byte(f, s->buttons[i].pressed);
> -}
> -
> -static int stellaris_gamepad_load(QEMUFile *f, void *opaque, int version_id)
> -{
> -    gamepad_state *s = (gamepad_state *)opaque;
> -    int i;
> -
> -    if (version_id != 1)
> -        return -EINVAL;
> -
> -    s->extension = qemu_get_be32(f);
> -    for (i = 0; i < s->num_buttons; i++)
> -        s->buttons[i].pressed = qemu_get_byte(f);
> +static const VMStateDescription vmstate_stellaris_button = {
> +    .name = "stellaris_button",
> +    .version_id = 1,
> +    .minimum_version_id = 1,
> +    .minimum_version_id_old = 1,

For consistency with other structures, these version fields should be 0.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]