Skip to content

Commit c57f9c4

Browse files
committed
Clang fix
1 parent 96aec5d commit c57f9c4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Core/Matlab/matfile.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
*/
5555

5656
#include <Core/Matlab/matfile.h>
57+
#include <cstring>
5758
#include <zlib.h>
5859

5960
using namespace SCIRun::MatlabIO;
@@ -138,7 +139,7 @@ void matfile::mfread(void *buffer,int elsize,int size)
138139
else
139140
{ // Read from the decompressed buffer instead of the file
140141
if ((m_->fcmpcount_) + (size*elsize) > m_->fcmpsize_) throw io_error();
141-
memcpy(buffer,static_cast<void *>((m_->fcmpbuffer_)+m_->fcmpcount_),(size*elsize));
142+
std::memcpy(buffer,static_cast<void *>((m_->fcmpbuffer_)+m_->fcmpcount_),(size*elsize));
142143
m_->fcmpcount_ += (size*elsize);
143144
if (m_->byteswap_) mfswapbytes(buffer,elsize,size);
144145
}
@@ -163,7 +164,7 @@ void matfile::mfread(void *buffer,int elsize,int size,int offset)
163164

164165
m_->fcmpcount_ = offset-(m_->fcmpalignoffset_);
165166
if ((m_->fcmpcount_) + (size*elsize) > m_->fcmpsize_) throw io_error();
166-
memcpy(buffer,static_cast<void *>((m_->fcmpbuffer_)+m_->fcmpcount_),(size*elsize));
167+
std::memcpy(buffer,static_cast<void *>((m_->fcmpbuffer_)+m_->fcmpcount_),(size*elsize));
167168
m_->fcmpcount_ += (size*elsize);
168169
if (m_->byteswap_) mfswapbytes(buffer,elsize,size);
169170
}

src/Core/Matlab/matfiledata.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
#include <Core/Matlab/matfiledata.h>
5656
#include <iostream>
57+
#include <cstring>
5758
#include <cstdint>
5859

5960
using namespace SCIRun::MatlabIO;
@@ -108,7 +109,7 @@ matfiledata matfiledata::clone() const
108109
matfiledata mfd;
109110

110111
mfd.newdatabuffer(bytesize(),type());
111-
memcpy(mfd.databuffer(),databuffer(),bytesize());
112+
std::memcpy(mfd.databuffer(),databuffer(),bytesize());
112113
mfd.ptr_ = ptr_;
113114
return(mfd);
114115
}
@@ -292,7 +293,7 @@ void matfiledata::getdata(void *dataptr,int dbytesize) const
292293
if (dbytesize == 0) return;
293294
if (size() == 0) return;
294295
if (dbytesize > bytesize()) dbytesize = bytesize(); // limit casting and copying to amount of data we have
295-
memcpy(dataptr,databuffer(),dbytesize);
296+
std::memcpy(dataptr,databuffer(),dbytesize);
296297
}
297298

298299

@@ -303,7 +304,7 @@ void matfiledata::putdata(const void *dataptr,int dbytesize,mitype type)
303304

304305
newdatabuffer(dbytesize,type);
305306
if (dbytesize > bytesize()) dbytesize = bytesize();
306-
memcpy(databuffer(),dataptr,dbytesize);
307+
std::memcpy(databuffer(),dataptr,dbytesize);
307308
}
308309

309310

@@ -313,7 +314,7 @@ void matfiledata::putdata(const void *dataptr,int dbytesize,mitype type)
313314
// apply this to the data. This way the computation of the
314315
// reordering scheme itself is separated from the actual
315316
// reordering in memory. It has a certain memory overhead
316-
// on the otherhand it should be more flexible
317+
// on the other hand it should be more flexible
317318

318319
matfiledata matfiledata::reorder(const std::vector<int> &newindices)
319320
{

0 commit comments

Comments
 (0)