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: Kővágó Zoltán
Subject: Re: [Qemu-devel] [PATCH v2 11/12] coreaudio: do not use global variables where possible
Date: Wed, 03 Jun 2015 21:43:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

2015-06-03 21:19 keltezéssel, Peter Maydell írta:
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.

crap, i should used search & replace... does it work with glob_conf or there are other problems?

Thanks,
Zoltan




reply via email to

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