diff --git a/datapoollocal/LocalDataSet.cpp b/datapoollocal/LocalDataSet.cpp index 27ad4bc2..3fc8592e 100644 --- a/datapoollocal/LocalDataSet.cpp +++ b/datapoollocal/LocalDataSet.cpp @@ -42,7 +42,7 @@ ReturnValue_t LocalDataSet::serializeWithValidityBuffer(uint8_t **buffer, if(registeredVariables[count]->isValid()) { // set validity buffer here. this->bitSetter(validityMask + validBufferIndex, - validBufferIndexBit, true); + validBufferIndexBit); if(validBufferIndexBit == 7) { validBufferIndex ++; validBufferIndexBit = 0; @@ -83,13 +83,12 @@ ReturnValue_t LocalDataSet::serializeLocalPoolIds(uint8_t** buffer, return HasReturnvaluesIF::RETURN_OK; } -void LocalDataSet::bitSetter(uint8_t* byte, uint8_t position, - bool value) const { +void LocalDataSet::bitSetter(uint8_t* byte, uint8_t position) const { if(position > 7) { sif::debug << "Pool Raw Access: Bit setting invalid position" << std::endl; return; } uint8_t shiftNumber = position + (7 - 2 * position); - *byte |= 1UL << shiftNumber; + *byte |= 1 << shiftNumber; } diff --git a/datapoollocal/LocalDataSet.h b/datapoollocal/LocalDataSet.h index 48138e63..aea699d8 100644 --- a/datapoollocal/LocalDataSet.h +++ b/datapoollocal/LocalDataSet.h @@ -98,14 +98,10 @@ private: LocalDataPoolManager* hkManager; /** - * Sets the bit at the bit-position of a byte provided by its address - * to the specified value (zero or one). - * @param byte Pointer to byte to bitset. - * @param position MSB first, 0 to 7 possible. - * @param value Value to set. - * @return + * Set n-th bit of a byte, with n being the position from 0 + * (most significant bit) to 7 (least significant bit) */ - void bitSetter(uint8_t* byte, uint8_t position, bool value) const; + void bitSetter(uint8_t* byte, uint8_t position) const; }; #endif /* FRAMEWORK_DATAPOOLLOCAL_LOCALDATASET_H_ */