Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cppcheck [useInitializationList] warnings #191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AsyncDNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

CAsyncDNS::CAsyncDNS(const wxString& ipName, DnsSolveType type, wxEvtHandler* handler, void* socket)
: wxThread(wxTHREAD_DETACHED)
, m_ipName(ipName.wc_str()) // make a deep copy to to circument the thread-unsafe wxString reference counting
{
m_type = type;
m_ipName = ipName.wc_str(); // make a deep copy to to circument the thread-unsafe wxString reference counting
m_socket = socket;
m_handler = handler;
}
Expand Down
2 changes: 1 addition & 1 deletion src/CanceledFileList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@


CCanceledFileList::CCanceledFileList()
: m_filename(wxT("canceled.met"))
{
m_filename = wxT("canceled.met");
Init();
}

Expand Down
6 changes: 3 additions & 3 deletions src/FileLock.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ class CFileLock
CFileLock(const std::string& file)
#ifdef _WIN32
: m_ok(false)
{
hd = CreateFileA((file + "_lock").c_str(),
, hd(CreateFileA((file + "_lock").c_str(),
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, // share - shareable
NULL, // security - not inheritable
CREATE_ALWAYS,
FILE_ATTRIBUTE_ARCHIVE,
NULL);
NULL))
{
if (hd != INVALID_HANDLE_VALUE) {
m_ok = SetLock(true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Friend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ void CFriend::Init()


CFriend::CFriend( const CMD4Hash& userhash, uint32 tm_dwLastSeen, uint32 tm_dwLastUsedIP, uint32 tm_nLastUsedPort, uint32 tm_dwLastChatted, const wxString& tm_strName)
: m_UserHash(userhash)
{
m_dwLastSeen = tm_dwLastSeen;
m_dwLastUsedIP = tm_dwLastUsedIP;
m_nLastUsedPort = tm_nLastUsedPort;
m_dwLastChatted = tm_dwLastChatted;
m_UserHash = userhash;

if (tm_strName.IsEmpty()) {
m_strName = wxT("?");
Expand Down
2 changes: 1 addition & 1 deletion src/GapList.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class CGapList {
public:
// constructs
const_iterator() {};
const_iterator(const ListType::const_iterator& it) { m_it = it; };
const_iterator(const ListType::const_iterator& it) : m_it(it) { };
// operators
bool operator != (const const_iterator& it) const { return m_it != it.m_it; }
const_iterator& operator ++ () { ++ m_it; return *this; }
Expand Down
2 changes: 1 addition & 1 deletion src/IP2Country.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
#include "IP2Country.h"

CIP2Country::CIP2Country(const wxString& configDir)
: m_DataBaseName(wxT("GeoIP.dat"))
{
m_geoip = NULL;
m_DataBaseName = wxT("GeoIP.dat");
m_DataBasePath = configDir + m_DataBaseName;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Tag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
// CTag

CTag::CTag(const wxString& Name)
: m_Name(Name)
{
m_uType = 0;
m_uName = 0;
m_Name = Name;
m_uVal = 0;
m_nSize = 0;
}
Expand All @@ -54,10 +54,10 @@ CTag::CTag(uint8 uName)
}

CTag::CTag(const CTag& rTag)
: m_Name(rTag.m_Name)
{
m_uType = rTag.m_uType;
m_uName = rTag.m_uName;
m_Name = rTag.m_Name;
m_nSize = 0;
if (rTag.IsStr()) {
m_pstrVal = new wxString(rTag.GetStr());
Expand Down
2 changes: 1 addition & 1 deletion src/TextClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ enum {

// method to create a SearchFile
SearchFile::SearchFile(const CEC_SearchFile_Tag *tag)
: nHash(tag->FileHash())
{
nHash = tag->FileHash();
sHash = nHash.Encode();
sFileName = tag->FileName();
lFileSize = tag->SizeFull();
Expand Down
18 changes: 7 additions & 11 deletions src/utils/wxCas/src/onlinesig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,14 @@
OnLineSig::OnLineSig ( const wxFileName& file,
const double absoluteMaxDL,
const wxDateTime absoluteMaxDlDate )
: m_sessionMaxDL(0.0)
, m_sessionMaxDLDate(wxDateTime::Now())
, m_isSessionMaxDlReseted(false)
, m_absoluteMaxDL(absoluteMaxDL)
, m_absoluteMaxDlDate(absoluteMaxDlDate)
, m_isAbsoluteMaxDlReseted(false)
, m_amulesig(file)
{
m_amulesig = file;

m_sessionMaxDL = 0.0;
m_sessionMaxDLDate = wxDateTime::Now();

m_absoluteMaxDL = absoluteMaxDL;
m_absoluteMaxDlDate = absoluteMaxDlDate;

m_isSessionMaxDlReseted = false;
m_isAbsoluteMaxDlReseted = false;

Refresh ();
}

Expand Down
8 changes: 4 additions & 4 deletions src/webserver/src/WebSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
#endif

CWebSocket::CWebSocket(CWebServerBase *parent)
: m_dwBufSize(4096)
, m_dwRecv(0)
, m_dwHttpHeaderLen(0)
, m_dwHttpContentLen(0)
{
m_pHead = 0;
m_pTail = 0;
m_pBuf = new char [4096];
m_dwBufSize = 4096;
m_dwRecv = 0;
m_dwHttpHeaderLen = 0;
m_dwHttpContentLen = 0;
m_Cookie = 0;
m_IsGet = false;
m_IsPost = false;
Expand Down