avoid unnecessary includes, avoid unnecessary casts, better initialization
This commit is contained in:
@@ -21,17 +21,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ebusd/bushandler.h"
|
#include "ebusd/bushandler.h"
|
||||||
#include <unistd.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <deque>
|
|
||||||
#include <cstring>
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include "lib/ebus/message.h"
|
|
||||||
#include "lib/ebus/data.h"
|
|
||||||
#include "lib/ebus/result.h"
|
|
||||||
#include "lib/ebus/symbol.h"
|
|
||||||
#include "lib/utils/log.h"
|
#include "lib/utils/log.h"
|
||||||
|
|
||||||
namespace ebusd {
|
namespace ebusd {
|
||||||
@@ -995,7 +985,7 @@ void BusHandler::setScanFinished() {
|
|||||||
|
|
||||||
void BusHandler::formatScanResult(ostringstream& output) {
|
void BusHandler::formatScanResult(ostringstream& output) {
|
||||||
if (m_runningScans > 0) {
|
if (m_runningScans > 0) {
|
||||||
output << static_cast<unsigned>(m_runningScans) << " scan(s) still running" << endl;
|
output << m_runningScans << " scan(s) still running" << endl;
|
||||||
}
|
}
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for (unsigned char slave = 1; slave != 0; slave++) { // 0 is known to be a master
|
for (unsigned char slave = 1; slave != 0; slave++) { // 0 is known to be a master
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ class BusHandler : public WaitThread {
|
|||||||
m_busLostRetries(busLostRetries), m_failedSendRetries(failedSendRetries),
|
m_busLostRetries(busLostRetries), m_failedSendRetries(failedSendRetries),
|
||||||
m_transferLatency(transferLatency), m_busAcquireTimeout(busAcquireTimeout), m_slaveRecvTimeout(slaveRecvTimeout),
|
m_transferLatency(transferLatency), m_busAcquireTimeout(busAcquireTimeout), m_slaveRecvTimeout(slaveRecvTimeout),
|
||||||
m_masterCount(device->isReadOnly()?0:1), m_autoLockCount(lockCount == 0),
|
m_masterCount(device->isReadOnly()?0:1), m_autoLockCount(lockCount == 0),
|
||||||
m_lockCount(lockCount <= 3 ? 3 : lockCount), m_remainLockCount(m_autoLockCount),
|
m_lockCount(lockCount <= 3 ? 3 : lockCount), m_remainLockCount(m_autoLockCount ? 1 : 0),
|
||||||
m_generateSynInterval(generateSyn ? SYN_TIMEOUT*getMasterNumber(ownAddress)+SYMBOL_DURATION : 0),
|
m_generateSynInterval(generateSyn ? SYN_TIMEOUT*getMasterNumber(ownAddress)+SYMBOL_DURATION : 0),
|
||||||
m_pollInterval(pollInterval), m_lastReceive(0), m_lastPoll(0),
|
m_pollInterval(pollInterval), m_lastReceive(0), m_lastPoll(0),
|
||||||
m_currentRequest(NULL), m_runningScans(0), m_nextSendPos(0),
|
m_currentRequest(NULL), m_runningScans(0), m_nextSendPos(0),
|
||||||
|
|||||||
@@ -21,16 +21,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ebusd/datahandler.h"
|
#include "ebusd/datahandler.h"
|
||||||
#include <list>
|
|
||||||
#include <string>
|
|
||||||
#ifdef HAVE_MQTT
|
#ifdef HAVE_MQTT
|
||||||
# include "ebusd/mqtthandler.h"
|
# include "ebusd/mqtthandler.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace ebusd {
|
namespace ebusd {
|
||||||
|
|
||||||
using std::string;
|
|
||||||
|
|
||||||
/** the final @a argp_child structure. */
|
/** the final @a argp_child structure. */
|
||||||
static const struct argp_child g_last_argp_child = {NULL, 0, NULL, 0};
|
static const struct argp_child g_last_argp_child = {NULL, 0, NULL, 0};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user