comparison src/spellfile.c @ 11127:506f5d8b7d8b v8.0.0451

patch 8.0.0451: some macros are in lower case commit https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 12 19:22:36 2017 +0100 patch 8.0.0451: some macros are in lower case Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice.
author Christian Brabandt <cb@256bit.org>
date Sun, 12 Mar 2017 19:30:05 +0100
parents 7d735b86f764
children 514c1741ab8c
comparison
equal deleted inserted replaced
11126:48599a3eae0b 11127:506f5d8b7d8b
1427 /* First count the number of items for each list. Temporarily use 1427 /* First count the number of items for each list. Temporarily use
1428 * sl_sal_first[] for this. */ 1428 * sl_sal_first[] for this. */
1429 for (p = from, s = to; *p != NUL && *s != NUL; ) 1429 for (p = from, s = to; *p != NUL && *s != NUL; )
1430 { 1430 {
1431 c = mb_cptr2char_adv(&p); 1431 c = mb_cptr2char_adv(&p);
1432 mb_cptr_adv(s); 1432 MB_CPTR_ADV(s);
1433 if (c >= 256) 1433 if (c >= 256)
1434 ++lp->sl_sal_first[c & 0xff]; 1434 ++lp->sl_sal_first[c & 0xff];
1435 } 1435 }
1436 if (*p != NUL || *s != NUL) /* lengths differ */ 1436 if (*p != NUL || *s != NUL) /* lengths differ */
1437 return SP_FORMERROR; 1437 return SP_FORMERROR;
2800 && (aff_entry->ae_cond == NULL 2800 && (aff_entry->ae_cond == NULL
2801 || PTR2CHAR(aff_entry->ae_cond) == c)) 2801 || PTR2CHAR(aff_entry->ae_cond) == c))
2802 { 2802 {
2803 p = aff_entry->ae_add 2803 p = aff_entry->ae_add
2804 + STRLEN(aff_entry->ae_add); 2804 + STRLEN(aff_entry->ae_add);
2805 mb_ptr_back(aff_entry->ae_add, p); 2805 MB_PTR_BACK(aff_entry->ae_add, p);
2806 if (PTR2CHAR(p) == c_up) 2806 if (PTR2CHAR(p) == c_up)
2807 { 2807 {
2808 upper = TRUE; 2808 upper = TRUE;
2809 aff_entry->ae_chop = NULL; 2809 aff_entry->ae_chop = NULL;
2810 *p = NUL; 2810 *p = NUL;
2928 smsg((char_u *)_(e_afftrailing), fname, lnum, items[3]); 2928 smsg((char_u *)_(e_afftrailing), fname, lnum, items[3]);
2929 if (items[0][3] == 'S' ? do_repsal : do_rep) 2929 if (items[0][3] == 'S' ? do_repsal : do_rep)
2930 { 2930 {
2931 /* Replace underscore with space (can't include a space 2931 /* Replace underscore with space (can't include a space
2932 * directly). */ 2932 * directly). */
2933 for (p = items[1]; *p != NUL; mb_ptr_adv(p)) 2933 for (p = items[1]; *p != NUL; MB_PTR_ADV(p))
2934 if (*p == '_') 2934 if (*p == '_')
2935 *p = ' '; 2935 *p = ' ';
2936 for (p = items[2]; *p != NUL; mb_ptr_adv(p)) 2936 for (p = items[2]; *p != NUL; MB_PTR_ADV(p))
2937 if (*p == '_') 2937 if (*p == '_')
2938 *p = ' '; 2938 *p = ' ';
2939 add_fromto(spin, items[0][3] == 'S' 2939 add_fromto(spin, items[0][3] == 'S'
2940 ? &spin->si_repsal 2940 ? &spin->si_repsal
2941 : &spin->si_rep, items[1], items[2]); 2941 : &spin->si_rep, items[1], items[2]);
3622 } 3622 }
3623 3623
3624 /* Truncate the word at the "/", set "afflist" to what follows. 3624 /* Truncate the word at the "/", set "afflist" to what follows.
3625 * Replace "\/" by "/" and "\\" by "\". */ 3625 * Replace "\/" by "/" and "\\" by "\". */
3626 afflist = NULL; 3626 afflist = NULL;
3627 for (p = w; *p != NUL; mb_ptr_adv(p)) 3627 for (p = w; *p != NUL; MB_PTR_ADV(p))
3628 { 3628 {
3629 if (*p == '\\' && (p[1] == '\\' || p[1] == '/')) 3629 if (*p == '\\' && (p[1] == '\\' || p[1] == '/'))
3630 STRMOVE(p, p + 1); 3630 STRMOVE(p, p + 1);
3631 else if (*p == '/') 3631 else if (*p == '/')
3632 { 3632 {
3945 #ifdef FEAT_MBYTE 3945 #ifdef FEAT_MBYTE
3946 if (has_mbyte) 3946 if (has_mbyte)
3947 { 3947 {
3948 i = mb_charlen(ae->ae_chop); 3948 i = mb_charlen(ae->ae_chop);
3949 for ( ; i > 0; --i) 3949 for ( ; i > 0; --i)
3950 mb_ptr_adv(p); 3950 MB_PTR_ADV(p);
3951 } 3951 }
3952 else 3952 else
3953 #endif 3953 #endif
3954 p += STRLEN(ae->ae_chop); 3954 p += STRLEN(ae->ae_chop);
3955 } 3955 }
3963 { 3963 {
3964 /* Remove chop string. */ 3964 /* Remove chop string. */
3965 p = newword + STRLEN(newword); 3965 p = newword + STRLEN(newword);
3966 i = (int)MB_CHARLEN(ae->ae_chop); 3966 i = (int)MB_CHARLEN(ae->ae_chop);
3967 for ( ; i > 0; --i) 3967 for ( ; i > 0; --i)
3968 mb_ptr_back(newword, p); 3968 MB_PTR_BACK(newword, p);
3969 *p = NUL; 3969 *p = NUL;
3970 } 3970 }
3971 if (ae->ae_add != NULL) 3971 if (ae->ae_add != NULL)
3972 STRCAT(newword, ae->ae_add); 3972 STRCAT(newword, ae->ae_add);
3973 } 3973 }