]> git.eshelyaron.com Git - emacs.git/commitdiff
Pacify GCC 12 -fanalyzer in x_popup_menu_1
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 31 May 2022 08:19:32 +0000 (01:19 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 31 May 2022 08:26:47 +0000 (01:26 -0700)
* src/menu.c (x_popup_menu_1): Rework to avoid unnecessary
initialization and test.  This also pacifies GCC 12.

src/menu.c

index 398bf9329ffb1d5574737b8145e61a7cc31c18ad..eeb0c9a7e5b9eb3703f330e2d3711ac596dd2857 100644 (file)
@@ -1118,7 +1118,7 @@ x_popup_menu_1 (Lisp_Object position, Lisp_Object menu)
   Lisp_Object title;
   const char *error_name = NULL;
   Lisp_Object selection = Qnil;
-  struct frame *f = NULL;
+  struct frame *f;
   Lisp_Object x, y, window;
   int menuflags = 0;
   specpdl_ref specpdl_count = SPECPDL_INDEX ();
@@ -1269,9 +1269,9 @@ x_popup_menu_1 (Lisp_Object position, Lisp_Object menu)
          }
       }
     else
-      /* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME,
+      /* ??? Not really clean; should be Qwindow_or_framep
         but I don't want to make one now.  */
-      CHECK_WINDOW (window);
+      wrong_type_argument (Qwindowp, window);
 
     xpos += check_integer_range (x,
                                 (xpos < INT_MIN - MOST_NEGATIVE_FIXNUM