diff regexParser/cerium/ppe/Exec.cc @ 272:5aa9d01926f1

Cerium version no compile errors
author kono
date Fri, 29 Jan 2016 20:38:18 +0900
parents 6640b0d5bf13
children 8879eb8c64a8
line wrap: on
line diff
--- a/regexParser/cerium/ppe/Exec.cc	Fri Jan 29 19:37:11 2016 +0900
+++ b/regexParser/cerium/ppe/Exec.cc	Fri Jan 29 20:38:18 2016 +0900
@@ -2,19 +2,25 @@
 #include <string.h>
 #include "Exec.h"
 #include "Func.h"
+#include "regexParser.h"
+#include "threadedSearch.h"
+#include "FileMapReduce.h"
 
 /* これは必須 */
 SchedDefineTask1(Exec,blockedGrep);
 
+static
 TSValue stateNothing(TSValue tsv) {
     return tsv;
 }
 
+static
 TSValue stateSkip(TSValue tsv) {
     tsv.buff.matchBegin = tsv.buff.buffptr;
     return tsv;
 }
 
+static
 TSValue stateMatch(TSValue tsv) {
     ResultPtr r = NEW(Result);
     r->begin = tsv.buff.matchBegin;
@@ -28,7 +34,7 @@
     return tsv;
 }
 
-TSValue threadedSearch(TransitionGeneratorPtr tg,Buffer buff) {
+TSValue blockSearch(TransitionGeneratorPtr tg,Buffer buff) {
     TSValue tsv;
     tsv.buff = buff;
     tsv.tg = tg;
@@ -45,7 +51,7 @@
     buff.buffend = end;
     tSearch(tsv);
     tsv.blockEnd = tsv.current;
-    if (tsv.blockEnd->bi.bitContainer != 1) {
+    if (tsv.blockEnd->state->bitState.bitContainer != 1) {
         ResultPtr r = NEW(Result);
         r->begin = tsv.buff.matchBegin;
         r->end = NULL;
@@ -61,27 +67,26 @@
 {
     long task_spwaned = (long)s->get_param(0);
     long division_size = (long)s->get_param(1);
-    long length = (long)s->get_param(2);
+    // long length = (long)s->get_param(2);
     long out_size = (long)s->get_param(3);
     MapReduce *w = (MapReduce*)s->get_param(4);
     long allocation = task_spwaned + (long)s->x;
-    char* i_data;
-    unsigned long long* o_data;
+    unsigned char* i_data;
+    unsigned long * o_data;
     if (division_size) {
-        i_data = (char*)s->get_input(rbuf,0) + allocation*division_size;
-        o_data = (unsigned long long*)s->get_output(wbuf,1) + allocation*out_size;
+        i_data = (unsigned char*)s->get_input(rbuf,0) + allocation*division_size;
+        o_data = (unsigned long *)s->get_output(wbuf,1) + allocation*out_size;
     } else {
-        i_data = (char*)s->get_input(0);
-        o_data = (unsigned long long*)s->get_output(0);
+        i_data = (unsigned char*)s->get_input(0);
+        o_data = (unsigned long *)s->get_output(0);
     }
     TransitionGeneratorPtr tg = (TransitionGeneratorPtr)w->global;
-    StatePtr startState = tg->anyState;
     Buffer buff;
     buff.buff = buff.buffptr = buff.matchBegin = i_data;
     buff.buffend = buff.buff + division_size;
-    TSValue tsv = threadedSearch(tg,buff);
-    o_data[0] = (void*)tsv.result;
-    o_data[1] = (void*)tsv.blockBegin;
-    o_data[2] = (void*)tsv.blockEnd;
+    TSValue tsv = blockSearch(tg,buff);
+    o_data[0] = (unsigned long)tsv.result;
+    o_data[1] = (unsigned long)tsv.blockBegin;
+    o_data[2] = (unsigned long)tsv.blockEnd;
     return 0;
 }