diff --git a/src/cic.cpp b/src/cic.cpp index 497bb49..d8601c5 100644 --- a/src/cic.cpp +++ b/src/cic.cpp @@ -189,7 +189,7 @@ void CICFilter::putParticles(CICParticles *particles, uint32_t N) for (int t = 0; t < threadUsed; t++) { - delete[] threadedDensity; + delete[] threadedDensity[t]; } } diff --git a/src/hdf5_array.hpp b/src/hdf5_array.hpp index 8f1bfbd..c15c499 100644 --- a/src/hdf5_array.hpp +++ b/src/hdf5_array.hpp @@ -69,26 +69,36 @@ namespace CosmoTool { } }; + //, typename boost::enable_if >::type> \ + // #define HDF5_TYPE(tl, thdf5) \ - template struct get_hdf5_data_type >::type> \ + template struct get_hdf5_data_type >::type > \ + { static H5::DataType type() { return H5::PredType::thdf5; }; } + + #define HDF5_SAFE_TYPE(tl, othertl, thdf5) \ + template struct get_hdf5_data_type::value \ + && !boost::is_same::value > \ + >::type \ + > \ { static H5::DataType type() { return H5::PredType::thdf5; }; } + + HDF5_SAFE_TYPE(long, int , NATIVE_LONG); + HDF5_SAFE_TYPE(unsigned long, unsigned int , NATIVE_ULONG); + HDF5_SAFE_TYPE(long long, long , NATIVE_LLONG); + HDF5_SAFE_TYPE(unsigned long long, unsigned long, NATIVE_ULLONG); HDF5_TYPE(char , NATIVE_CHAR); - HDF5_TYPE(long long , NATIVE_LLONG); - HDF5_TYPE(unsigned long long, NATIVE_ULLONG); - HDF5_TYPE(int8_t , NATIVE_INT8); - HDF5_TYPE(uint8_t , NATIVE_UINT8); - HDF5_TYPE(int16_t , NATIVE_INT16); - HDF5_TYPE(uint16_t , NATIVE_UINT16); - HDF5_TYPE(int32_t , NATIVE_INT32); - HDF5_TYPE(uint32_t , NATIVE_UINT32); - HDF5_TYPE(int64_t , NATIVE_INT64); - HDF5_TYPE(uint64_t , NATIVE_UINT64); + HDF5_TYPE(unsigned char , NATIVE_UCHAR); + HDF5_TYPE(int , NATIVE_INT); + HDF5_TYPE(unsigned int , NATIVE_UINT); HDF5_TYPE(float , NATIVE_FLOAT); HDF5_TYPE(double , NATIVE_DOUBLE); - HDF5_TYPE(long double , NATIVE_LDOUBLE); #undef HDF5_TYPE + #undef HDF5_SAFE_TYPE // Extent generator template