]> WPIA git - cassiopeia.git/blobdiff - src/io/slipBio.cpp
fix: Make CppCheck happy by fixing the code
[cassiopeia.git] / src / io / slipBio.cpp
index 1a7ba04b6a9040a7b3bba3b53f2c0c2804d8fcdc..fb3f6c1925cbde5cb499008b1edfcb656fe1883d 100644 (file)
@@ -37,27 +37,14 @@ std::string toHex( const char* buf, int len ) {
     return data;
 }
 
-SlipBIO::SlipBIO() {
-    this->buffer = std::vector<char>( BUFFER_SIZE );
-    this->decodeTarget = 0;
-    this->decodePos = 0;
-    this->rawPos = 0;
-    this->failed = false;
+SlipBIO::SlipBIO() : buffer( std::vector<char>( BUFFER_SIZE ) ), decodeTarget( 0 ), decodePos( 0 ), rawPos( 0 ), failed( false ) {
 }
 
 void SlipBIO::setTarget( std::shared_ptr<OpensslBIO> target ) {
     this->target = target;
 }
 
-SlipBIO::SlipBIO( std::shared_ptr<OpensslBIO> target ) {
-    this->target = target;
-
-    this->buffer = std::vector<char>( BUFFER_SIZE );
-    this->decodeTarget = 0;
-    this->decodePos = 0;
-    this->rawPos = 0;
-
-    this->failed = false;
+SlipBIO::SlipBIO( std::shared_ptr<OpensslBIO> target ) : target( target ), buffer( std::vector<char>( BUFFER_SIZE ) ), decodeTarget( 0 ), decodePos( 0 ), rawPos( 0 ), failed( false ) {
 }
 
 SlipBIO::~SlipBIO() {}