From: Peter Maydell <peter.maydell@linaro.org>
To: Aurelien Jarno <aurelien@aurel32.net>, Blue Swirl <blauwirbel@gmail.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
qemu-devel@nongnu.org, Paul Brook <paul@codesourcery.com>
Subject: [Qemu-devel] [PULL 8/8] target-arm: Avoid g_hash_table_get_keys()
Date: Mon, 15 Jul 2013 17:17:02 +0100 [thread overview]
Message-ID: <1373905022-27735-9-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1373905022-27735-1-git-send-email-peter.maydell@linaro.org>
g_hash_table_get_keys() was only introduced in glib 2.14, and we're
still targeting a minimum version of 2.12. Rewrite the offending
code (introduced in commit 721fae1) to use g_hash_table_foreach()
to build the list of keys.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Tested-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1372678819-8633-1-git-send-email-peter.maydell@linaro.org
---
target-arm/helper.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 57fa8c8..aeae024 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -222,15 +222,23 @@ static gint cpreg_key_compare(gconstpointer a, gconstpointer b)
return aidx - bidx;
}
+static void cpreg_make_keylist(gpointer key, gpointer value, gpointer udata)
+{
+ GList **plist = udata;
+
+ *plist = g_list_prepend(*plist, key);
+}
+
void init_cpreg_list(ARMCPU *cpu)
{
/* Initialise the cpreg_tuples[] array based on the cp_regs hash.
* Note that we require cpreg_tuples[] to be sorted by key ID.
*/
- GList *keys;
+ GList *keys = NULL;
int arraylen;
- keys = g_hash_table_get_keys(cpu->cp_regs);
+ g_hash_table_foreach(cpu->cp_regs, cpreg_make_keylist, &keys);
+
keys = g_list_sort(keys, cpreg_key_compare);
cpu->cpreg_array_len = 0;
--
1.7.9.5
prev parent reply other threads:[~2013-07-15 16:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 16:16 [Qemu-devel] [PULL 0/8] target-arm queue Peter Maydell
2013-07-15 16:16 ` [Qemu-devel] [PULL 1/8] target-arm: add feature flag for ARMv8 Peter Maydell
2013-07-15 16:16 ` [Qemu-devel] [PULL 2/8] target-arm: implement LDA/STL instructions Peter Maydell
2013-07-15 16:16 ` [Qemu-devel] [PULL 3/8] target-arm: explicitly decode SEVL instruction Peter Maydell
2013-07-15 16:16 ` [Qemu-devel] [PULL 4/8] target-arm/helper.c: OMAP/StrongARM cp15 crn=0 cleanup Peter Maydell
2013-07-15 16:16 ` [Qemu-devel] [PULL 5/8] target-arm/helper.c: Implement MIDR aliases Peter Maydell
2013-07-15 16:17 ` [Qemu-devel] [PULL 6/8] target-arm/helper.c: Allow const opaques in arm CP Peter Maydell
2013-07-15 16:17 ` [Qemu-devel] [PULL 7/8] target-arm: avoid undefined behaviour when writing TTBCR Peter Maydell
2013-07-15 16:17 ` Peter Maydell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373905022-27735-9-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=aliguori@us.ibm.com \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).