Received: from eggs.gnu.org ([2001:4830:134:3::10]:49477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSq7B-00049Z-4J for qemu-devel@nongnu.org; Tue, 03 Mar 2015 11:56:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSq76-0002vz-Ri for qemu-devel@nongnu.org; Tue, 03 Mar 2015 11:56:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSq76-0002vf-LN for qemu-devel@nongnu.org; Tue, 03 Mar 2015 11:56:08 -0500 Date: Tue, 3 Mar 2015 17:56:02 +0100 From: Igor Mammedov Message-ID: <20150303175602.20b3afc2@nial.brq.redhat.com> In-Reply-To: <1425400953-18482-1-git-send-email-mst@redhat.com> References: <1425400953-18482-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] aml-build: fix build for glib < 2.22 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Peter Maydell , qemu-devel@nongnu.org On Tue, 3 Mar 2015 17:43:30 +0100 "Michael S. Tsirkin" wrote: > g_ptr_array_new_with_free_func is there since glib 2.22, > use the older g_ptr_array_foreach instead. > > Reported-by: Peter Maydell > Signed-off-by: Michael S. Tsirkin > --- Reviewed-by: Igor Mammedov > > Seems to work ok here. > Igor - can you pls confirm? > > hw/acpi/aml-build.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c > index 3e5949b..876cada 100644 > --- a/hw/acpi/aml-build.c > +++ b/hw/acpi/aml-build.c > @@ -299,7 +299,7 @@ static Aml *aml_bundle(uint8_t op, AmlBlockFlags flags) > return var; > } > > -static void aml_free(gpointer data) > +static void aml_free(gpointer data, gpointer user_data) > { > Aml *var = data; > build_free_array(var->buf); > @@ -310,13 +310,14 @@ Aml *init_aml_allocator(void) > Aml *var; > > assert(!alloc_list); > - alloc_list = g_ptr_array_new_with_free_func(aml_free); > + alloc_list = g_ptr_array_new(); > var = aml_alloc(); > return var; > } > > void free_aml_allocator(void) > { > + g_ptr_array_foreach(alloc_list, aml_free, NULL); > g_ptr_array_free(alloc_list, true); > alloc_list = 0; > }