diff options
| author | Burt P <pburt0@gmail.com> | 2017-06-20 16:05:07 +0000 | 
|---|---|---|
| committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2017-06-21 10:34:54 -0700 | 
| commit | 1f791f304b6b27c27c0048e3563e154b928494c8 (patch) | |
| tree | a9c40c44629adcbee33aba69186a3c5b31cc4c71 /modules/devices/arm | |
| parent | 28ee284e11a33f16d60b5a5a9b0ae363c1f8a101 (diff) | |
Use arm_flag_meaning() directly instead of creating a GHashTable
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/devices/arm')
| -rw-r--r-- | modules/devices/arm/processor.c | 24 | 
1 files changed, 1 insertions, 23 deletions
| diff --git a/modules/devices/arm/processor.c b/modules/devices/arm/processor.c index c18a7921..ad7adf7f 100644 --- a/modules/devices/arm/processor.c +++ b/modules/devices/arm/processor.c @@ -34,25 +34,6 @@ static const gchar *arm_mode_str[] = {      "A32 on A64",  }; -GHashTable *cpu_flags = NULL; /* FIXME: when is it freed? */ - -static void -populate_cpu_flags_list_internal() -{ -    int i; -    gchar **afl, *fm; - -    cpu_flags = g_hash_table_new(g_str_hash, g_str_equal); -    afl = g_strsplit(arm_flag_list(), " ", 0); -    while(afl[i] != NULL) { -        printf(":( %s\n", afl[i]); /* FIXME: may segfault if removed */ -        fm = (char *)arm_flag_meaning(afl[i]); -        if (g_strcmp0(afl[i], "") != 0) -            g_hash_table_insert(cpu_flags, afl[i], (fm) ? fm : ""); -        i++; -    } -} -  static gint get_cpu_int(const gchar* file, gint cpuid) {      gchar *tmp0 = NULL;      gchar *tmp1 = NULL; @@ -232,14 +213,11 @@ gchar *processor_get_capabilities_from_flags(gchar * strflags)      gchar *tmp = NULL;      gint j = 0; -    if (!cpu_flags) -        populate_cpu_flags_list_internal(); -      flags = g_strsplit(strflags, " ", 0);      old = flags;      while (flags[j]) { -        gchar *meaning = g_hash_table_lookup(cpu_flags, flags[j]); +        const gchar *meaning = arm_flag_meaning( flags[j] );          if (meaning) {              tmp = h_strdup_cprintf("%s=%s\n", tmp, flags[j], meaning); | 
