code style
This commit is contained in:
@@ -245,7 +245,7 @@ string Device::getEnhancedInfos() {
|
||||
res = requestEnhancedInfo(2);
|
||||
if (res != RESULT_OK) {
|
||||
fails += ", cannot request config";
|
||||
requestEnhancedInfo(0xff); // wait for completion
|
||||
requestEnhancedInfo(0xff); // wait for completion
|
||||
m_infoPos = 0;
|
||||
m_infoId = 0xff;
|
||||
}
|
||||
@@ -266,7 +266,7 @@ string Device::getEnhancedInfos() {
|
||||
if (res != RESULT_OK) {
|
||||
fails += ", cannot request bus voltage";
|
||||
}
|
||||
res = requestEnhancedInfo(0xff); // wait for completion
|
||||
res = requestEnhancedInfo(0xff); // wait for completion
|
||||
if (res != RESULT_OK) {
|
||||
m_enhInfoBusVoltage = "bus voltage unknown";
|
||||
m_infoPos = 0;
|
||||
@@ -509,7 +509,7 @@ bool Device::available() {
|
||||
// drop first byte of invalid sequence
|
||||
m_bufPos = (m_bufPos + 1) % m_bufSize;
|
||||
m_bufLen--;
|
||||
pos--; // check same pos again
|
||||
pos--; // check same pos again
|
||||
continue;
|
||||
}
|
||||
if (cmd == ENH_RES_RECEIVED || cmd == ENH_RES_STARTED || cmd == ENH_RES_FAILED) {
|
||||
@@ -524,7 +524,7 @@ bool Device::available() {
|
||||
fprintf(stdout, "raw avail enhanced skip cmd %d @%d+%d %2.2x\n", cmd, m_bufPos, pos, ch);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
pos++; // skip enhanced sequence of 2 bytes
|
||||
pos++; // skip enhanced sequence of 2 bytes
|
||||
continue;
|
||||
}
|
||||
#ifdef DEBUG_RAW_TRAFFIC
|
||||
@@ -537,7 +537,7 @@ bool Device::available() {
|
||||
// skip byte from erroneous protocol
|
||||
m_bufPos = (m_bufPos+1)%m_bufSize;
|
||||
m_bufLen--;
|
||||
pos--; // check byte 2 again from scratch and allow as byte 1
|
||||
pos--; // check byte 2 again from scratch and allow as byte 1
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ result_t Message::create(const string& filename, const DataFieldTemplates* templ
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (id.size() + data->getLength(pt_masterData, maxLength==MAX_POS ? MAX_POS-id.size() : maxLength) > 2 + maxLength
|
||||
if (id.size() + data->getLength(pt_masterData, maxLength == MAX_POS ? MAX_POS-id.size() : maxLength) > 2 + maxLength
|
||||
|| data->getLength(pt_slaveData, maxLength) > maxLength) {
|
||||
// max NN exceeded
|
||||
delete data;
|
||||
|
||||
@@ -152,7 +152,7 @@ SSLSocket* SSLSocket::connect(const string& host, const uint16_t& port, bool htt
|
||||
time_t until = time(nullptr) + (timeout <= 3 ? 3 : timeout); // at least 3 seconds
|
||||
if (!https) {
|
||||
do {
|
||||
bio = BIO_new_connect((char*)hostPort.c_str());
|
||||
bio = BIO_new_connect(static_cast<const char*>(hostPort.c_str()));
|
||||
if (isError("connect", bio)) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -132,8 +132,7 @@ class HttpClient {
|
||||
m_caFile(caFile),
|
||||
m_caPath(caPath),
|
||||
#endif
|
||||
m_socket(nullptr), m_port(0), m_timeout(0), m_bufferSize(0), m_buffer(nullptr)
|
||||
{
|
||||
m_socket(nullptr), m_port(0), m_timeout(0), m_bufferSize(0), m_buffer(nullptr) {
|
||||
if (init) {
|
||||
initialize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user