diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-05-10 18:14:15 -0600 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-05-10 18:14:15 -0600 |
commit | 89d6e639ae535600af4cf3eb7053aa9c4c905580 (patch) | |
tree | 41633f2a5b44761a0e57374699711c1eab2cc9e2 /myisam | |
parent | 174fdf05a14cecb499030460ecceed5f4df79cf9 (diff) | |
download | mariadb-git-89d6e639ae535600af4cf3eb7053aa9c4c905580.tar.gz |
change tree to use qsort_cmp2 - compare function with 3 instead of 2 arguments
include/global.h:
qsort_cmp2
include/my_tree.h:
use qsort_cmp2
myisam/ft_boolean_search.c:
use qsort_cmp2
myisam/ft_nlq_search.c:
use qsort_cmp2
myisam/ft_parser.c:
use qsort_cmp2
myisam/ft_stopwords.c:
use qsort_cmp2
myisam/myisampack.c:
use qsort_cmp2
mysys/tree.c:
use qsort_cmp2
sql/sql_analyse.cc:
use qsort_cmp2
sql/sql_analyse.h:
use qsort_cmp2
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/ft_boolean_search.c | 3 | ||||
-rw-r--r-- | myisam/ft_nlq_search.c | 5 | ||||
-rw-r--r-- | myisam/ft_parser.c | 5 | ||||
-rw-r--r-- | myisam/ft_stopwords.c | 5 | ||||
-rw-r--r-- | myisam/myisampack.c | 8 |
5 files changed, 16 insertions, 10 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 37faaea0a7f..f0865932ca0 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -41,7 +41,8 @@ typedef struct st_ft_superdoc { ALL_IN_ONE *aio; } FT_SUPERDOC; -static int FT_SUPERDOC_cmp(FT_SUPERDOC *p1, FT_SUPERDOC *p2) +static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)), + FT_SUPERDOC *p1, FT_SUPERDOC *p2) { if (p1->doc.dpos < p2->doc.dpos) return -1; diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c index 3b4937ca4d9..6d76fcef6e8 100644 --- a/myisam/ft_nlq_search.c +++ b/myisam/ft_nlq_search.c @@ -35,7 +35,8 @@ typedef struct st_ft_superdoc { double tmp_weight; } FT_SUPERDOC; -static int FT_SUPERDOC_cmp(FT_SUPERDOC *p1, FT_SUPERDOC *p2) +static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)), + FT_SUPERDOC *p1, FT_SUPERDOC *p2) { if (p1->doc.dpos < p2->doc.dpos) return -1; @@ -162,7 +163,7 @@ FT_DOCLIST *ft_nlq_search(MI_INFO *info, uint keynr, byte *query, bzero(&allocated_wtree,sizeof(allocated_wtree)); - init_tree(&aio.dtree,0,sizeof(FT_SUPERDOC),(qsort_cmp)&FT_SUPERDOC_cmp,0, + init_tree(&aio.dtree,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,0, NULL); if(!(wtree=ft_parse(&allocated_wtree,query,query_len))) diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c index d156c8c5556..ee4b5ea7202 100644 --- a/myisam/ft_parser.c +++ b/myisam/ft_parser.c @@ -38,7 +38,8 @@ typedef struct st_ft_docstat { byte *keybuf; } FT_DOCSTAT; -static int FT_WORD_cmp(FT_WORD *w1, FT_WORD *w2) +static int FT_WORD_cmp(void* cmp_arg __attribute__((unused)), + FT_WORD *w1, FT_WORD *w2) { return _mi_compare_text(default_charset_info, (uchar*) w1->pos,w1->len, @@ -225,7 +226,7 @@ TREE * ft_parse(TREE *wtree, byte *doc, int doclen) if (!is_tree_inited(wtree)) { - init_tree(wtree,0,sizeof(FT_WORD),(qsort_cmp)&FT_WORD_cmp,0,NULL); + init_tree(wtree,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,NULL); } while (ft_simple_get_word(&doc,end,&w)) diff --git a/myisam/ft_stopwords.c b/myisam/ft_stopwords.c index 556f52650c8..d3dedc4c406 100644 --- a/myisam/ft_stopwords.c +++ b/myisam/ft_stopwords.c @@ -25,7 +25,8 @@ typedef struct st_ft_stopwords { static TREE *stopwords3=NULL; -static int FT_STOPWORD_cmp(FT_STOPWORD *w1, FT_STOPWORD *w2) +static int FT_STOPWORD_cmp(void* cmp_arg __attribute__((unused)), + FT_STOPWORD *w1, FT_STOPWORD *w2) { return _mi_compare_text(default_charset_info, (uchar *)w1->pos,w1->len, @@ -40,7 +41,7 @@ int ft_init_stopwords(const char **sws) if(!stopwords3) { if(!(stopwords3=(TREE *)my_malloc(sizeof(TREE),MYF(0)))) return -1; - init_tree(stopwords3,0,sizeof(FT_STOPWORD),(qsort_cmp)&FT_STOPWORD_cmp,0, + init_tree(stopwords3,0,sizeof(FT_STOPWORD),(qsort_cmp2)&FT_STOPWORD_cmp,0, NULL); } diff --git a/myisam/myisampack.c b/myisam/myisampack.c index 0e4b6eafbde..90ba655e41f 100644 --- a/myisam/myisampack.c +++ b/myisam/myisampack.c @@ -124,7 +124,8 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees, HUFF_COUNTS *huff_counts, uint fields); -static int compare_tree(const uchar *s,const uchar *t); +static int compare_tree(void* cmp_arg __attribute__((unused)), + const uchar *s,const uchar *t); static int get_statistic(MRG_INFO *mrg,HUFF_COUNTS *huff_counts); static void check_counts(HUFF_COUNTS *huff_counts,uint trees, my_off_t records); @@ -673,7 +674,7 @@ static HUFF_COUNTS *init_huff_count(MI_INFO *info,my_off_t records) (type == FIELD_NORMAL || type == FIELD_SKIPP_ZERO)) count[i].max_zero_fill= count[i].field_length; - init_tree(&count[i].int_tree,0,-1,(qsort_cmp) compare_tree,0,NULL); + init_tree(&count[i].int_tree,0,-1,(qsort_cmp2) compare_tree,0,NULL); if (records && type != FIELD_BLOB && type != FIELD_VARCHAR) count[i].tree_pos=count[i].tree_buff = my_malloc(count[i].field_length > 1 ? tree_buff_length : 2, @@ -1289,7 +1290,8 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts) return 0; } -static int compare_tree(register const uchar *s, register const uchar *t) +static int compare_tree(void* cmp_arg __attribute__((unused)), + register const uchar *s, register const uchar *t) { uint length; for (length=global_count->field_length; length-- ;) |