# HG changeset patch # User Yutaka_Kinjyo # Date 1311596382 -32400 # Node ID 1c0c9299c29202917f2ed90c29d42aa4ff5ac226 # Parent 1a32564347d542b254e859ea278688b39fd8ee45 get global_work_size diff -r 1a32564347d5 -r 1c0c9299c292 WordCount/main.cc --- a/WordCount/main.cc Sun Jul 24 01:45:40 2011 +0900 +++ b/WordCount/main.cc Mon Jul 25 21:19:42 2011 +0900 @@ -11,7 +11,6 @@ #define OUT_PARAM_NUM 4 #define PRINT_PARAM_NUM 2 -#define FLAG_PARAM_NUM 2 typedef struct { caddr_t file_mmap; @@ -19,7 +18,6 @@ } st_mmap_t; typedef struct { - int work_num; int size; int remain_size; } param_t; @@ -179,7 +177,6 @@ sizeof(param_t), NULL, &ret); param_t param; - param.work_num = global_work_size; param.size = divi_size; param.remain_size = remain_size; @@ -232,21 +229,18 @@ for (int j = 0; j < PRINT_PARAM_NUM; j++) { - printf("%d ", out_data[i*OUT_PARAM_NUM+j]); word_line_num[j] += out_data[i*OUT_PARAM_NUM+j]; } + //flagの判定 if ((i != global_work_size-1) && - (out_data[i*OUT_PARAM_NUM+PRINT_PARAM_NUM]) && - (out_data[i*OUT_PARAM_NUM+PRINT_PARAM_NUM+1])) { + (out_data[i*OUT_PARAM_NUM+PRINT_PARAM_NUM+1] == 1) && + (out_data[i*OUT_PARAM_NUM+PRINT_PARAM_NUM+4] == 0)) { word_line_num[0] += 1; } - - printf("\n"); - } printf("%d %d", word_line_num[0], word_line_num[1]);