code style
This commit is contained in:
@@ -129,9 +129,9 @@ result_t TemParamDataType::writeSymbols(istringstream& input,
|
||||
return RESULT_ERR_OUT_OF_RANGE; // value out of range
|
||||
}
|
||||
if (isMaster) {
|
||||
value = grp | (num<<8); // grp in bits 0...5, num in bits 8...13
|
||||
value = grp | (num << 8); // grp in bits 0...5, num in bits 8...13
|
||||
} else {
|
||||
value = (grp<<7) | num; // grp in bits 7...11, num in bits 0...6
|
||||
value = (grp << 7) | num; // grp in bits 7...11, num in bits 0...6
|
||||
}
|
||||
}
|
||||
if (value < getMinValue() || value > getMaxValue()) {
|
||||
|
||||
@@ -46,7 +46,7 @@ class TemParamDataType : public NumberDataType {
|
||||
* Constructs a new instance.
|
||||
* @param id the type identifier.
|
||||
*/
|
||||
TemParamDataType(const string id)
|
||||
explicit TemParamDataType(const string id)
|
||||
: NumberDataType(id, 16, 0, 0xffff, 0, 0xffff, 0) {}
|
||||
|
||||
// @copydoc
|
||||
|
||||
@@ -410,7 +410,7 @@ class NumberDataType : public DataType {
|
||||
*/
|
||||
NumberDataType(const string id, const unsigned char bitCount, const uint16_t flags, const unsigned int replacement,
|
||||
const int16_t firstBit, const int divisor)
|
||||
: DataType(id, bitCount, flags|NUM, replacement), m_minValue(0), m_maxValue((1<<bitCount)-1), m_divisor(divisor), m_precision(0), m_firstBit(firstBit), m_baseType(NULL) {}
|
||||
: DataType(id, bitCount, flags|NUM, replacement), m_minValue(0), m_maxValue((1 << bitCount)-1), m_divisor(divisor), m_precision(0), m_firstBit(firstBit), m_baseType(NULL) {}
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
|
||||
@@ -74,7 +74,7 @@ class FileReader {
|
||||
/**
|
||||
* Construct a new instance.
|
||||
*/
|
||||
FileReader(bool supportsDefaults)
|
||||
explicit FileReader(bool supportsDefaults)
|
||||
: m_supportsDefaults(supportsDefaults) {}
|
||||
|
||||
/**
|
||||
|
||||
@@ -42,7 +42,7 @@ using std::setw;
|
||||
#define ID_SOURCE_MASK (0x1fLL << (8 * 7))
|
||||
|
||||
/** the bit mask for the ID length and combined ID bytes in the message key. */
|
||||
#define ID_LENGTH_AND_IDS_MASK ((7LL<<(8 * 7 + 5)) | 0xffffffffLL)
|
||||
#define ID_LENGTH_AND_IDS_MASK ((7LL << (8 * 7 + 5)) | 0xffffffffLL)
|
||||
|
||||
/** the bits in the @a ID_SOURCE_MASK for arbitrary source and active read message. */
|
||||
#define ID_SOURCE_ACTIVE_WRITE (0x1fLL << (8 * 7))
|
||||
@@ -447,7 +447,7 @@ result_t Message::create(vector<string>::iterator& it, const vector<string>::ite
|
||||
unsigned char dstAddress = *it;
|
||||
string useCircuit = circuit;
|
||||
if (multiple) {
|
||||
sprintf(num, ".%d", index);
|
||||
snprintf(num, sizeof(num), ".%d", index);
|
||||
useCircuit = useCircuit + num;
|
||||
}
|
||||
Message* message;
|
||||
|
||||
@@ -1136,7 +1136,7 @@ class MessageMap : public FileReader {
|
||||
* Construct a new instance.
|
||||
* @param addAll whether to add all messages, even if duplicate.
|
||||
*/
|
||||
MessageMap(const bool addAll = false) : FileReader::FileReader(true),
|
||||
explicit MessageMap(const bool addAll = false) : FileReader::FileReader(true),
|
||||
m_addAll(addAll), m_maxIdLength(0), m_messageCount(0), m_conditionalMessageCount(0), m_passiveMessageCount(0) {
|
||||
m_scanMessage = Message::createScanMessage();
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class SymbolString {
|
||||
* Creates a new empty escaped or unescaped instance.
|
||||
* @param escaped whether to create an escaped instance.
|
||||
*/
|
||||
SymbolString(const bool escaped = true) : m_unescapeState(escaped ? 0 : 1), m_crc(0) {}
|
||||
explicit SymbolString(const bool escaped = true) : m_unescapeState(escaped ? 0 : 1), m_crc(0) {}
|
||||
|
||||
/**
|
||||
* Add all symbols from the other @a SymbolString and the calculated CRC if escaped.
|
||||
|
||||
Reference in New Issue
Block a user