comparison src/ops.c @ 18251:c8a53c0daeed v8.1.2120

patch 8.1.2120: some MB_ macros are more complicated than necessary Commit: https://github.com/vim/vim/commit/1614a14901558ca091329315d14a7d5e1b53aa47 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 6 22:00:13 2019 +0200 patch 8.1.2120: some MB_ macros are more complicated than necessary Problem: Some MB_ macros are more complicated than necessary. (Dominique Pelle) Solution: Simplify the macros. Expand inline.
author Bram Moolenaar <Bram@vim.org>
date Sun, 06 Oct 2019 22:15:04 +0200
parents 5d67f207f7c3
children fe5afdc03bd2
comparison
equal deleted inserted replaced
18250:f1d9d3f76c98 18251:c8a53c0daeed
3221 col = pos->col; 3221 col = pos->col;
3222 3222
3223 while (ptr[col] != NUL 3223 while (ptr[col] != NUL
3224 && !vim_isdigit(ptr[col]) 3224 && !vim_isdigit(ptr[col])
3225 && !(doalp && ASCII_ISALPHA(ptr[col]))) 3225 && !(doalp && ASCII_ISALPHA(ptr[col])))
3226 col += MB_PTR2LEN(ptr + col); 3226 col += mb_ptr2len(ptr + col);
3227 3227
3228 while (col > 0 3228 while (col > 0
3229 && vim_isdigit(ptr[col - 1]) 3229 && vim_isdigit(ptr[col - 1])
3230 && !(doalp && ASCII_ISALPHA(ptr[col]))) 3230 && !(doalp && ASCII_ISALPHA(ptr[col])))
3231 { 3231 {
3240 { 3240 {
3241 while (ptr[col] != NUL && length > 0 3241 while (ptr[col] != NUL && length > 0
3242 && !vim_isdigit(ptr[col]) 3242 && !vim_isdigit(ptr[col])
3243 && !(doalp && ASCII_ISALPHA(ptr[col]))) 3243 && !(doalp && ASCII_ISALPHA(ptr[col])))
3244 { 3244 {
3245 int mb_len = MB_PTR2LEN(ptr + col); 3245 int mb_len = mb_ptr2len(ptr + col);
3246 3246
3247 col += mb_len; 3247 col += mb_len;
3248 length -= mb_len; 3248 length -= mb_len;
3249 } 3249 }
3250 3250