Skip to content

Commit

Permalink
fix for GCC 8
Browse files Browse the repository at this point in the history
  • Loading branch information
qinwf committed May 7, 2018
1 parent 7753b6f commit e3609ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inst/include/lib/limonp/LocalVector.hpp
Expand Up @@ -56,12 +56,12 @@ class LocalVector {
size_ = vec.size();
capacity_ = vec.capacity();
if(vec.buffer_ == vec.ptr_) {
memcpy(buffer_, vec.buffer_, sizeof(T) * size_);
memcpy((void *) buffer_, vec.buffer_, sizeof(T) * size_);
ptr_ = buffer_;
} else {
ptr_ = (T*) malloc(vec.capacity() * sizeof(T));
assert(ptr_);
memcpy(ptr_, vec.ptr_, vec.size() * sizeof(T));
memcpy((void *) ptr_, vec.ptr_, vec.size() * sizeof(T));
}
return *this;
}
Expand Down Expand Up @@ -93,7 +93,7 @@ class LocalVector {
assert(next);
T * old = ptr_;
ptr_ = next;
memcpy(ptr_, old, sizeof(T) * capacity_);
memcpy((void *) ptr_, old, sizeof(T) * capacity_);
capacity_ = size;
if(old != buffer_) {
free(old);
Expand Down

0 comments on commit e3609ed

Please sign in to comment.