diff --git a/src/xGadgetron/cGadgetron/cgadgetron.cpp b/src/xGadgetron/cGadgetron/cgadgetron.cpp index 35d332c54..a49680717 100644 --- a/src/xGadgetron/cGadgetron/cgadgetron.cpp +++ b/src/xGadgetron/cGadgetron/cgadgetron.cpp @@ -568,7 +568,7 @@ cGT_ISMRMRDAcquisitionsFromFile(const char* file, int all, size_t ptr) if (!file_exists(file)) return fileNotFound(file, __FILE__, __LINE__); try { - auto ptr_ignored = reinterpret_cast(ptr); + auto ptr_ignored = reinterpret_cast(ptr); auto ignored = *ptr_ignored; std::cout << "reading from " << file << " using ignore mask "; IgnoreMask mask; @@ -727,7 +727,7 @@ cGT_setAcquisitionsIgnoreMask(void* ptr_acqs, size_t ptr_im) objectFromHandle(h_acqs); shared_ptr sptr_acq(new ISMRMRD::Acquisition); - auto im = *reinterpret_cast(ptr_im); + auto im = *reinterpret_cast(ptr_im); acqs.set_ignore_mask(im); return new DataHandle; } @@ -744,7 +744,7 @@ cGT_acquisitionsIgnoreMask(void* ptr_acqs, size_t ptr_im) objectFromHandle(h_acqs); shared_ptr sptr_acq(new ISMRMRD::Acquisition); - auto im = reinterpret_cast(ptr_im); + auto im = reinterpret_cast(ptr_im); *im = acqs.ignore_mask().bits(); return new DataHandle; } diff --git a/src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_data_containers.h b/src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_data_containers.h index d2b65fd81..435b94f0b 100644 --- a/src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_data_containers.h +++ b/src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_data_containers.h @@ -131,9 +131,9 @@ namespace sirf { */ class IgnoreMask { public: - IgnoreMask(unsigned long int mask = (1 << 18)) : + IgnoreMask(unsigned long long int mask = (1 << 18)) : ignore_(mask), max_(8*sizeof(mask)) {} - void set(unsigned long int mask) + void set(unsigned long long int mask) { ignore_ = mask; } @@ -141,36 +141,36 @@ namespace sirf { { if (i < 1 || i > max_) return; - unsigned long int one = 1; + unsigned long long int one = 1; ignore_ = ignore_ | (one << (i - 1)); } void ignore_not(unsigned int i) { if (i < 1 || i > max_) return; - unsigned long int one = 1; + unsigned long long int one = 1; ignore_ = ignore_ & ~(one << (i - 1)); } bool bit(unsigned int i) const { if (i < 1 || i > max_) return true; - unsigned long int one = 1; + unsigned long long int one = 1; return ignore_ & (one << (i - 1)); } - unsigned long int bits() const + unsigned long long int bits() const { return ignore_; } - bool ignored(unsigned long int bits) const + bool ignored(unsigned long long int bits) const { return bits & ignore_; } std::string bits_string() const { unsigned int size = max_; - unsigned long int one = 1; - unsigned long int bitmask = (one << (size - 1)); + unsigned long long int one = 1; + unsigned long long int bitmask = (one << (size - 1)); std::stringstream str; for (unsigned int i = 0; i < size; i++) { if (ignore_ & (bitmask >> i)) @@ -184,7 +184,7 @@ namespace sirf { return str.str(); } private: - unsigned long int ignore_; + unsigned long long int ignore_; unsigned int max_; };