Replace vim_iswhite with ascii_iswhite() defined in ascii.h

This commit is contained in:
Felipe Oliveira Carvalho
2015-04-22 19:12:26 -03:00
parent d350d12a00
commit 93bf201119
33 changed files with 198 additions and 192 deletions

View File

@@ -347,7 +347,7 @@ static void shift_block(oparg_T *oap, int amount)
else
++bd.textstart;
}
for (; vim_iswhite(*bd.textstart); ) {
for (; ascii_iswhite(*bd.textstart); ) {
// TODO: is passing bd.textstart for start of the line OK?
incr = lbr_chartabsize_adv(bd.textstart, &bd.textstart, (colnr_T)(bd.start_vcol));
total += incr;
@@ -403,7 +403,7 @@ static void shift_block(oparg_T *oap, int amount)
/* The character's column is in "bd.start_vcol". */
non_white_col = bd.start_vcol;
while (vim_iswhite(*non_white)) {
while (ascii_iswhite(*non_white)) {
incr = lbr_chartabsize_adv(bd.textstart, &non_white, non_white_col);
non_white_col += incr;
}
@@ -3613,15 +3613,15 @@ static int same_leader(linenr_T lnum, int leader1_len, char_u *leader1_flags, in
* The first line has to be saved, only one line can be locked at a time.
*/
line1 = vim_strsave(ml_get(lnum));
for (idx1 = 0; vim_iswhite(line1[idx1]); ++idx1)
for (idx1 = 0; ascii_iswhite(line1[idx1]); ++idx1)
;
line2 = ml_get(lnum + 1);
for (idx2 = 0; idx2 < leader2_len; ++idx2) {
if (!vim_iswhite(line2[idx2])) {
if (!ascii_iswhite(line2[idx2])) {
if (line1[idx1++] != line2[idx2])
break;
} else
while (vim_iswhite(line1[idx1]))
while (ascii_iswhite(line1[idx1]))
++idx1;
}
xfree(line1);
@@ -3979,10 +3979,10 @@ static int ends_in_white(linenr_T lnum)
if (*s == NUL)
return FALSE;
/* Don't use STRLEN() inside vim_iswhite(), SAS/C complains: "macro
/* Don't use STRLEN() inside ascii_iswhite(), SAS/C complains: "macro
* invocation may call function multiple times". */
l = STRLEN(s) - 1;
return vim_iswhite(s[l]);
return ascii_iswhite(s[l]);
}
/*
@@ -4103,7 +4103,7 @@ static void block_prep(oparg_T *oap, struct block_def *bdp, linenr_T lnum, int i
/* Count a tab for what it's worth (if list mode not on) */
incr = lbr_chartabsize(line, pstart, (colnr_T)bdp->start_vcol);
bdp->start_vcol += incr;
if (vim_iswhite(*pstart)) {
if (ascii_iswhite(*pstart)) {
bdp->pre_whitesp += incr;
bdp->pre_whitesp_c++;
} else {