mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
remove HAVE_{ISWUPPER,ISWLOWER,TOWUPPER,TOWLOWER}
This commit is contained in:
parent
079c47ed7b
commit
55d95c1cd0
@ -35,7 +35,6 @@
|
|||||||
#define HAVE_GETWD 1
|
#define HAVE_GETWD 1
|
||||||
#define HAVE_ICONV 1
|
#define HAVE_ICONV 1
|
||||||
#define HAVE_ICONV_H 1
|
#define HAVE_ICONV_H 1
|
||||||
#define HAVE_ISWUPPER 1
|
|
||||||
#define HAVE_LANGINFO_H 1
|
#define HAVE_LANGINFO_H 1
|
||||||
#define HAVE_LIBGEN_H 1
|
#define HAVE_LIBGEN_H 1
|
||||||
#define HAVE_LIBINTL_H 1
|
#define HAVE_LIBINTL_H 1
|
||||||
@ -98,8 +97,6 @@
|
|||||||
#define HAVE_TERMIO_H 1
|
#define HAVE_TERMIO_H 1
|
||||||
#define HAVE_TERMIOS_H 1
|
#define HAVE_TERMIOS_H 1
|
||||||
#define HAVE_TGETENT 1
|
#define HAVE_TGETENT 1
|
||||||
#define HAVE_TOWLOWER 1
|
|
||||||
#define HAVE_TOWUPPER 1
|
|
||||||
#define HAVE_UNISTD_H 1
|
#define HAVE_UNISTD_H 1
|
||||||
#define HAVE_UP_BC_PC 1
|
#define HAVE_UP_BC_PC 1
|
||||||
#define HAVE_USLEEP 1
|
#define HAVE_USLEEP 1
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
/// Code related to character sets.
|
/// Code related to character sets.
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <wctype.h>
|
||||||
|
|
||||||
#include "vim.h"
|
#include "vim.h"
|
||||||
#include "charset.h"
|
#include "charset.h"
|
||||||
@ -1552,12 +1553,9 @@ int vim_islower(int c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (c >= 0x100) {
|
if (c >= 0x100) {
|
||||||
#ifdef HAVE_ISWLOWER
|
|
||||||
|
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
return iswlower(c);
|
return iswlower(c);
|
||||||
}
|
}
|
||||||
#endif // ifdef HAVE_ISWLOWER
|
|
||||||
|
|
||||||
// islower() can't handle these chars and may crash
|
// islower() can't handle these chars and may crash
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1582,12 +1580,9 @@ int vim_isupper(int c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (c >= 0x100) {
|
if (c >= 0x100) {
|
||||||
#ifdef HAVE_ISWUPPER
|
|
||||||
|
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
return iswupper(c);
|
return iswupper(c);
|
||||||
}
|
}
|
||||||
#endif // ifdef HAVE_ISWUPPER
|
|
||||||
|
|
||||||
// islower() can't handle these chars and may crash
|
// islower() can't handle these chars and may crash
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1612,12 +1607,9 @@ int vim_toupper(int c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (c >= 0x100) {
|
if (c >= 0x100) {
|
||||||
#ifdef HAVE_TOWUPPER
|
|
||||||
|
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
return towupper(c);
|
return towupper(c);
|
||||||
}
|
}
|
||||||
#endif // ifdef HAVE_TOWUPPER
|
|
||||||
|
|
||||||
// toupper() can't handle these chars and may crash
|
// toupper() can't handle these chars and may crash
|
||||||
return c;
|
return c;
|
||||||
@ -1642,12 +1634,9 @@ int vim_tolower(int c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (c >= 0x100) {
|
if (c >= 0x100) {
|
||||||
#ifdef HAVE_TOWLOWER
|
|
||||||
|
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
return towlower(c);
|
return towlower(c);
|
||||||
}
|
}
|
||||||
#endif // ifdef HAVE_TOWLOWER
|
|
||||||
|
|
||||||
// tolower() can't handle these chars and may crash
|
// tolower() can't handle these chars and may crash
|
||||||
return c;
|
return c;
|
||||||
|
@ -2736,7 +2736,7 @@ int utf_toupper(int a)
|
|||||||
if (a < 128 && (cmp_flags & CMP_KEEPASCII))
|
if (a < 128 && (cmp_flags & CMP_KEEPASCII))
|
||||||
return TOUPPER_ASC(a);
|
return TOUPPER_ASC(a);
|
||||||
|
|
||||||
#if defined(HAVE_TOWUPPER) && defined(__STDC_ISO_10646__)
|
#if defined(__STDC_ISO_10646__)
|
||||||
/* If towupper() is available and handles Unicode, use it. */
|
/* If towupper() is available and handles Unicode, use it. */
|
||||||
if (!(cmp_flags & CMP_INTERNAL))
|
if (!(cmp_flags & CMP_INTERNAL))
|
||||||
return towupper(a);
|
return towupper(a);
|
||||||
@ -2766,7 +2766,7 @@ int utf_tolower(int a)
|
|||||||
if (a < 128 && (cmp_flags & CMP_KEEPASCII))
|
if (a < 128 && (cmp_flags & CMP_KEEPASCII))
|
||||||
return TOLOWER_ASC(a);
|
return TOLOWER_ASC(a);
|
||||||
|
|
||||||
#if defined(HAVE_TOWLOWER) && defined(__STDC_ISO_10646__)
|
#if defined(__STDC_ISO_10646__)
|
||||||
/* If towlower() is available and handles Unicode, use it. */
|
/* If towlower() is available and handles Unicode, use it. */
|
||||||
if (!(cmp_flags & CMP_INTERNAL))
|
if (!(cmp_flags & CMP_INTERNAL))
|
||||||
return towlower(a);
|
return towlower(a);
|
||||||
|
33
src/spell.c
33
src/spell.c
@ -969,32 +969,17 @@ static void close_spellbuf(buf_T *buf);
|
|||||||
# endif
|
# endif
|
||||||
/* Multi-byte implementation. For Unicode we can call utf_*(), but don't do
|
/* Multi-byte implementation. For Unicode we can call utf_*(), but don't do
|
||||||
* that for ASCII, because we don't want to use 'casemap' here. Otherwise use
|
* that for ASCII, because we don't want to use 'casemap' here. Otherwise use
|
||||||
* the "w" library function for characters above 255 if available. */
|
* the "w" library function for characters above 255. */
|
||||||
# ifdef HAVE_TOWLOWER
|
#define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
|
||||||
# define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
|
: (c) < \
|
||||||
: (c) < \
|
256 ? (int)spelltab.st_fold[c] : (int)towlower(c))
|
||||||
256 ? (int)spelltab.st_fold[c] : (int)towlower(c))
|
|
||||||
# else
|
|
||||||
# define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
|
|
||||||
: (c) < 256 ? (int)spelltab.st_fold[c] : (c))
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef HAVE_TOWUPPER
|
#define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
|
||||||
# define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
|
: (c) < \
|
||||||
: (c) < \
|
256 ? (int)spelltab.st_upper[c] : (int)towupper(c))
|
||||||
256 ? (int)spelltab.st_upper[c] : (int)towupper(c))
|
|
||||||
# else
|
|
||||||
# define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
|
|
||||||
: (c) < 256 ? (int)spelltab.st_upper[c] : (c))
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef HAVE_ISWUPPER
|
#define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
|
||||||
# define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
|
: (c) < 256 ? spelltab.st_isu[c] : iswupper(c))
|
||||||
: (c) < 256 ? spelltab.st_isu[c] : iswupper(c))
|
|
||||||
# else
|
|
||||||
# define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
|
|
||||||
: (c) < 256 ? spelltab.st_isu[c] : (FALSE))
|
|
||||||
# endif
|
|
||||||
|
|
||||||
|
|
||||||
static char *e_format = N_("E759: Format error in spell file");
|
static char *e_format = N_("E759: Format error in spell file");
|
||||||
|
Loading…
Reference in New Issue
Block a user