summaryrefslogtreecommitdiff
path: root/src/spell.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-24 17:18:42 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-24 17:18:42 +0100
commit264b74fa545edfb92c0d7d08a02c26331cc5b168 (patch)
tree2cd0e8517c498f4ce1442492572032be9815654d /src/spell.h
parenta12a161b8ce09d024ed71c2134149fa323f8ee8e (diff)
downloadvim-git-264b74fa545edfb92c0d7d08a02c26331cc5b168.tar.gz
patch 8.1.0810: too many #ifdefsv8.1.0810
Problem: Too many #ifdefs. Solution: Graduate FEAT_MBYTE, part 4.
Diffstat (limited to 'src/spell.h')
-rw-r--r--src/spell.h51
1 files changed, 17 insertions, 34 deletions
diff --git a/src/spell.h b/src/spell.h
index 49ec0601e..18c96446c 100644
--- a/src/spell.h
+++ b/src/spell.h
@@ -44,11 +44,7 @@ typedef int idx_T;
typedef long idx_T;
#endif
-#ifdef FEAT_MBYTE
typedef int salfirst_T;
-#else
-typedef short salfirst_T;
-#endif
/*
* Structure used to store words and other info for one language, loaded from
@@ -132,12 +128,8 @@ struct slang_S
load */
int sl_has_map; /* TRUE if there is a MAP line */
-#ifdef FEAT_MBYTE
hashtab_T sl_map_hash; /* MAP for multi-byte chars */
int sl_map_array[256]; /* MAP for first 256 chars */
-#else
- char_u sl_map_array[256]; /* MAP for first 256 chars */
-#endif
hashtab_T sl_sounddone; /* table with soundfolded words that have
handled, see add_sound_suggest() */
};
@@ -213,11 +205,9 @@ typedef struct salitem_S
char_u *sm_oneof; /* letters from () or NULL */
char_u *sm_rules; /* rules like ^, $, priority */
char_u *sm_to; /* replacement. */
-#ifdef FEAT_MBYTE
int *sm_lead_w; /* wide character copy of "sm_lead" */
int *sm_oneof_w; /* wide character copy of "sm_oneof" */
int *sm_to_w; /* wide character copy of "sm_to" */
-#endif
} salitem_T;
/* Values for SP_*ERROR are negative, positive values are used by
@@ -260,41 +250,34 @@ typedef struct spelltab_S
* differ from what the .spl file uses.
* These must not be called with negative number!
*/
-#ifndef FEAT_MBYTE
-/* Non-multi-byte implementation. */
-# define SPELL_TOFOLD(c) ((c) < 256 ? (int)spelltab.st_fold[c] : (c))
-# define SPELL_TOUPPER(c) ((c) < 256 ? (int)spelltab.st_upper[c] : (c))
-# define SPELL_ISUPPER(c) ((c) < 256 ? spelltab.st_isu[c] : FALSE)
-#else
-# if defined(HAVE_WCHAR_H)
-# include <wchar.h> /* for towupper() and towlower() */
-# endif
+#if defined(HAVE_WCHAR_H)
+# include <wchar.h> /* for towupper() and towlower() */
+#endif
/* 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
* the "w" library function for characters above 255 if available. */
-# ifdef HAVE_TOWLOWER
-# define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
+#ifdef HAVE_TOWLOWER
+# define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
: (c) < 256 ? (int)spelltab.st_fold[c] : (int)towlower(c))
-# else
-# define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
+#else
+# define SPELL_TOFOLD(c) (enc_utf8 && (c) >= 128 ? utf_fold(c) \
: (c) < 256 ? (int)spelltab.st_fold[c] : (c))
-# endif
+#endif
-# ifdef HAVE_TOWUPPER
-# define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
+#ifdef HAVE_TOWUPPER
+# define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
: (c) < 256 ? (int)spelltab.st_upper[c] : (int)towupper(c))
-# else
-# define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
+#else
+# define SPELL_TOUPPER(c) (enc_utf8 && (c) >= 128 ? utf_toupper(c) \
: (c) < 256 ? (int)spelltab.st_upper[c] : (c))
-# endif
+#endif
-# ifdef HAVE_ISWUPPER
-# define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
+#ifdef HAVE_ISWUPPER
+# define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
: (c) < 256 ? spelltab.st_isu[c] : iswupper(c))
-# else
-# define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
+#else
+# define SPELL_ISUPPER(c) (enc_utf8 && (c) >= 128 ? utf_isupper(c) \
: (c) < 256 ? spelltab.st_isu[c] : (FALSE))
-# endif
#endif
#ifdef FEAT_SPELL