diff options
| author | Paul Eggert | 2020-12-25 00:27:37 -0800 |
|---|---|---|
| committer | Paul Eggert | 2020-12-25 01:40:39 -0800 |
| commit | b8b17038e140fe215a76f2e899c00b9b95614886 (patch) | |
| tree | a6dcb19d6c109b57082232487e156061e70c1894 /src | |
| parent | 290ee3474d8c7334e12baef0f922f9622a045cd5 (diff) | |
| download | emacs-b8b17038e140fe215a76f2e899c00b9b95614886.tar.gz emacs-b8b17038e140fe215a76f2e899c00b9b95614886.zip | |
Pacify gcc 10.2 -Wanalyzer-null-argument in gtkutil.c
* src/gtkutil.c (xg_item_label_same_p): Simplify. Without this
simplification, GCC (Ubuntu 10.2.0-13ubuntu1)
-Wanalyzer-null-argument complains about use of NULL where
non-null expected as argument of strcmp.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gtkutil.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index fafd94c0f71..807ee17fa30 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -2944,14 +2944,11 @@ xg_get_menu_item_label (GtkMenuItem *witem) | |||
| 2944 | static bool | 2944 | static bool |
| 2945 | xg_item_label_same_p (GtkMenuItem *witem, const char *label) | 2945 | xg_item_label_same_p (GtkMenuItem *witem, const char *label) |
| 2946 | { | 2946 | { |
| 2947 | bool is_same = 0; | ||
| 2948 | char *utf8_label = get_utf8_string (label); | 2947 | char *utf8_label = get_utf8_string (label); |
| 2949 | const char *old_label = witem ? xg_get_menu_item_label (witem) : 0; | 2948 | const char *old_label = witem ? xg_get_menu_item_label (witem) : 0; |
| 2950 | 2949 | ||
| 2951 | if (! old_label && ! utf8_label) | 2950 | bool is_same = (!old_label == !utf8_label |
| 2952 | is_same = 1; | 2951 | && (!old_label || strcmp (utf8_label, old_label) == 0)); |
| 2953 | else if (old_label && utf8_label) | ||
| 2954 | is_same = strcmp (utf8_label, old_label) == 0; | ||
| 2955 | 2952 | ||
| 2956 | if (utf8_label) g_free (utf8_label); | 2953 | if (utf8_label) g_free (utf8_label); |
| 2957 | 2954 | ||