summaryrefslogtreecommitdiff
path: root/src/xfns.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-07-11 01:12:00 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2021-07-11 01:30:12 -0700
commit3b29afa68070f3040f08fec0077213f9a15d1adc (patch)
tree145917aa56335ad4ced9886537765d8557903729 /src/xfns.c
parentf6472cc8e2fdcfd7365240783f34e101fe44142b (diff)
downloademacs-3b29afa68070f3040f08fec0077213f9a15d1adc.tar.gz
emacs-3b29afa68070f3040f08fec0077213f9a15d1adc.tar.bz2
emacs-3b29afa68070f3040f08fec0077213f9a15d1adc.zip
Pacify GCC 11.1.1 20210531 (Red Hat 11.1.1-3)
* src/image.c (xpm_load_image): * src/xfns.c (x_icon): Rework to pacify gcc -Wmaybe-uninitialized.
Diffstat (limited to 'src/xfns.c')
-rw-r--r--src/xfns.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xfns.c b/src/xfns.c
index e46616e6d66..81349d0b50d 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3361,17 +3361,19 @@ x_icon (struct frame *f, Lisp_Object parms)
= gui_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
int icon_xval, icon_yval;
- if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
+ bool xgiven = !EQ (icon_x, Qunbound);
+ bool ygiven = !EQ (icon_y, Qunbound);
+ if (xgiven != ygiven)
+ error ("Both left and top icon corners of icon must be specified");
+ if (xgiven)
{
icon_xval = check_integer_range (icon_x, INT_MIN, INT_MAX);
icon_yval = check_integer_range (icon_y, INT_MIN, INT_MAX);
}
- else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
- error ("Both left and top icon corners of icon must be specified");
block_input ();
- if (! EQ (icon_x, Qunbound))
+ if (xgiven)
x_wm_set_icon_position (f, icon_xval, icon_yval);
#if false /* gui_display_get_arg removes the visibility parameter as a