From aee80f6d455968ac397b0487b297f2031193bd31 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 31 May 2018 22:54:51 +0200 Subject: [PATCH 2/2] Avoid excessive type-casting --- libxfce4util/xfce-rc-simple.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libxfce4util/xfce-rc-simple.c b/libxfce4util/xfce-rc-simple.c index fbc4db3..c615d93 100644 --- a/libxfce4util/xfce-rc-simple.c +++ b/libxfce4util/xfce-rc-simple.c @@ -627,12 +627,14 @@ _xfce_rc_simple_parse (XfceRcSimple *simple) gchar *locale; gchar *value; gchar *key; + XfceRc *rc; FILE *fp; _xfce_return_val_if_fail (simple != NULL, FALSE); _xfce_return_val_if_fail (simple->filename != NULL, FALSE); - readonly = xfce_rc_is_readonly (XFCE_RC (simple)); + rc = XFCE_RC (simple); + readonly = xfce_rc_is_readonly (rc); fp = fopen (simple->filename, "r"); if (fp == NULL) @@ -655,14 +657,11 @@ _xfce_rc_simple_parse (XfceRcSimple *simple) continue; } - if (XFCE_RC (simple)->locale == NULL) + if (rc->locale == NULL) continue; - if (xfce_locale_match (XFCE_RC (simple)->locale, locale) > XFCE_LOCALE_NO_MATCH - || !readonly) - { - simple_add_entry (simple, key, value, locale); - } + if (!readonly || xfce_locale_match (rc->locale, locale) > XFCE_LOCALE_NO_MATCH) + simple_add_entry (simple, key, value, locale); } fclose (fp); -- 2.17.1