Mercurial > hg > Game > Cerium
changeset 1748:61370f2987ff draft
minor fix
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 20 Nov 2013 19:46:04 +0900 |
parents | efbb42f8077a |
children | 4d63d122eea0 |
files | example/regex_mas/main.cc |
diffstat | 1 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/example/regex_mas/main.cc Wed Nov 20 17:58:09 2013 +0900 +++ b/example/regex_mas/main.cc Wed Nov 20 19:46:04 2013 +0900 @@ -29,6 +29,8 @@ int use_compat = 0; int array_task_num = 8; int spe_num = 1; + +//static unsigned char* search_word; CPU_TYPE spe_cpu = SPE_ANY; const char *usr_help_str = "Usage: ./word_count [-a -c -s] [-cpu spe_num] [-file filename]\n"; @@ -363,15 +365,26 @@ { char *filename = 0; - unsigned char *search_word = 0; + unsigned char *sword = 0; + + filename = init(argc, argv); for (int i = 1; argv[i]; ++i) { if (strcmp(argv[i], "-sw") == 0) { - search_word = (unsigned char*)argv[i+1]; + sword = (unsigned char*)argv[i+1]; } } + int sw_len = strlen((const char*)sword); + //search_word = (unsigned char*)malloc(sizeof(char)* sw_len); + unsigned char *search_word = (unsigned char*)manager->allocate(sizeof(char)*sw_len); + strcpy((char*)search_word, (const char*)sword); + + printf("%p\n",&search_word); + printf("%p\n",&sword); + + if (filename < 0) { return -1; }