comparison src/normal.c @ 7009:286fd54c7ae3 v7.4.822

patch 7.4.822 Problem: More problems reported by coverity. Solution: Avoid the warnings. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Tue, 11 Aug 2015 19:14:00 +0200
parents 27f8247d2619
children 052043fc57ab
comparison
equal deleted inserted replaced
7008:7ce1f4e998bb 7009:286fd54c7ae3
2863 getvcols(curwin, &start_visual, &end_visual, &leftcol, &rightcol); 2863 getvcols(curwin, &start_visual, &end_visual, &leftcol, &rightcol);
2864 if (curwin->w_curswant > (leftcol + rightcol) / 2) 2864 if (curwin->w_curswant > (leftcol + rightcol) / 2)
2865 end_visual.col = leftcol; 2865 end_visual.col = leftcol;
2866 else 2866 else
2867 end_visual.col = rightcol; 2867 end_visual.col = rightcol;
2868 if (curwin->w_cursor.lnum < 2868 if (curwin->w_cursor.lnum >=
2869 (start_visual.lnum + end_visual.lnum) / 2) 2869 (start_visual.lnum + end_visual.lnum) / 2)
2870 end_visual.lnum = end_visual.lnum;
2871 else
2872 end_visual.lnum = start_visual.lnum; 2870 end_visual.lnum = start_visual.lnum;
2873 2871
2874 /* move VIsual to the right column */ 2872 /* move VIsual to the right column */
2875 start_visual = curwin->w_cursor; /* save the cursor pos */ 2873 start_visual = curwin->w_cursor; /* save the cursor pos */
2876 curwin->w_cursor = end_visual; 2874 curwin->w_cursor = end_visual;
3805 top = curwin->w_cursor.lnum; 3803 top = curwin->w_cursor.lnum;
3806 bot = VIsual.lnum; 3804 bot = VIsual.lnum;
3807 } 3805 }
3808 # ifdef FEAT_FOLDING 3806 # ifdef FEAT_FOLDING
3809 /* Include closed folds as a whole. */ 3807 /* Include closed folds as a whole. */
3810 hasFolding(top, &top, NULL); 3808 (void)hasFolding(top, &top, NULL);
3811 hasFolding(bot, NULL, &bot); 3809 (void)hasFolding(bot, NULL, &bot);
3812 # endif 3810 # endif
3813 lines = bot - top + 1; 3811 lines = bot - top + 1;
3814 3812
3815 if (VIsual_mode == Ctrl_V) 3813 if (VIsual_mode == Ctrl_V)
3816 { 3814 {
5952 { 5950 {
5953 /* Count a fold for one screen line. */ 5951 /* Count a fold for one screen line. */
5954 lnum = curwin->w_topline; 5952 lnum = curwin->w_topline;
5955 while (n-- > 0 && lnum < curwin->w_botline - 1) 5953 while (n-- > 0 && lnum < curwin->w_botline - 1)
5956 { 5954 {
5957 hasFolding(lnum, NULL, &lnum); 5955 (void)hasFolding(lnum, NULL, &lnum);
5958 ++lnum; 5956 ++lnum;
5959 } 5957 }
5960 n = lnum - curwin->w_topline; 5958 n = lnum - curwin->w_topline;
5961 } 5959 }
5962 #endif 5960 #endif
6252 6250
6253 if (ptr != NULL) 6251 if (ptr != NULL)
6254 { 6252 {
6255 /* do autowrite if necessary */ 6253 /* do autowrite if necessary */
6256 if (curbufIsChanged() && curbuf->b_nwindows <= 1 && !P_HID(curbuf)) 6254 if (curbufIsChanged() && curbuf->b_nwindows <= 1 && !P_HID(curbuf))
6257 autowrite(curbuf, FALSE); 6255 (void)autowrite(curbuf, FALSE);
6258 setpcmark(); 6256 setpcmark();
6259 (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LAST, 6257 (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
6260 P_HID(curbuf) ? ECMD_HIDE : 0, curwin); 6258 P_HID(curbuf) ? ECMD_HIDE : 0, curwin);
6261 if (cap->nchar == 'F' && lnum >= 0) 6259 if (cap->nchar == 'F' && lnum >= 0)
6262 { 6260 {