diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2013-07-01 12:40:19 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2013-07-15 17:13:51 +0100 |
commit | 82a3a11897308b606120f7235001e87809708f85 (patch) | |
tree | 81105fc79cc5dbe83181f128efd7954722adaab8 | |
parent | 2ebcebe262e88111ff583f97bc5fe0aae64b8940 (diff) | |
download | hqemu-82a3a11897308b606120f7235001e87809708f85.zip hqemu-82a3a11897308b606120f7235001e87809708f85.tar.gz |
target-arm: Avoid g_hash_table_get_keys()
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
-rw-r--r-- | target-arm/helper.c | 12 |
1 files 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; |