diff options
author | Burt P <pburt0@gmail.com> | 2017-06-04 22:06:45 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2017-06-05 09:30:40 -0700 |
commit | 9f1e033d31ca9f41aa4fb1fc465b97d537eda6a5 (patch) | |
tree | 46cbf5683fe8c8cd8bb0af544bdf587e441abbbc /modules/devices/x86/processor.c | |
parent | eaa734a6ef4ebf4be6c3dcaffefdfdf43d942b22 (diff) |
Fallback g_strv_contains() imp when using glib<2.44
Also, some stray whitespace removed.
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/devices/x86/processor.c')
-rw-r--r-- | modules/devices/x86/processor.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/modules/devices/x86/processor.c b/modules/devices/x86/processor.c index 445ca716..7935a83d 100644 --- a/modules/devices/x86/processor.c +++ b/modules/devices/x86/processor.c @@ -214,18 +214,6 @@ fail: g_free(endpoint); } -static gboolean _g_strv_contains(const gchar * const * strv, const gchar *str) { - /* g_strv_contains() requires glib>2.44 */ - //return g_strv_contains(strv, str); - gint i = 0; - while(strv[i] != NULL) { - if (g_strcmp0(strv[i], str) == 0) - return 1; - i++; - } - return 0; -} - int processor_has_flag(gchar * strflags, gchar * strflag) { gchar **flags; @@ -233,7 +221,7 @@ int processor_has_flag(gchar * strflags, gchar * strflag) if (strflags == NULL || strflag == NULL) return 0; flags = g_strsplit(strflags, " ", 0); - ret = _g_strv_contains((const gchar * const *)flags, strflag); + ret = g_strv_contains((const gchar * const *)flags, strflag); g_strfreev(flags); return ret; } |