comparison src/ops.c @ 10692:d9aeddd9086b v8.0.0236

patch 8.0.0236: gcc complains about uninitialized variable commit https://github.com/vim/vim/commit/6a717f17ec6b09634be1c29e0ac4c35213f7b32d Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 24 20:47:50 2017 +0100 patch 8.0.0236: gcc complains about uninitialized variable Problem: Gcc complains that a variable may be used uninitialized. Confusion between variable and label name. (John Marriott) Solution: Initialize it. Rename end to end_lnum.
author Christian Brabandt <cb@256bit.org>
date Tue, 24 Jan 2017 21:00:05 +0100
parents 3d1872fbecc4
children 9938c90d1e6c
comparison
equal deleted inserted replaced
10691:8a556ede8e87 10692:d9aeddd9086b
3772 /* 3772 /*
3773 * simple case: insert into current line 3773 * simple case: insert into current line
3774 */ 3774 */
3775 if (y_type == MCHAR && y_size == 1) 3775 if (y_type == MCHAR && y_size == 1)
3776 { 3776 {
3777 linenr_T end; 3777 linenr_T end_lnum = 0; /* init for gcc */
3778 3778
3779 if (VIsual_active) 3779 if (VIsual_active)
3780 { 3780 {
3781 end = curbuf->b_visual.vi_end.lnum; 3781 end_lnum = curbuf->b_visual.vi_end.lnum;
3782 if (end < curbuf->b_visual.vi_start.lnum) 3782 if (end_lnum < curbuf->b_visual.vi_start.lnum)
3783 end = curbuf->b_visual.vi_start.lnum; 3783 end_lnum = curbuf->b_visual.vi_start.lnum;
3784 } 3784 }
3785 3785
3786 do { 3786 do {
3787 totlen = count * yanklen; 3787 totlen = count * yanklen;
3788 if (totlen > 0) 3788 if (totlen > 0)
3813 curwin->w_cursor.col += (colnr_T)(totlen - 1); 3813 curwin->w_cursor.col += (colnr_T)(totlen - 1);
3814 } 3814 }
3815 } 3815 }
3816 if (VIsual_active) 3816 if (VIsual_active)
3817 lnum++; 3817 lnum++;
3818 } while (VIsual_active && lnum <= end); 3818 } while (VIsual_active && lnum <= end_lnum);
3819 3819
3820 if (VIsual_active) /* reset lnum to the last visual line */ 3820 if (VIsual_active) /* reset lnum to the last visual line */
3821 lnum--; 3821 lnum--;
3822 3822
3823 curbuf->b_op_end = curwin->w_cursor; 3823 curbuf->b_op_end = curwin->w_cursor;