Macro cleanup: UNICODE16

Fix clint warnings as well.
This commit is contained in:
Michael Reed 2015-02-03 20:55:00 -05:00 committed by Justin M. Keyes
parent c5c3eb99d3
commit 70a7517d17
3 changed files with 9 additions and 48 deletions

View File

@ -119,7 +119,6 @@ src/nvim/tag.h
src/nvim/term.c
src/nvim/term.h
src/nvim/term_defs.h
src/nvim/types.h
src/nvim/ui.c
src/nvim/ui.h
src/nvim/undo.c

View File

@ -1858,11 +1858,6 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T
} else
prev_c = u8c;
/* Non-BMP character: display as ? or fullwidth ?. */
#ifdef UNICODE16
if (u8c >= 0x10000)
ScreenLinesUC[idx] = (cells == 2) ? 0xff1f : (int)'?';
else
#endif
ScreenLinesUC[idx] = u8c;
for (i = 0; i < Screen_mco; ++i) {
ScreenLinesC[i][idx] = u8cc[i];
@ -3051,30 +3046,13 @@ win_line (
if ((mb_l == 1 && c >= 0x80)
|| (mb_l >= 1 && mb_c == 0)
|| (mb_l > 1 && (!vim_isprintc(mb_c)
# ifdef UNICODE16
|| mb_c >= 0x10000
# endif
))) {
/*
* Illegal UTF-8 byte: display as <xx>.
* Non-BMP character : display as ? or fullwidth ?.
*/
# ifdef UNICODE16
if (mb_c < 0x10000)
# endif
{
transchar_hex(extra, mb_c);
if (wp->w_p_rl) /* reverse */
|| (mb_l > 1 && (!vim_isprintc(mb_c)))) {
// Illegal UTF-8 byte: display as <xx>.
// Non-BMP character : display as ? or fullwidth ?.
transchar_hex(extra, mb_c);
if (wp->w_p_rl) { // reverse
rl_mirror(extra);
}
# ifdef UNICODE16
else if (utf_char2cells(mb_c) != 2)
STRCPY(extra, "?");
else
/* 0xff1f in UTF-8: full-width '?' */
STRCPY(extra, "\357\274\237");
# endif
p_extra = extra;
c = *p_extra;
@ -5226,14 +5204,6 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr)
else
u8c = utfc_ptr2char(ptr, u8cc);
mbyte_cells = utf_char2cells(u8c);
# ifdef UNICODE16
/* Non-BMP character: display as ? or fullwidth ?. */
if (u8c >= 0x10000) {
u8c = (mbyte_cells == 2) ? 0xff1f : (int)'?';
if (attr == 0)
attr = hl_attr(HLF_8);
}
# endif
if (p_arshape && !p_tbidi && arabic_char(u8c)) {
/* Do Arabic shaping. */
if (len >= 0 && (int)(ptr - text) + mbyte_blen >= len) {

View File

@ -13,19 +13,11 @@
// dummy to pass an ACL to a function
typedef void *vim_acl_T;
/*
* Shorthand for unsigned variables. Many systems, but not all, have u_char
* already defined, so we use char_u to avoid trouble.
*/
// Shorthand for unsigned variables. Many systems, but not all, have u_char
// already defined, so we use char_u to avoid trouble.
typedef unsigned char char_u;
// The u8char_T can hold one decoded UTF-8 character. We normally use 32
// bits now, since some Asian characters don't fit in 16 bits. u8char_T is
// only used for displaying, it could be 16 bits to save memory.
#ifdef UNICODE16
typedef uint16_t u8char_T;
#else
// Can hold one decoded UTF-8 character.
typedef uint32_t u8char_T;
#endif
#endif /* NVIM_TYPES_H */
#endif // NVIM_TYPES_H