Mercurial > hg > Game > Cerium
diff example/regex_mas/ppe/Exec.cc @ 1740:5a294d8e5643 draft
fix
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 12 Nov 2013 16:56:43 +0900 |
parents | dfeeb2f681db |
children | 36eb8c21281a |
line wrap: on
line diff
--- a/example/regex_mas/ppe/Exec.cc Tue Nov 12 13:53:29 2013 +0900 +++ b/example/regex_mas/ppe/Exec.cc Tue Nov 12 16:56:43 2013 +0900 @@ -9,7 +9,7 @@ SchedDefineTask(Exec); //ボイヤームーア法による文字列検索アルゴリズム -int BM_method(unsigned char *text,int *offset,int *text_length, +int BM_method(unsigned char *text,int *text_length, unsigned char *pattern,unsigned long long *match_string) { int skip[256]; @@ -47,17 +47,15 @@ static int run(SchedTask *s, void *rbuf, void *wbuf) { - unsigned char *i_data = (unsigned char *)rbuf; + unsigned char *i_data = (unsigned char *)s->get_input(rbuf,0); unsigned long long *o_data = (unsigned long long*)wbuf; - int *offset = (int*)s->get_param(0); - int *length = (int*)s->get_param(1); - //unsigned char *search_word = (unsigned char*)s->get_input(2); + int *length = (int*)s->get_param(0); + //unsigned char *search_word = (unsigned char*)s->get_input(1); unsigned char search_word[] = "doing"; - o_data[0] = BM_method(i_data,offset,length,search_word,o_data); + o_data[0] = BM_method(i_data,length,search_word,o_data); //s->printf("in Exec.cc\n"); - return 0; }