diff options
Diffstat (limited to 'storage/myisam/ft_stopwords.c')
-rw-r--r-- | storage/myisam/ft_stopwords.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c index 1079cf83417..b0911403996 100644 --- a/storage/myisam/ft_stopwords.c +++ b/storage/myisam/ft_stopwords.c @@ -24,8 +24,8 @@ static CHARSET_INFO *ft_stopword_cs= NULL; typedef struct st_ft_stopwords { - const uchar* pos; - size_t len; + const char * pos; + uint len; } FT_STOPWORD; static TREE *stopwords3=NULL; @@ -34,8 +34,8 @@ static int FT_STOPWORD_cmp(void* cmp_arg __attribute__((unused)), FT_STOPWORD *w1, FT_STOPWORD *w2) { return ha_compare_text(ft_stopword_cs, - w1->pos, w1->len, - w2->pos, w2->len, 0, 0); + (uchar *)w1->pos,w1->len, + (uchar *)w2->pos,w2->len,0,0); } static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action, @@ -48,10 +48,9 @@ static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action, static int ft_add_stopword(const char *w) { FT_STOPWORD sw; - return (!w || - (((sw.len= (uint) strlen((char*) (sw.pos=(const uchar *)w))) >= - ft_min_word_len) && - (tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL))); + return !w || + (((sw.len= (uint) strlen(sw.pos=w)) >= ft_min_word_len) && + (tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL)); } int ft_init_stopwords() @@ -79,8 +78,7 @@ int ft_init_stopwords() { File fd; uint len; - uchar *buffer; - const uchar *start, *end; + uchar *buffer, *start, *end; FT_WORD w; int error=-1; @@ -122,8 +120,7 @@ err0: DBUG_RETURN(0); } - -int is_stopword(const uchar *word, size_t len) +int is_stopword(const char *word, size_t len) { FT_STOPWORD sw; sw.pos=word; |