From patchwork Tue Mar 3 17:07:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 445820 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C21361400D5 for ; Wed, 4 Mar 2015 04:08:00 +1100 (AEDT) Received: from localhost ([::1]:39922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSqIY-0002CN-R9 for incoming@patchwork.ozlabs.org; Tue, 03 Mar 2015 12:07:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSqI8-000181-5m for qemu-devel@nongnu.org; Tue, 03 Mar 2015 12:07:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSqI3-00073b-NP for qemu-devel@nongnu.org; Tue, 03 Mar 2015 12:07:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSqI3-00073P-GW for qemu-devel@nongnu.org; Tue, 03 Mar 2015 12:07:27 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t23H7Lad015053 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 3 Mar 2015 12:07:22 -0500 Received: from redhat.com (dhcp-4-119.tlv.redhat.com [10.35.4.119]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t23H7JAm008557; Tue, 3 Mar 2015 12:07:20 -0500 Date: Tue, 3 Mar 2015 18:07:19 +0100 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1425402197-21726-2-git-send-email-mst@redhat.com> References: <1425402197-21726-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1425402197-21726-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Anthony Liguori Subject: [Qemu-devel] [PULL v4 1/2] aml-build: fix build for glib < 2.22 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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; }