emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 1bf7ca6: Avoid compilation warnings on MS-Windows


From: Eli Zaretskii
Subject: [Emacs-diffs] master 1bf7ca6: Avoid compilation warnings on MS-Windows
Date: Sun, 16 Apr 2017 03:12:56 -0400 (EDT)

branch: master
commit 1bf7ca623b3d3e02617cf0b5f8d7f980384838d3
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Avoid compilation warnings on MS-Windows
    
    * src/w32term.c (w32_read_socket): Avoid compiler warnings about
    parentheses around assignment.
    * src/w32fns.c (w32_createwindow): Remove unused variable
    dwStyle.  Use "|=" where appropriate.
---
 src/w32fns.c  | 15 ++++++---------
 src/w32term.c |  3 ++-
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/w32fns.c b/src/w32fns.c
index 62798f2..8dca032 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2297,7 +2297,6 @@ w32_createwindow (struct frame *f, int *coords)
 {
   HWND hwnd = NULL, parent_hwnd = NULL;
   RECT rect;
-  DWORD dwStyle;
   int top, left;
   Lisp_Object border_width = Fcdr (Fassq (Qborder_width, f->param_alist));
 
@@ -2310,14 +2309,13 @@ w32_createwindow (struct frame *f, int *coords)
        {
          /* If we want a thin border, specify it here.  */
          if (NUMBERP (border_width) && (XINT (border_width) > 0))
-           f->output_data.w32->dwStyle =
-             f->output_data.w32->dwStyle | WS_BORDER;
+           f->output_data.w32->dwStyle |= WS_BORDER;
        }
       else
        /* To decorate a child frame, list all needed elements.  */
-       f->output_data.w32->dwStyle =
-         f->output_data.w32->dwStyle | WS_THICKFRAME | WS_CAPTION
-         | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SYSMENU;
+       f->output_data.w32->dwStyle |= (WS_THICKFRAME | WS_CAPTION
+                                       | WS_MAXIMIZEBOX | WS_MINIMIZEBOX
+                                       | WS_SYSMENU);
     }
   else if (FRAME_UNDECORATED (f))
     {
@@ -2327,14 +2325,13 @@ w32_createwindow (struct frame *f, int *coords)
 
       /* If we want a thin border, specify it here.  */
       if (NUMBERP (border_width) && (XINT (border_width) > 0))
-       f->output_data.w32->dwStyle =
-         f->output_data.w32->dwStyle | WS_BORDER;
+       f->output_data.w32->dwStyle |= WS_BORDER;
     }
   else
     f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW;
 
   /* Always clip children.  */
-  f->output_data.w32->dwStyle = f->output_data.w32->dwStyle | WS_CLIPCHILDREN;
+  f->output_data.w32->dwStyle |= WS_CLIPCHILDREN;
 
   rect.left = rect.top = 0;
   rect.right = FRAME_PIXEL_WIDTH (f);
diff --git a/src/w32term.c b/src/w32term.c
index 1c3d243..36dc636 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5136,7 +5136,8 @@ w32_read_socket (struct terminal *terminal,
            }
 #endif
 
-         if (f = x_window_to_frame (dpyinfo, msg.msg.hwnd))
+         f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
+         if (f)
            x_clear_under_internal_border (f);
 
          check_visibility = 1;



reply via email to

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