Skip to content

Commit

Permalink
Merge pull request #5 from matsujirushi/pr1
Browse files Browse the repository at this point in the history
Suppressing warnings
  • Loading branch information
psachs authored Jan 16, 2024
2 parents 41fd02c + eb56098 commit b43eb48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SensirionRxFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ uint16_t SensirionRxFrame::getUInt32(uint32_t& data) {
}

uint16_t SensirionRxFrame::getInt32(int32_t& data) {
uint32_t ret;
uint32_t ret = 0;
uint16_t error = getUInt32(ret);
data = static_cast<int32_t>(ret);
return error;
Expand All @@ -70,7 +70,7 @@ uint16_t SensirionRxFrame::getUInt16(uint16_t& data) {
}

uint16_t SensirionRxFrame::getInt16(int16_t& data) {
uint16_t ret;
uint16_t ret = 0;
uint16_t error = getUInt16(ret);
data = static_cast<int16_t>(ret);
return error;
Expand Down Expand Up @@ -107,7 +107,7 @@ uint16_t SensirionRxFrame::getFloat(float& data) {
union {
uint32_t uInt32Data;
float floatData;
} convert;
} convert = { 0 };
uint16_t error = getUInt32(convert.uInt32Data);
data = convert.floatData;
return error;
Expand Down

0 comments on commit b43eb48

Please sign in to comment.