Commit 24febc7c authored by Pavel Vainerman's avatar Pavel Vainerman

Добавил explicit где советовал cppcheck

parent 6c151936
...@@ -47,7 +47,7 @@ class PostgreSQLResult ...@@ -47,7 +47,7 @@ class PostgreSQLResult
{ {
public: public:
PostgreSQLResult(){} PostgreSQLResult(){}
PostgreSQLResult( const pqxx::result& res ); explicit PostgreSQLResult( const pqxx::result& res );
~PostgreSQLResult(); ~PostgreSQLResult();
typedef std::vector<std::string> COL; typedef std::vector<std::string> COL;
......
...@@ -136,7 +136,7 @@ class DBServer_SQLite: ...@@ -136,7 +136,7 @@ class DBServer_SQLite:
{ {
public: public:
DBServer_SQLite( UniSetTypes::ObjectId id, const std::string& prefix ); DBServer_SQLite( UniSetTypes::ObjectId id, const std::string& prefix );
DBServer_SQLite( const std::string& prefix ); explicit DBServer_SQLite( const std::string& prefix );
virtual ~DBServer_SQLite(); virtual ~DBServer_SQLite();
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
class ComediInterface class ComediInterface
{ {
public: public:
ComediInterface( const std::string& dev ); explicit ComediInterface( const std::string& dev );
~ComediInterface(); ~ComediInterface();
int getAnalogChannel( int subdev, int channel, int range = 0, int aref = AREF_GROUND ) int getAnalogChannel( int subdev, int channel, int range = 0, int aref = AREF_GROUND )
......
...@@ -171,7 +171,7 @@ class CardList: ...@@ -171,7 +171,7 @@ class CardList:
{ {
public: public:
CardList(int size) : std::vector<ComediInterface * >(size) { } explicit CardList( int size ) : std::vector<ComediInterface * >(size) { }
~CardList() ~CardList()
{ {
......
...@@ -13,7 +13,7 @@ class LogicException: ...@@ -13,7 +13,7 @@ class LogicException:
{ {
public: public:
LogicException(): UniSetTypes::Exception("LogicException") {} LogicException(): UniSetTypes::Exception("LogicException") {}
LogicException( const std::string& err): UniSetTypes::Exception(err) {} explicit LogicException( const std::string& err): UniSetTypes::Exception(err) {}
}; };
...@@ -31,7 +31,7 @@ class Element ...@@ -31,7 +31,7 @@ class Element
internal internal
}; };
Element( ElementID id ): myid(id) {}; explicit Element( const ElementID& id ): myid(id) {};
virtual ~Element() {}; virtual ~Element() {};
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
class LProcessor class LProcessor
{ {
public: public:
LProcessor( const std::string& name = "" ); explicit LProcessor( const std::string& name = "" );
virtual ~LProcessor(); virtual ~LProcessor();
void open( const std::string& lfile ); void open( const std::string& lfile );
......
...@@ -13,7 +13,7 @@ class ModbusRTUMaster; ...@@ -13,7 +13,7 @@ class ModbusRTUMaster;
class RTUStorage class RTUStorage
{ {
public: public:
RTUStorage( ModbusRTU::ModbusAddr addr ); explicit RTUStorage( ModbusRTU::ModbusAddr addr );
~RTUStorage(); ~RTUStorage();
void poll( const std::shared_ptr<ModbusRTUMaster>& mb ) void poll( const std::shared_ptr<ModbusRTUMaster>& mb )
......
...@@ -308,7 +308,7 @@ class SharedMemory: ...@@ -308,7 +308,7 @@ class SharedMemory:
struct HistoryItem struct HistoryItem
{ {
HistoryItem( size_t bufsize = 0 ): id(UniSetTypes::DefaultObjectId), buf(bufsize) {} explicit HistoryItem( size_t bufsize = 0 ): id(UniSetTypes::DefaultObjectId), buf(bufsize) {}
HistoryItem( const UniSetTypes::ObjectId _id, const size_t bufsize, const long val ): id(_id), buf(bufsize, val) {} HistoryItem( const UniSetTypes::ObjectId _id, const size_t bufsize, const long val ): id(_id), buf(bufsize, val) {}
inline void init( unsigned int size, long val ) inline void init( unsigned int size, long val )
......
...@@ -72,7 +72,7 @@ namespace UniSetUDP ...@@ -72,7 +72,7 @@ namespace UniSetUDP
{ {
UDPMessage(); UDPMessage();
UDPMessage( UDPPacket& p ); explicit UDPMessage( UDPPacket& p );
size_t transport_msg( UDPPacket& p ); size_t transport_msg( UDPPacket& p );
static size_t getMessage( UDPMessage& m, UDPPacket& p ); static size_t getMessage( UDPMessage& m, UDPPacket& p );
......
...@@ -36,7 +36,7 @@ class SViewer ...@@ -36,7 +36,7 @@ class SViewer
{ {
public: public:
SViewer(const std::string& ControllersSection, bool isShort = true); explicit SViewer(const std::string& ControllersSection, bool isShort = true);
virtual ~SViewer(); virtual ~SViewer();
void view(); void view();
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
struct UException struct UException
{ {
UException() {} UException() {}
UException( const std::string& e ): err(e) {} explicit UException( const std::string& e ): err(e) {}
UException( const char* e ): err( std::string(e)) {} explicit UException( const char* e ): err( std::string(e)) {}
~UException() {} ~UException() {}
const char* getError() const char* getError()
...@@ -20,7 +20,7 @@ struct UTimeOut: ...@@ -20,7 +20,7 @@ struct UTimeOut:
public UException public UException
{ {
UTimeOut(): UException("UTimeOut") {} UTimeOut(): UException("UTimeOut") {}
UTimeOut( const std::string& e ): UException(e) {} explicit UTimeOut( const std::string& e ): UException(e) {}
~UTimeOut() {} ~UTimeOut() {}
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -28,7 +28,7 @@ struct USysError: ...@@ -28,7 +28,7 @@ struct USysError:
public UException public UException
{ {
USysError(): UException("USysError") {} USysError(): UException("USysError") {}
USysError( const std::string& e ): UException(e) {} explicit USysError( const std::string& e ): UException(e) {}
~USysError() {} ~USysError() {}
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -216,7 +216,7 @@ class debugbuf : public streambuf ...@@ -216,7 +216,7 @@ class debugbuf : public streambuf
{ {
public: public:
/// ///
debugbuf(streambuf* b) explicit debugbuf(streambuf* b)
: streambuf(), sb(b) {} : streambuf(), sb(b) {}
protected: protected:
#ifdef MODERN_STL_STREAMS #ifdef MODERN_STL_STREAMS
...@@ -277,7 +277,7 @@ class stringsigbuf : public streambuf ...@@ -277,7 +277,7 @@ class stringsigbuf : public streambuf
} }
/// ///
stringsigbuf( stringbuf* b ) explicit stringsigbuf( stringbuf* b )
: streambuf(), sb(b) {} : streambuf(), sb(b) {}
typedef sigc::signal<void, const std::string&> StrBufOverflow_Signal; typedef sigc::signal<void, const std::string&> StrBufOverflow_Signal;
...@@ -362,4 +362,4 @@ struct DebugStream::debugstream_internal ...@@ -362,4 +362,4 @@ struct DebugStream::debugstream_internal
nullbuf nbuf; nullbuf nbuf;
}; };
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#endif #endif
\ No newline at end of file
...@@ -42,7 +42,7 @@ using namespace std; ...@@ -42,7 +42,7 @@ using namespace std;
class MPush: public unary_function< const std::shared_ptr<UniSetManager>& , bool> class MPush: public unary_function< const std::shared_ptr<UniSetManager>& , bool>
{ {
public: public:
MPush(const UniSetTypes::TransportMessage& msg): msg(msg) {} explicit MPush(const UniSetTypes::TransportMessage& msg): msg(msg) {}
bool operator()( const std::shared_ptr<UniSetManager>& m ) const bool operator()( const std::shared_ptr<UniSetManager>& m ) const
{ {
try try
...@@ -68,7 +68,7 @@ class MPush: public unary_function< const std::shared_ptr<UniSetManager>& , bool ...@@ -68,7 +68,7 @@ class MPush: public unary_function< const std::shared_ptr<UniSetManager>& , bool
class OPush: public unary_function< const std::shared_ptr<UniSetObject>& , bool> class OPush: public unary_function< const std::shared_ptr<UniSetObject>& , bool>
{ {
public: public:
OPush(const UniSetTypes::TransportMessage& msg): msg(msg) {} explicit OPush(const UniSetTypes::TransportMessage& msg): msg(msg) {}
bool operator()( const std::shared_ptr<UniSetObject>& o ) const bool operator()( const std::shared_ptr<UniSetObject>& o ) const
{ {
try try
......
...@@ -292,7 +292,7 @@ struct CInfo ...@@ -292,7 +292,7 @@ struct CInfo
{ {
} }
CInfo( ConfirmMessage& cm ): explicit CInfo( ConfirmMessage& cm ):
sensor_id(cm.sensor_id), sensor_id(cm.sensor_id),
value(cm.value), value(cm.value),
time(cm.time), time(cm.time),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment