code style

This commit is contained in:
john30
2017-12-26 14:27:44 +01:00
parent 631f05ab3f
commit b0e20b7c7c
7 changed files with 19 additions and 11 deletions
Executable → Regular
+2 -2
View File
@@ -692,7 +692,7 @@ result_t BusHandler::handleSymbol() {
long long latencyLong = (sentTime.tv_sec*1000000000 + sentTime.tv_nsec long long latencyLong = (sentTime.tv_sec*1000000000 + sentTime.tv_nsec
- m_lastSynReceiveTime.tv_sec*1000000000 - m_lastSynReceiveTime.tv_nsec)/1000; - m_lastSynReceiveTime.tv_sec*1000000000 - m_lastSynReceiveTime.tv_nsec)/1000;
if (latencyLong >= 0 && latencyLong <= 10000) { // skip clock skew or out of reasonable range if (latencyLong >= 0 && latencyLong <= 10000) { // skip clock skew or out of reasonable range
int latency = (int)latencyLong; int latency = static_cast<int>(latencyLong);
logDebug(lf_bus, "arbitration delay %d micros", latency); logDebug(lf_bus, "arbitration delay %d micros", latency);
if (m_arbitrationDelayMin < 0 || (latency < m_arbitrationDelayMin || latency > m_arbitrationDelayMax)) { if (m_arbitrationDelayMin < 0 || (latency < m_arbitrationDelayMin || latency > m_arbitrationDelayMax)) {
if (m_arbitrationDelayMin == -1 || latency < m_arbitrationDelayMin) { if (m_arbitrationDelayMin == -1 || latency < m_arbitrationDelayMin) {
@@ -1022,7 +1022,7 @@ void BusHandler::measureLatency(struct timespec* sentTime, struct timespec* recv
if (latencyLong < 0 || latencyLong > 1000) { if (latencyLong < 0 || latencyLong > 1000) {
return; // clock skew or out of reasonable range return; // clock skew or out of reasonable range
} }
int latency = (int)latencyLong; int latency = static_cast<int>(latencyLong);
logDebug(lf_bus, "send/receive symbol latency %d ms", latency); logDebug(lf_bus, "send/receive symbol latency %d ms", latency);
if (m_symbolLatencyMin >= 0 && (latency >= m_symbolLatencyMin && latency <= m_symbolLatencyMax)) { if (m_symbolLatencyMin >= 0 && (latency >= m_symbolLatencyMin && latency <= m_symbolLatencyMax)) {
return; return;
Executable → Regular
+8 -2
View File
@@ -698,10 +698,16 @@ class BusHandler : public WaitThread {
/** the maximal measured latency between send and receive of a symbol in milliseconds, -1 if not yet known. */ /** the maximal measured latency between send and receive of a symbol in milliseconds, -1 if not yet known. */
int m_symbolLatencyMax; int m_symbolLatencyMax;
/** the minimal measured delay between received SYN and sent own master address in microseconds, -1 if not yet known. */ /**
* the minimal measured delay between received SYN and sent own master address in microseconds,
* -1 if not yet known.
*/
int m_arbitrationDelayMin; int m_arbitrationDelayMin;
/** the maximal measured delay between received SYN and sent own master address in microseconds, -1 if not yet known. */ /**
* the maximal measured delay between received SYN and sent own master address in microseconds,
* -1 if not yet known.
*/
int m_arbitrationDelayMax; int m_arbitrationDelayMax;
/** the time of the last received SYN symbol, or 0 for never. */ /** the time of the last received SYN symbol, or 0 for never. */
+3 -2
View File
@@ -1197,8 +1197,9 @@ int main(int argc, char* argv[]) {
signal(SIGTERM, signalHandler); signal(SIGTERM, signalHandler);
logNotice(lf_main, PACKAGE_STRING "." REVISION " started%s", logNotice(lf_main, PACKAGE_STRING "." REVISION " started%s",
opt.scanConfig ? opt.initialScan == ESC ? " with auto scan" : opt.initialScan == BROADCAST ? " with broadcast scan" opt.scanConfig ? opt.initialScan == ESC ? " with auto scan"
: opt.initialScan == SYN ? " with full scan" : " with single scan" : ""); : opt.initialScan == BROADCAST ? " with broadcast scan" : opt.initialScan == SYN ? " with full scan"
: " with single scan" : "");
// load configuration files // load configuration files
loadConfigFiles(s_messageMap); loadConfigFiles(s_messageMap);
Executable → Regular
View File
+2 -1
View File
@@ -658,7 +658,8 @@ bool SingleDataField::hasFullByteOffset(bool after) const {
} }
size_t SingleDataField::getCount(PartType partType, const char* fieldName) const { size_t SingleDataField::getCount(PartType partType, const char* fieldName) const {
return isIgnored() || (partType != pt_any && partType != m_partType) || (fieldName != NULL && m_name != fieldName) ? 0 : 1; return isIgnored() || (partType != pt_any && partType != m_partType) || (fieldName != NULL && m_name != fieldName)
? 0 : 1;
} }