qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 11/12] coreaudio: do not use global variables


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 11/12] coreaudio: do not use global variables where possible
Date: Wed, 3 Jun 2015 20:19:17 +0100

On 3 June 2015 at 11:49, Kővágó, Zoltán <address@hidden> wrote:
> Signed-off-by: Kővágó, Zoltán <address@hidden>
> ---
>  audio/coreaudio.c | 43 ++++++++++++++++++++++++-------------------
>  1 file changed, 24 insertions(+), 19 deletions(-)

> +static CoreaudioConf glob_conf = {
> +    .buffer_frames = 512,
> +    .nbuffers = 4,
> +};
> +
>  static void *coreaudio_audio_init (void)
>  {
> +    CoreaudioConf *conf = g_malloc(sizeof(CoreaudioConf));
> +    *conf = glob_conf;
> +
>      atexit(coreaudio_atexit);
> -    return &coreaudio_audio_init;
> +    return conf;
>  }
>
>  static void coreaudio_audio_fini (void *opaque)
>  {
> -    (void) opaque;
> +    g_free(opaque);
>  }
>
>  static struct audio_option coreaudio_options[] = {
>      {
>          .name  = "BUFFER_SIZE",
>          .tag   = AUD_OPT_INT,
> -        .valp  = &conf.buffer_frames,
> +        .valp  = &glob_conf.buffer_frames,
>          .descr = "Size of the buffer in frames"
>      },
>      {
>          .name  = "BUFFER_COUNT",
>          .tag   = AUD_OPT_INT,
> -        .valp  = &conf.nbuffers,
> +        .valp  = &glostconf.nbuffers,
>          .descr = "Number of buffers"
>      },

/Users/pm215/src/qemu/audio/coreaudio.c:529:19: error: use of
undeclared identifier 'glostconf'; did you mean 'glob_conf'?
        .valp  = &glostconf.nbuffers,
                  ^~~~~~~~~
                  glob_conf
/Users/pm215/src/qemu/audio/coreaudio.c:500:22: note: 'glob_conf' declared here
static CoreaudioConf glob_conf = {
                     ^
10 warnings and 1 error generated.

-- PMM



reply via email to

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