Fix warnings when compiling hunspell

This commit is contained in:
Kovid Goyal 2013-12-21 12:50:28 +05:30
parent da7ef93e27
commit 1ad7b5dca2
2 changed files with 4 additions and 3 deletions

View File

@ -27,7 +27,7 @@ public:
struct hentry * checkword(const char * word, int len, char in_compound,
const FLAG needflag = FLAG_NULL);
struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL);
char * check_morph(const char * word, int len, char in_compound,
const FLAG needflag = FLAG_NULL);
@ -90,7 +90,7 @@ public:
// const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound=IN_CPD_NOT);
const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, const FLAG badflag = 0);
struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = FLAG_NULL);
char * check_twosfx_morph(const char * word, int len, int optflags,
PfxEntry* ppfx, const FLAG needflag = FLAG_NULL);

View File

@ -3639,6 +3639,7 @@ int AffixMgr::parse_convtable(char * line, FileMgr * af, RepList ** rl, const c
/* now parse the num lines to read in the remainder of the table */
char * nl;
size_t keywordlen = strlen(keyword);
for (int j=0; j < numrl; j++) {
if (!(nl = af->getline())) return 1;
mychomp(nl);
@ -3651,7 +3652,7 @@ int AffixMgr::parse_convtable(char * line, FileMgr * af, RepList ** rl, const c
if (*piece != '\0') {
switch(i) {
case 0: {
if (strncmp(piece, keyword, sizeof(keyword)) != 0) {
if (strncmp(piece, keyword, keywordlen) != 0) {
HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum());
delete *rl;
*rl = NULL;