Mercurial > hg > Members > kono > Cerium
diff example/word_count/main.cc @ 400:00fe05184a02
Fix examples.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 21 Sep 2009 18:47:06 +0900 |
parents | e08d0aa94367 |
children | 60aa3f241b10 |
line wrap: on
line diff
--- a/example/word_count/main.cc Mon Sep 21 18:03:31 2009 +0900 +++ b/example/word_count/main.cc Mon Sep 21 18:47:06 2009 +0900 @@ -9,7 +9,7 @@ #include "TaskManager.h" #include "Func.h" -extern void task_init(void); +extern void task_init(); const char *usr_help_str = "Usage: ./word_count [-cpu spe_num] [-file filename]\n"; @@ -67,7 +67,7 @@ void -run_start(char *filename) +run_start(TaskManager *manager, char *filename) { HTaskPtr t_exec; HTaskPtr t_print; @@ -164,12 +164,16 @@ filename = argv[i+1]; } } + if (filename==0) { + fprintf(stderr, usr_help_str); + exit(1); + } return filename; } int -TMmain(int argc, char *argv[]) +TMmain(TaskManager *manager, int argc, char *argv[]) { char *filename = 0; @@ -180,7 +184,7 @@ } task_init(); - run_start(filename); + run_start(manager, filename); return 0; }