comparison src/charset.c @ 16054:78faa25f9698 v8.1.1032

patch 8.1.1032: warnings from clang static analyzer commit https://github.com/vim/vim/commit/2c519cf3bfe76083767ac94c674d2e161ed36587 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 21 21:45:34 2019 +0100 patch 8.1.1032: warnings from clang static analyzer Problem: Warnings from clang static analyzer. (Yegappan Lakshmanan) Solution: Fix relevant warnings.
author Bram Moolenaar <Bram@vim.org>
date Thu, 21 Mar 2019 22:00:05 +0100
parents a6ca8cf07a98
children 77bcb5055fec
comparison
equal deleted inserted replaced
16053:b6ce2c4d15a8 16054:78faa25f9698
1053 1053
1054 col2 += win_chartabsize(wp, s, col2); 1054 col2 += win_chartabsize(wp, s, col2);
1055 if (col2 >= colmax) /* doesn't fit */ 1055 if (col2 >= colmax) /* doesn't fit */
1056 { 1056 {
1057 size = colmax - col + col_adj; 1057 size = colmax - col + col_adj;
1058 tab_corr = FALSE;
1059 break; 1058 break;
1060 } 1059 }
1061 } 1060 }
1062 } 1061 }
1063 else if (has_mbyte && size == 2 && MB_BYTE2LEN(*s) > 1 1062 else if (has_mbyte && size == 2 && MB_BYTE2LEN(*s) > 1
1106 { 1105 {
1107 if (size + sbrlen + numberwidth > (colnr_T)wp->w_width) 1106 if (size + sbrlen + numberwidth > (colnr_T)wp->w_width)
1108 { 1107 {
1109 /* calculate effective window width */ 1108 /* calculate effective window width */
1110 int width = (colnr_T)wp->w_width - sbrlen - numberwidth; 1109 int width = (colnr_T)wp->w_width - sbrlen - numberwidth;
1111 int prev_width = col ? ((colnr_T)wp->w_width - (sbrlen + col)) : 0; 1110 int prev_width = col
1111 ? ((colnr_T)wp->w_width - (sbrlen + col)) : 0;
1112 if (width == 0) 1112 if (width == 0)
1113 width = (colnr_T)wp->w_width; 1113 width = (colnr_T)wp->w_width;
1114 added += ((size - prev_width) / width) * vim_strsize(p_sbr); 1114 added += ((size - prev_width) / width) * vim_strsize(p_sbr);
1115 if ((size - prev_width) % width) 1115 if ((size - prev_width) % width)
1116 /* wrapped, add another length of 'sbr' */ 1116 /* wrapped, add another length of 'sbr' */
1961 } 1961 }
1962 #endif 1962 #endif
1963 1963
1964 /* 1964 /*
1965 * Return TRUE if "str" starts with a backslash that should be removed. 1965 * Return TRUE if "str" starts with a backslash that should be removed.
1966 * For MS-DOS, WIN32 and OS/2 this is only done when the character after the 1966 * For MS-DOS, MSWIN and OS/2 this is only done when the character after the
1967 * backslash is not a normal file name character. 1967 * backslash is not a normal file name character.
1968 * '$' is a valid file name character, we don't remove the backslash before 1968 * '$' is a valid file name character, we don't remove the backslash before
1969 * it. This means it is not possible to use an environment variable after a 1969 * it. This means it is not possible to use an environment variable after a
1970 * backslash. "C:\$VIM\doc" is taken literally, only "$VIM\doc" works. 1970 * backslash. "C:\$VIM\doc" is taken literally, only "$VIM\doc" works.
1971 * Although "\ name" is valid, the backslash in "Program\ files" must be 1971 * Although "\ name" is valid, the backslash in "Program\ files" must be