Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
src: fix warnings in aliased_buffer
Browse files Browse the repository at this point in the history
* Unary minus usages on unsigned type
* Implicit casts to/from input parameters
  • Loading branch information
kfarnung committed Mar 26, 2018
1 parent 038d65b commit 8ae2a34
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/aliased_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class AliasedBuffer {

template <typename T>
inline Reference& operator=(const T& val) {
aliased_buffer_->SetValue(index_, val);
aliased_buffer_->SetValue(index_, static_cast<NativeT>(val));
return *this;
}

Expand All @@ -144,7 +144,7 @@ class AliasedBuffer {

template <typename T>
inline Reference& operator+=(const T& val) {
const T current = aliased_buffer_->GetValue(index_);
const NativeT current = aliased_buffer_->GetValue(index_);
aliased_buffer_->SetValue(index_, current + val);
return *this;
}
Expand All @@ -155,7 +155,9 @@ class AliasedBuffer {

template <typename T>
inline Reference& operator-=(const T& val) {
return this->operator+=(-val);
const NativeT current = aliased_buffer_->GetValue(index_);
aliased_buffer_->SetValue(index_, current - val);
return *this;
}

private:
Expand Down

0 comments on commit 8ae2a34

Please sign in to comment.