Removed the horrible tockBool type, now that we are no longer using vectors to store C++ arrays

This commit is contained in:
Neil Brown 2007-10-13 15:40:39 +00:00
parent ed38f80db0
commit a98ff8cad0
3 changed files with 2 additions and 17 deletions

View File

@ -1043,7 +1043,7 @@ cppgenSizeSuffix _ dim = tell [".extent(", dim, ")"]
--Changed from GenerateC to change the A.Timer type to use C++CSP time.
--Also changed the bool type, because vector<bool> in C++ is odd, so we hide it from the compiler.
cppgetScalarType :: GenOps -> A.Type -> Maybe String
cppgetScalarType _ A.Bool = Just "tockBool"
cppgetScalarType _ A.Bool = Just "bool"
cppgetScalarType _ A.Byte = Just "uint8_t"
cppgetScalarType _ A.UInt16 = Just "uint16_t"
cppgetScalarType _ A.UInt32 = Just "uint32_t"

View File

@ -216,7 +216,7 @@ testGenType = TestList
,testBothSame "GenType 6" "int32_t" (tcall genType A.Int32)
,testBothSame "GenType 7" "int64_t" (tcall genType A.Int64)
,testBothSame "GenType 8" "int" (tcall genType A.Int)
,testBoth "GenType 9" "bool" "tockBool" (tcall genType A.Bool)
,testBothSame "GenType 9" "bool" (tcall genType A.Bool)
,testBothSame "GenType 10" "float" (tcall genType A.Real32)
,testBothSame "GenType 11" "double" (tcall genType A.Real64)
,testBoth "GenType 100" "int*" "tockArrayView<int,1>" (tcall genType $ A.Array [A.Dimension 5] A.Int)

View File

@ -124,21 +124,6 @@ tie10(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8,
(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
}
//Let's assume bool is an unsigned byte:
#define occam_mostneg_tockBool 0
#define occam_mostpos_tockBool 255
class tockBool
{
private:
bool b;
public:
inline tockBool() {}
inline tockBool(bool _b) : b(_b) {}
inline operator bool () const {return b;}
inline void operator = (const bool& _b) {b = _b;}
};
inline std::pair< boost::array<unsigned,1> , unsigned > tockDims(const unsigned d0)
{
boost::array<unsigned,1> r;