diff options
author | Reuben Thomas <rrt@sc3d.org> | 2017-02-03 09:21:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-03 09:21:52 +0000 |
commit | b70fbe9bddf7acfae2583f79cc1254b3879ed465 (patch) | |
tree | 371b961deba85be2a777a2594010e106cb6c5fdd | |
parent | 8f340cadaa0b8af47ae95a0340cbaad4154fbb9c (diff) | |
parent | b077fecd45f5f813b54ceb6a9727c708364c7294 (diff) | |
download | enchant-b70fbe9bddf7acfae2583f79cc1254b3879ed465.tar.gz |
Merge pull request #64 from rrthomas/master
Remove register keyword, which will be incompatible with C++1z
-rw-r--r-- | src/ispell/correct.cpp | 40 | ||||
-rw-r--r-- | src/ispell/good.cpp | 16 | ||||
-rw-r--r-- | src/ispell/hash.cpp | 4 | ||||
-rw-r--r-- | src/ispell/lookup.cpp | 22 | ||||
-rw-r--r-- | src/ispell/makedent.cpp | 26 | ||||
-rw-r--r-- | src/ispell/tgood.cpp | 28 |
6 files changed, 65 insertions, 71 deletions
diff --git a/src/ispell/correct.cpp b/src/ispell/correct.cpp index 2530ddd..fd401d7 100644 --- a/src/ispell/correct.cpp +++ b/src/ispell/correct.cpp @@ -212,8 +212,8 @@ int compoundflag = COMPOUND_CONTROLLED; int ISpellChecker::casecmp (char *a, char *b, int canonical) { - register ichar_t * ap; - register ichar_t * bp; + ichar_t * ap; + ichar_t * bp; ichar_t inta[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; ichar_t intb[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; @@ -258,7 +258,7 @@ ISpellChecker::casecmp (char *a, char *b, int canonical) void ISpellChecker::makepossibilities (ichar_t *word) { - register int i; + int i; for (i = 0; i < MAXPOSSIBLE; i++) m_possibilities[i][0] = 0; @@ -300,8 +300,8 @@ ISpellChecker::makepossibilities (ichar_t *word) int ISpellChecker::insert (ichar_t *word) { - register int i; - register char * realword; + int i; + char * realword; realword = ichartosstr (word, 0); for (i = 0; i < m_pcount; i++) @@ -349,9 +349,9 @@ ISpellChecker::wrongcapital (ichar_t *word) void ISpellChecker::wrongletter (ichar_t *word) { - register int i; - register int j; - register int n; + int i; + int j; + int n; ichar_t savechar; ichar_t newword[INPUTWORDLEN + MAXAFFIXLEN]; @@ -388,8 +388,8 @@ void ISpellChecker::extraletter (ichar_t *word) { ichar_t newword[INPUTWORDLEN + MAXAFFIXLEN]; - register ichar_t * p; - register ichar_t * r; + ichar_t * p; + ichar_t * r; if (icharlen (word) < 2) return; @@ -413,9 +413,9 @@ void ISpellChecker::missingletter (ichar_t *word) { ichar_t newword[INPUTWORDLEN + MAXAFFIXLEN + 1]; - register ichar_t * p; - register ichar_t * r; - register int i; + ichar_t * p; + ichar_t * r; + int i; icharcpy (newword + 1, word); for (p = word, r = newword; *p != 0; ) @@ -457,7 +457,7 @@ void ISpellChecker::missingspace (ichar_t *word) ichar_t newword[INPUTWORDLEN + MAXAFFIXLEN + 1]; int nfirsthalf; /* No. words saved in 1st half */ int nsecondhalf; /* No. words saved in 2nd half */ - register ichar_t * p; + ichar_t * p; ichar_t secondhalf[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN]; int secondno; /* Index into second */ @@ -515,8 +515,8 @@ int ISpellChecker::compoundgood (ichar_t *word, int pfxopts) { ichar_t newword[INPUTWORDLEN + MAXAFFIXLEN]; - register ichar_t * p; - register ichar_t savech; + ichar_t * p; + ichar_t savech; long secondcap; /* Capitalization of 2nd half */ /* @@ -574,8 +574,8 @@ void ISpellChecker::transposedletter (ichar_t *word) { ichar_t newword[INPUTWORDLEN + MAXAFFIXLEN]; - register ichar_t * p; - register ichar_t temp; + ichar_t * p; + ichar_t temp; icharcpy (newword, word); for (p = newword; p[1] != 0; p++) @@ -720,12 +720,12 @@ ISpellChecker::save_root_cap (ichar_t *word, ichar_t *pattern, int * nsaved) { #ifndef NO_CAPITALIZATION_SUPPORT - register struct dent * dent; + struct dent * dent; #endif /* NO_CAPITALIZATION_SUPPORT */ int firstisupper; ichar_t newword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; #ifndef NO_CAPITALIZATION_SUPPORT - register ichar_t * p; + ichar_t * p; int len; int i; int limit; diff --git a/src/ispell/good.cpp b/src/ispell/good.cpp index ba3b1d3..82e9171 100644 --- a/src/ispell/good.cpp +++ b/src/ispell/good.cpp @@ -215,14 +215,14 @@ static int entryhasaffixes (struct dent *dent, struct success *hit) */ int ISpellChecker::cap_ok (ichar_t *word, struct success *hit, int len) { - register ichar_t * dword; - register ichar_t * w; - register struct dent * dent; + ichar_t * dword; + ichar_t * w; + struct dent * dent; ichar_t dentword[INPUTWORDLEN + MAXAFFIXLEN]; int preadd; int prestrip; int sufadd; - ichar_t * limit; + ichar_t * limit; long thiscap; long dentcap; @@ -356,10 +356,10 @@ int ISpellChecker::good (ichar_t *w, int ignoreflagbits, int dummy, int pfxopts, #endif { ichar_t nword[INPUTWORDLEN + MAXAFFIXLEN]; - register ichar_t * p; - register ichar_t * q; - register int n; - register struct dent * dp; + ichar_t * p; + ichar_t * q; + int n; + struct dent * dp; /* ** Make an uppercase copy of the word we are checking. diff --git a/src/ispell/hash.cpp b/src/ispell/hash.cpp index 3ec6ce2..e2d7751 100644 --- a/src/ispell/hash.cpp +++ b/src/ispell/hash.cpp @@ -148,8 +148,8 @@ */ int ISpellChecker::hash (ichar_t *s, int hashtblsize) { - register long h = 0; - register int i; + long h = 0; + int i; #ifdef ICHAR_IS_CHAR for (i = 4; i-- && *s != 0; ) diff --git a/src/ispell/lookup.cpp b/src/ispell/lookup.cpp index 28e0244..5d63852 100644 --- a/src/ispell/lookup.cpp +++ b/src/ispell/lookup.cpp @@ -241,13 +241,13 @@ int ISpellChecker::linit (char *hashname) { FILE* fpHash; - register int i; - register struct dent * dp; + int i; + struct dent * dp; struct flagent * entry; struct flagptr * ind; int nextchar, x; int viazero; - register ichar_t * cp; + ichar_t * cp; if ((fpHash = enchant_fopen (hashname, "rb")) == NULL) { @@ -546,8 +546,8 @@ int ISpellChecker::linit (char *hashname) */ void ISpellChecker::initckch (char *wchars) { - register ichar_t c; - char num[4]; + ichar_t c; + char num[4]; for (c = 0; c < static_cast<ichar_t>(SET_SIZE+ m_hashheader.nstrchars); ++c) { @@ -631,7 +631,7 @@ void ISpellChecker::initckch (char *wchars) */ void ISpellChecker::clearindex (struct flagptr *indexp) { - register int i; + int i; for (i = 0; i < SET_SIZE + m_hashheader.nstrchars; i++, indexp++) { if (indexp->numents == 0 && indexp->pu.fp != NULL) @@ -643,11 +643,9 @@ void ISpellChecker::clearindex (struct flagptr *indexp) } #ifdef INDEXDUMP -static void dumpindex (indexp, depth) - register struct flagptr * indexp; - register int depth; +static void dumpindex (struct flagptr * indexp, int depth) { - register int i; + int i; int j; int k; char stripbuf[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; @@ -708,8 +706,8 @@ static void dumpindex (indexp, depth) */ struct dent * ISpellChecker::ispell_lookup (ichar_t *s, int dotree) { - register struct dent * dp; - register char * s1; + struct dent * dp; + char * s1; char schar[INPUTWORDLEN + MAXAFFIXLEN]; dp = &m_hashtbl[hash (s, m_hashsize)]; diff --git a/src/ispell/makedent.cpp b/src/ispell/makedent.cpp index 2739c08..7f214e2 100644 --- a/src/ispell/makedent.cpp +++ b/src/ispell/makedent.cpp @@ -224,7 +224,7 @@ other abi documents long ISpellChecker::whatcap (ichar_t *word) { - register ichar_t * p; + ichar_t * p; for (p = word; *p; p++) { @@ -276,7 +276,7 @@ ISpellChecker::whatcap (ichar_t *word) */ int ISpellChecker::addvheader ( struct dent *dp) { - register struct dent * tdent; /* Copy of entry */ + struct dent * tdent; /* Copy of entry */ /* ** Add a second entry with the correct capitalization, and then make @@ -467,11 +467,11 @@ ISpellChecker::stringcharlen (char *bufp, int canonical) static char * sp[MAXSTRINGCHARS]; static int inited = 0; #endif /* SLOWMULTIPLY */ - register char * bufcur; - register char * stringcur; - register int stringno; - register int lowstringno; - register int highstringno; + char * bufcur; + char * stringcur; + int stringno; + int lowstringno; + int highstringno; int dupwanted; #ifdef SLOWMULTIPLY @@ -606,7 +606,7 @@ int l1_isstringch(char *ptr, int len, int canon) { int ISpellChecker::strtoichar (ichar_t *out, char *in, int outlen, int canonical) { - register int len = 1; /* Length of next character */ + int len = 1; /* Length of next character */ outlen /= sizeof (ichar_t); /* Convert to an ichar_t count */ for ( ; --outlen > 0 && *in != '\0'; in += len) @@ -638,9 +638,9 @@ ISpellChecker::strtoichar (ichar_t *out, char *in, int outlen, int canonical) int ISpellChecker::ichartostr ( char *out, ichar_t *in, int outlen, int canonical) { - register int ch; /* Next character to store */ - register int i; /* Index into duplicates list */ - register char * scharp; /* Pointer into a string char */ + int ch; /* Next character to store */ + int i; /* Index into duplicates list */ + char * scharp; /* Pointer into a string char */ while (--outlen > 0 && (ch = *in++) != 0) { @@ -760,7 +760,7 @@ icharcpy (ichar_t *out, ichar_t *in) int icharlen (ichar_t * in) { - register int len; /* Length so far */ + int len; /* Length so far */ for (len = 0; *in++ != 0; len++) ; @@ -826,7 +826,7 @@ ISpellChecker::findfiletype (const char *name, int searchnames, int *deformatter { char * cp; /* Pointer into suffix list */ int cplen; /* Length of current suffix */ - register int i; /* Index into type table */ + int i; /* Index into type table */ int len; /* Length of the name */ /* diff --git a/src/ispell/tgood.cpp b/src/ispell/tgood.cpp index 881d549..a015cd4 100644 --- a/src/ispell/tgood.cpp +++ b/src/ispell/tgood.cpp @@ -211,7 +211,7 @@ void ISpellChecker::chk_aff (ichar_t *word, ichar_t *ucword, int len, int ignoreflagbits, int allhits, int pfxopts, int sfxopts) { - register ichar_t * cp; /* Pointer to char to index on */ + ichar_t * cp; /* Pointer to char to index on */ struct flagptr * ind; /* Flag index table to test */ pfx_list_chk (word, ucword, len, pfxopts, sfxopts, &m_pflagindex[0], @@ -261,12 +261,11 @@ void ISpellChecker::pfx_list_chk (ichar_t *word, ichar_t *ucword, int len, int o int sfxopts, struct flagptr * ind, int ignoreflagbits, int allhits) { int cond; /* Condition number */ - register ichar_t * cp; /* Pointer into end of ucword */ + ichar_t * cp; /* Pointer into end of ucword */ struct dent * dent; /* Dictionary entry we found */ int entcount; /* Number of entries to process */ - register struct flagent * - flent; /* Current table entry */ - register int tlen; /* Length of tword */ + struct flagent * flent; /* Current table entry */ + int tlen; /* Length of tword */ ichar_t tword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; /* Tmp cpy */ ichar_t tword2[sizeof tword]; /* 2nd copy for ins_root_cap */ @@ -380,7 +379,7 @@ ISpellChecker::chk_suf (ichar_t *word, ichar_t *ucword, int len, int optflags, struct flagent *pfxent, int ignoreflagbits, int allhits) { - register ichar_t * cp; /* Pointer to char to index on */ + ichar_t * cp; /* Pointer to char to index on */ struct flagptr * ind; /* Flag index table to test */ suf_list_chk (word, ucword, len, &m_sflagindex[0], optflags, pfxent, @@ -424,13 +423,12 @@ void ISpellChecker::suf_list_chk (ichar_t *word, ichar_t *ucword, int len, struct flagptr *ind, int optflags, struct flagent *pfxent, int ignoreflagbits, int allhits) { - register ichar_t * cp; /* Pointer into end of ucword */ + ichar_t * cp; /* Pointer into end of ucword */ int cond; /* Condition number */ struct dent * dent; /* Dictionary entry we found */ int entcount; /* Number of entries to process */ - register struct flagent * - flent; /* Current table entry */ - register int tlen; /* Length of tword */ + struct flagent * flent; /* Current table entry */ + int tlen; /* Length of tword */ ichar_t tword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; /* Tmp cpy */ ichar_t tword2[sizeof tword]; /* 2nd copy for ins_root_cap */ @@ -563,8 +561,7 @@ int ISpellChecker::expand_pre (char *croot, ichar_t *rootword, MASKTYPE mask[], { int entcount; /* No. of entries to process */ int explength; /* Length of expansions */ - register struct flagent * - flent; /* Current table entry */ + struct flagent * flent; /* Current table entry */ for (flent = m_pflaglist, entcount = m_numpflags, explength = 0; entcount > 0; @@ -594,7 +591,7 @@ int ISpellChecker::pr_pre_expansion ( char *croot, ichar_t *rootword, char *extra) { int cond; /* Current condition number */ - register ichar_t * nextc; /* Next case choice */ + ichar_t * nextc; /* Next case choice */ int tlen; /* Length of tword */ ichar_t tword[INPUTWORDLEN + MAXAFFIXLEN]; /* Temp */ @@ -692,8 +689,7 @@ int ISpellChecker::expand_suf (char *croot, ichar_t *rootword, MASKTYPE mask[], { int entcount; /* No. of entries to process */ int explength; /* Length of expansions */ - register struct flagent * - flent; /* Current table entry */ + struct flagent * flent; /* Current table entry */ for (flent = m_sflaglist, entcount = m_numsflags, explength = 0; entcount > 0; @@ -725,7 +721,7 @@ int ISpellChecker::pr_suf_expansion (char *croot, ichar_t *rootword, struct flagent *flent, int option, char *extra) { int cond; /* Current condition number */ - register ichar_t * nextc; /* Next case choice */ + ichar_t * nextc; /* Next case choice */ int tlen; /* Length of tword */ ichar_t tword[INPUTWORDLEN + MAXAFFIXLEN]; /* Temp */ |