From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0EZC-0006vS-HD for qemu-devel@nongnu.org; Wed, 03 Jun 2015 15:43:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0EZ8-0008Ju-DP for qemu-devel@nongnu.org; Wed, 03 Jun 2015 15:43:10 -0400 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:35296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0EZ8-0008Jf-6r for qemu-devel@nongnu.org; Wed, 03 Jun 2015 15:43:06 -0400 Received: by wiga1 with SMTP id a1so25763225wig.0 for ; Wed, 03 Jun 2015 12:43:05 -0700 (PDT) From: "=?UTF-8?B?S8WRdsOhZ8OzIFpvbHTDoW4=?=" Message-ID: <556F58D3.6060008@gmail.com> Date: Wed, 03 Jun 2015 21:43:15 +0200 MIME-Version: 1.0 References: <932013ccc793ef14ae7f936d010d92c629eead4e.1433328036.git.DirtY.iCE.hu@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 11/12] coreaudio: do not use global variables where possible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Gerd Hoffmann 2015-06-03 21:19 keltezéssel, Peter Maydell írta: > On 3 June 2015 at 11:49, Kővágó, Zoltán wrote: >> Signed-off-by: Kővágó, Zoltán >> --- >> 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