Skip to content

Commit

Permalink
replaced C-style casts with reinterpret_cast in cgadgetron.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
evgueni-ovtchinnikov committed Nov 23, 2023
1 parent 052682f commit 691631b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/xGadgetron/cGadgetron/cgadgetron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ cGT_ISMRMRDAcquisitionsFromFile(const char* file, int all, size_t ptr)
if (!file_exists(file))
return fileNotFound(file, __FILE__, __LINE__);
try {
unsigned long int* ptr_ignored = (unsigned long int*)ptr;
unsigned long int ignored = *ptr_ignored;
auto ptr_ignored = reinterpret_cast<unsigned long int*>(ptr);
auto ignored = *ptr_ignored;
std::cout << "reading from " << file << " using ignore mask ";
IgnoreMask mask;
if (all)
Expand Down Expand Up @@ -727,7 +727,7 @@ cGT_setAcquisitionsIgnoreMask(void* ptr_acqs, size_t ptr_im)
objectFromHandle<MRAcquisitionData>(h_acqs);
shared_ptr<ISMRMRD::Acquisition>
sptr_acq(new ISMRMRD::Acquisition);
unsigned long int im = *(unsigned long int*)ptr_im;
auto im = *reinterpret_cast<unsigned long int*>(ptr_im);
acqs.set_ignore_mask(im);
return new DataHandle;
}
Expand All @@ -744,7 +744,7 @@ cGT_acquisitionsIgnoreMask(void* ptr_acqs, size_t ptr_im)
objectFromHandle<MRAcquisitionData>(h_acqs);
shared_ptr<ISMRMRD::Acquisition>
sptr_acq(new ISMRMRD::Acquisition);
unsigned long int* im = (unsigned long int*)ptr_im;
auto im = reinterpret_cast<unsigned long int*>(ptr_im);
*im = acqs.ignore_mask().bits();
return new DataHandle;
}
Expand Down

0 comments on commit 691631b

Please sign in to comment.