emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1200e55b6f: Make use of NILP where possible


From: Andrea Corallo
Subject: master 1200e55b6f: Make use of NILP where possible
Date: Wed, 26 Jan 2022 06:59:37 -0500 (EST)

branch: master
commit 1200e55b6f359c2ba71138d5b0a2093ef163d805
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    Make use of NILP where possible
    
    * src/w32menu.c (menubar_selection_callback, w32_menu_show): Use NILP
    where possible.
    * src/w32fns.c (w32_set_mouse_color): Likewise.
    * src/w16select.c (Fw16_selection_exists_p): Likewise.
    * src/process.c (Fnetwork_lookup_address_info): Likewise.
    * src/cygw32.c (Fcygwin_convert_file_name_to_windows)
    (Fcygwin_convert_file_name_from_windows): Likewise.
---
 src/cygw32.c    |  4 ++--
 src/process.c   |  2 +-
 src/w16select.c |  2 +-
 src/w32fns.c    | 12 ++++++------
 src/w32menu.c   |  6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/cygw32.c b/src/cygw32.c
index 1b43de2c05..399c1f91b9 100644
--- a/src/cygw32.c
+++ b/src/cygw32.c
@@ -115,7 +115,7 @@ For the reverse operation, see 
`cygwin-convert-file-name-from-windows'.  */)
   (Lisp_Object file, Lisp_Object absolute_p)
 {
   return from_unicode (
-    conv_filename_to_w32_unicode (file, EQ (absolute_p, Qnil) ? 0 : 1));
+    conv_filename_to_w32_unicode (file, NILP (absolute_p) ? 0 : 1));
 }
 
 DEFUN ("cygwin-convert-file-name-from-windows",
@@ -128,7 +128,7 @@ For the reverse operation, see 
`cygwin-convert-file-name-to-windows'.  */)
   (Lisp_Object file, Lisp_Object absolute_p)
 {
   return conv_filename_from_w32_unicode (to_unicode (file, &file),
-                                         EQ (absolute_p, Qnil) ? 0 : 1);
+                                        NILP (absolute_p) ? 0 : 1);
 }
 
 void
diff --git a/src/process.c b/src/process.c
index 79e5896a20..7c7f608284 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4644,7 +4644,7 @@ error displays the error message.  */)
   struct addrinfo hints;
 
   memset (&hints, 0, sizeof hints);
-  if (EQ (family, Qnil))
+  if (NILP (family))
     hints.ai_family = AF_UNSPEC;
   else if (EQ (family, Qipv4))
     hints.ai_family = AF_INET;
diff --git a/src/w16select.c b/src/w16select.c
index f6bc3dd8d4..b878481e46 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -651,7 +651,7 @@ frame's display, or the first available X display.  */)
      by the X interface code.  (On MSDOS, killed text is only put
      into the clipboard if we run under Windows, so we cannot check
      the clipboard alone.)  */
-  if ((EQ (selection, Qnil) || EQ (selection, QPRIMARY))
+  if ((NILP (selection) || EQ (selection, QPRIMARY))
       && ! NILP (Fsymbol_value (Fintern_soft (build_string ("kill-ring"),
                                              Qnil))))
     return Qt;
diff --git a/src/w32fns.c b/src/w32fns.c
index 37f9b813c6..1ea685d194 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1217,7 +1217,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, 
Lisp_Object oldval)
 #endif
   int mask_color;
 
-  if (!EQ (Qnil, arg))
+  if (!NILP (arg))
     f->output_data.w32->mouse_pixel
       = w32_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
   mask_color = FRAME_BACKGROUND_PIXEL (f);
@@ -1233,7 +1233,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, 
Lisp_Object oldval)
   /* It's not okay to crash if the user selects a screwy cursor.  */
   count = x_catch_errors (FRAME_W32_DISPLAY (f));
 
-  if (!EQ (Qnil, Vx_pointer_shape))
+  if (!NILP (Vx_pointer_shape))
     {
       CHECK_FIXNUM (Vx_pointer_shape);
       cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XFIXNUM 
(Vx_pointer_shape));
@@ -1242,7 +1242,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, 
Lisp_Object oldval)
     cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm);
   x_check_errors (FRAME_W32_DISPLAY (f), "bad text pointer cursor: %s");
 
-  if (!EQ (Qnil, Vx_nontext_pointer_shape))
+  if (!NILP (Vx_nontext_pointer_shape))
     {
       CHECK_FIXNUM (Vx_nontext_pointer_shape);
       nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
@@ -1252,7 +1252,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, 
Lisp_Object oldval)
     nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_left_ptr);
   x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
 
-  if (!EQ (Qnil, Vx_hourglass_pointer_shape))
+  if (!NILP (Vx_hourglass_pointer_shape))
     {
       CHECK_FIXNUM (Vx_hourglass_pointer_shape);
       hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
@@ -1263,7 +1263,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, 
Lisp_Object oldval)
   x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s");
 
   x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
-  if (!EQ (Qnil, Vx_mode_pointer_shape))
+  if (!NILP (Vx_mode_pointer_shape))
     {
       CHECK_FIXNUM (Vx_mode_pointer_shape);
       mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
@@ -1273,7 +1273,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, 
Lisp_Object oldval)
     mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm);
   x_check_errors (FRAME_W32_DISPLAY (f), "bad modeline pointer cursor: %s");
 
-  if (!EQ (Qnil, Vx_sensitive_text_pointer_shape))
+  if (!NILP (Vx_sensitive_text_pointer_shape))
     {
       CHECK_FIXNUM (Vx_sensitive_text_pointer_shape);
       hand_cursor
diff --git a/src/w32menu.c b/src/w32menu.c
index 42e27babbc..57f6762c2f 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -188,7 +188,7 @@ menubar_selection_callback (struct frame *f, void * 
client_data)
   i = 0;
   while (i < f->menu_bar_items_used)
     {
-      if (EQ (AREF (vector, i), Qnil))
+      if (NILP (AREF (vector, i)))
        {
          subprefix_stack[submenu_depth++] = prefix;
          prefix = entry;
@@ -587,7 +587,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags,
   i = 0;
   while (i < menu_items_used)
     {
-      if (EQ (AREF (menu_items, i), Qnil))
+      if (NILP (AREF (menu_items, i)))
        {
          submenu_stack[submenu_depth++] = save_wv;
          save_wv = prev_wv;
@@ -779,7 +779,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags,
       i = 0;
       while (i < menu_items_used)
        {
-         if (EQ (AREF (menu_items, i), Qnil))
+         if (NILP (AREF (menu_items, i)))
            {
              subprefix_stack[submenu_depth++] = prefix;
              prefix = entry;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]