Mercurial > hg > Game > Cerium
view example/Prime/ppe/PrintTask.cc @ 1233:247da1f5e625 draft
fix
author | Daichi Toma <amothic@gmail.com> |
---|---|
date | Tue, 18 Oct 2011 12:25:08 +0900 |
parents | 2dfac651288e |
children | 9df036b11eae |
line wrap: on
line source
#include <stdio.h> #include "SchedTask.h" #include "PrintTask.h" #include "Func.h" SchedDefineTask1(PrintTask, print); static int print(SchedTask *smanager, void *rbuf, void *wbuf) { long print_flag = (long)smanager->get_param(1); //プリントするかどうか if (print_flag < 0) { return 0; } long length = (long)smanager->get_param(0); /* 出力する範囲 */ bool *input = (bool*)smanager->get_input(rbuf, 0); /* 出力する配列 */ /* 素数の判定結果が1ならば出力する */ for (long i = 0; i < length; i++) { if ( input[i] == true ) { printf("%ld ",i); } } printf("\n"); return 0; }