Skip to content

Commit

Permalink
Merge pull request #2946 from hoffie/autobuild-compiler-warning-copy-…
Browse files Browse the repository at this point in the history
…constructor

Code: Make copy constructor/assignments explicit
  • Loading branch information
hoffie committed Nov 7, 2022
2 parents 722ee6d + dfd27ea commit d2052e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ class CProtocol : public QObject
CSendMessage() : vecMessage ( 0 ), iID ( PROTMESSID_ILLEGAL ), iCnt ( 0 ) {}
CSendMessage ( const CVector<uint8_t>& nMess, const int iNCnt, const int iNID ) : vecMessage ( nMess ), iID ( iNID ), iCnt ( iNCnt ) {}

CSendMessage ( const CSendMessage& SendMess )
{
vecMessage.Init ( SendMess.vecMessage.Size() );
vecMessage = SendMess.vecMessage;
iID = SendMess.iID;
iCnt = SendMess.iCnt;
}

CSendMessage& operator= ( const CSendMessage& NewSendMess )
{
vecMessage.Init ( NewSendMess.vecMessage.Size() );
Expand Down
1 change: 1 addition & 0 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class CVector : public std::vector<TData>
CVector ( const int iNeSi, const TData tInVa ) { Init ( iNeSi, tInVa ); }

CVector ( CVector const& ) = default;
CVector& operator= ( CVector const& ) = default;

void Init ( const int iNewSize );

Expand Down

0 comments on commit d2052e9

Please sign in to comment.