diff --git a/tock_support.h b/tock_support.h index 4d1307e..055764e 100644 --- a/tock_support.h +++ b/tock_support.h @@ -34,6 +34,7 @@ #define EXTERNAL_CALLN(F,I,args...) (F)((I),##args) #define EXTERNAL_CALL(F) (F)() #define SetErr() +#define Channel int #endif //{{{ mostneg/mostpos diff --git a/tock_support_cppcsp.h b/tock_support_cppcsp.h index 5ba1837..d30f93c 100644 --- a/tock_support_cppcsp.h +++ b/tock_support_cppcsp.h @@ -242,7 +242,9 @@ public: } //Retyping: - + // Removed for now because it is causing ambiguity problems with the standard constructor (to do with const-ness) + // and because I'm not actually sure if it is used (I think retyping uses the constructor below with tockArrayView) + /* template inline tockArrayView(U* _realArray,const std::pair< boost::array , unsigned >& _dims) : realArray(reinterpret_cast(_realArray)),dims(_dims.first),totalSubDim(_dims.second) @@ -250,6 +252,7 @@ public: //Assume it's a single U item: correctDimsRetype(sizeof(U)); } + */ //Retyping, same number of dims: @@ -402,6 +405,12 @@ public: : aob(N*sizeof(T),arr.data()) { } + + template + inline explicit tockSendableArray(const tockArrayView& arr) + : aob(arr.data()) + { + } }; template @@ -417,6 +426,12 @@ inline void tockRecvArray(const csp::Chanin< tockSendableArray >& in,const in >> tsa; } +template +inline void tockSendArray(const csp::Chanout< tockSendableArray >& out,const tockArrayView& arr) +{ + out << tockSendableArray(arr); +} + inline void tockSendArrayOfBytes(const csp::Chanout& c, const tockSendableArrayOfBytes& b) { c << b; @@ -434,5 +449,5 @@ template inline void tockInitChanArray(T* pointTo,T** pointFrom,int count) { for (int i = 0;i < count;i++) - pointFrom[count] = &(pointTo[i]); + pointFrom[i] = &(pointTo[i]); }