]> granicus.if.org Git - vim/commitdiff
patch 8.0.0069 v8.0.0069
authorBram Moolenaar <Bram@vim.org>
Sun, 6 Nov 2016 14:25:42 +0000 (15:25 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 6 Nov 2016 14:25:42 +0000 (15:25 +0100)
Problem:    Compiler warning for self-comparison.
Solution:   Define ONE_WINDOW and add #ifdef.

src/buffer.c
src/ex_docmd.c
src/globals.h
src/move.c
src/quickfix.c
src/screen.c
src/version.c
src/window.c

index 509a7bcd403637cae909cc0e8b9acac846bd7224..8b1bceb253ff6aa7390cdb236197aba521046da1 100644 (file)
@@ -4935,7 +4935,7 @@ do_arg_all(
                    }
 #ifdef FEAT_WINDOWS
                    /* don't close last window */
-                   if (firstwin == lastwin
+                   if (ONE_WINDOW
                            && (first_tabpage->tp_next == NULL || !had_tab))
 #endif
                        use_firstwin = TRUE;
index 6802b8b3d7c9b926676c8a74f41b4c69e86cdf3b..dcb5cfe04158912301060a0c7a37427657c16473 100644 (file)
@@ -7239,7 +7239,7 @@ ex_quit(exarg_T *eap)
         * :h|wincmd w|1q     - don't quit
         * :h|wincmd w|q      - quit
         */
-       if (only_one_window() && (firstwin == lastwin || eap->addr_count == 0))
+       if (only_one_window() && (ONE_WINDOW || eap->addr_count == 0))
 #endif
            getout(0);
 #ifdef FEAT_WINDOWS
index ffcadb737a4d3b79b3617ecbd456fe37eec6c70d..fea9543a78010cd8b08b3317e9c8f7c9fee1517c 100644 (file)
@@ -546,6 +546,7 @@ EXTERN int  clip_unnamed_saved INIT(= 0);
 EXTERN win_T   *firstwin;              /* first window */
 EXTERN win_T   *lastwin;               /* last window */
 EXTERN win_T   *prevwin INIT(= NULL);  /* previous window */
+# define ONE_WINDOW (firstwin == lastwin)
 # define W_NEXT(wp) ((wp)->w_next)
 # define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next)
 # define FOR_ALL_TABPAGES(tp) for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
@@ -563,6 +564,7 @@ EXTERN win_T        *prevwin INIT(= NULL);  /* previous window */
 #else
 # define firstwin curwin
 # define lastwin curwin
+# define ONE_WINDOW 1
 # define W_NEXT(wp) NULL
 # define FOR_ALL_WINDOWS(wp) wp = curwin;
 # define FOR_ALL_TABPAGES(tp) for (;FALSE;)
index c7acdfa68b42b011b05fddf59a4a374bd85a28e9..912e51ccd151312f578420b58114f68429f14fca 100644 (file)
@@ -2311,7 +2311,7 @@ onepage(int dir, long count)
 #endif
        if (dir == FORWARD)
        {
-           if (firstwin == lastwin && p_window > 0 && p_window < Rows - 1)
+           if (ONE_WINDOW && p_window > 0 && p_window < Rows - 1)
            {
                /* Vi compatible scrolling */
                if (p_window <= 2)
@@ -2361,7 +2361,7 @@ onepage(int dir, long count)
                continue;
            }
 #endif
-           if (firstwin == lastwin && p_window > 0 && p_window < Rows - 1)
+           if (ONE_WINDOW && p_window > 0 && p_window < Rows - 1)
            {
                /* Vi compatible scrolling (sort of) */
                if (p_window <= 2)
index c3def1bc01afcee2f00d945ee94e0c1eb5fb26c9..a45faeaa9da9390b4d75cc488b8777edfec58a76 100644 (file)
@@ -2137,7 +2137,7 @@ win_found:
         * If there is only one window and it is the quickfix window, create a
         * new one above the quickfix window.
         */
-       if (((firstwin == lastwin) && bt_quickfix(curbuf)) || !usable_win)
+       if ((ONE_WINDOW && bt_quickfix(curbuf)) || !usable_win)
        {
            flags = WSP_ABOVE;
            if (ll_ref != NULL)
index c98d5670b30ad34d2b4aea47a8584eda01cebb05..621f25c0d66a10210e2125752b93eaaff2acb8c8 100644 (file)
@@ -1510,7 +1510,7 @@ win_update(win_T *wp)
        if (mid_start == 0)
        {
            mid_end = wp->w_height;
-           if (lastwin == firstwin)
+           if (ONE_WINDOW)
            {
                /* Clear the screen when it was not done by win_del_lines() or
                 * win_ins_lines() above, "screen_cleared" is FALSE or MAYBE
@@ -5670,7 +5670,10 @@ win_line(
 #ifdef FEAT_DIFF
                     && filler_todo <= 0
 #endif
-                    && W_WIDTH(wp) == Columns)
+#ifdef FEAT_WINDOWS
+                    && W_WIDTH(wp) == Columns
+#endif
+                    )
            {
                /* Remember that the line wraps, used for modeless copy. */
                LineWraps[screen_row - 1] = TRUE;
@@ -10524,7 +10527,7 @@ fillchar_status(int *attr, int is_curwin)
      * window differs, or the fillchars differ, or this is not the
      * current window */
     if (*attr != 0 && ((hl_attr(HLF_S) != hl_attr(HLF_SNC)
-                       || !is_curwin || firstwin == lastwin)
+                       || !is_curwin || ONE_WINDOW)
                    || (fill_stl != fill_stlnc)))
        return fill;
     if (is_curwin)
index 4a0725bb354cd2c50b3033dd57db594a860cc91e..c698e446b2c619f4af76b5e801bb150d1b6c0652 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    69,
 /**/
     68,
 /**/
index f61a83bb25bb764bf0f6545f2df90bf6e8a20e85..17656d54a443881cef33a3218256b6d4a1c6431c 100644 (file)
@@ -234,7 +234,7 @@ newwindow:
 /* cursor to previous window with wrap around */
     case 'W':
                CHECK_CMDWIN
-               if (firstwin == lastwin && Prenum != 1) /* just one window */
+               if (ONE_WINDOW && Prenum != 1)  /* just one window */
                    beep_flush();
                else
                {
@@ -1593,7 +1593,7 @@ win_rotate(int upwards, int count)
     frame_T    *frp;
     int                n;
 
-    if (firstwin == lastwin)           /* nothing to do */
+    if (ONE_WINDOW)            /* nothing to do */
     {
        beep_flush();
        return;
@@ -2206,7 +2206,7 @@ one_window(void)
     }
     return TRUE;
 #else
-    return firstwin == lastwin;
+    return ONE_WINDOW;
 #endif
 }
 
@@ -2220,7 +2220,7 @@ close_last_window_tabpage(
     int                free_buf,
     tabpage_T   *prev_curtab)
 {
-    if (firstwin == lastwin)
+    if (ONE_WINDOW)
     {
 #ifdef FEAT_AUTOCMD
        buf_T   *old_curbuf = curbuf;
@@ -2625,7 +2625,7 @@ winframe_remove(
     /*
      * If there is only one window there is nothing to remove.
      */
-    if (tp == NULL ? firstwin == lastwin : tp->tp_firstwin == tp->tp_lastwin)
+    if (tp == NULL ? ONE_WINDOW : tp->tp_firstwin == tp->tp_lastwin)
        return NULL;
 
     /*
@@ -2780,7 +2780,7 @@ win_altframe(
     frame_T    *frp;
     int                b;
 
-    if (tp == NULL ? firstwin == lastwin : tp->tp_firstwin == tp->tp_lastwin)
+    if (tp == NULL ? ONE_WINDOW : tp->tp_firstwin == tp->tp_lastwin)
        /* Last window in this tab page, will go to next tab page. */
        return alt_tabpage()->tp_curwin->w_frame;