Use nullptr (#816)

Changes applied by 'clang-modernize -use-nullptr [...]'
This commit is contained in:
J-P Nurmi
2015-02-25 09:19:28 +01:00
parent 26cc16caa7
commit 70c0ffb10b
38 changed files with 246 additions and 246 deletions

View File

@@ -97,7 +97,7 @@ bool CZNCTagHandler::HandleTag(CTemplate& Tmpl, const CString& sName, const CStr
}
CWebSession::CWebSession(const CString& sId, const CString& sIP) : m_sId(sId), m_sIP(sIP) {
m_pUser = NULL;
m_pUser = nullptr;
Sessions.m_mIPSessions.insert(make_pair(sIP, this));
UpdateLastActive();
}
@@ -174,7 +174,7 @@ void CWebAuth::RefusedLogin(const CString& sReason) {
std::shared_ptr<CWebSession> spSession = m_pWebSock->GetSession();
spSession->AddError("Invalid login!");
spSession->SetUser(NULL);
spSession->SetUser(nullptr);
m_pWebSock->SetLoggedIn(false);
m_pWebSock->UnPauseRead();
@@ -186,10 +186,10 @@ void CWebAuth::RefusedLogin(const CString& sReason) {
void CWebAuth::Invalidate() {
CAuthBase::Invalidate();
m_pWebSock = NULL;
m_pWebSock = nullptr;
}
CWebSock::CWebSock(const CString& sURIPrefix) : CHTTPSock(NULL, sURIPrefix) {
CWebSock::CWebSock(const CString& sURIPrefix) : CHTTPSock(nullptr, sURIPrefix) {
m_bPathsSet = false;
m_Template.AddTagHandler(std::make_shared<CZNCTagHandler>(*this));
@@ -325,7 +325,7 @@ void CWebSock::SetPaths(CModule* pModule, bool bIsTemplate) {
void CWebSock::SetVars() {
m_Template["SessionUser"] = GetUser();
m_Template["SessionIP"] = GetRemoteIP();
m_Template["Tag"] = CZNC::GetTag(GetSession()->GetUser() != NULL, true);
m_Template["Tag"] = CZNC::GetTag(GetSession()->GetUser() != nullptr, true);
m_Template["Version"] = CZNC::GetVersion();
m_Template["SkinName"] = GetSkinName();
m_Template["_CSRF_Check"] = GetCSRFCheck();
@@ -622,7 +622,7 @@ CWebSock::EPageReqResult CWebSock::OnPageRequestInternal(const CString& sURI, CS
} else if (sURI == "/robots.txt") {
return PrintStaticFile("/pub/robots.txt", sPageRet);
} else if (sURI == "/logout") {
GetSession()->SetUser(NULL);
GetSession()->SetUser(nullptr);
SetLoggedIn(false);
Redirect("/");
@@ -694,7 +694,7 @@ CWebSock::EPageReqResult CWebSock::OnPageRequestInternal(const CString& sURI, CS
return PAGE_DONE;
}
CIRCNetwork *pNetwork = NULL;
CIRCNetwork *pNetwork = nullptr;
if (eModType == CModInfo::NetworkModule) {
CString sNetwork = m_sPath.Token(0, false, "/");
m_sPath = m_sPath.Token(1, true, "/");
@@ -716,7 +716,7 @@ CWebSock::EPageReqResult CWebSock::OnPageRequestInternal(const CString& sURI, CS
DEBUG("Path [" + m_sPath + "], Module [" + m_sModName + "], Page [" + m_sPage + "]");
CModule *pModule = NULL;
CModule *pModule = nullptr;
switch (eModType) {
case CModInfo::GlobalModule:
@@ -831,7 +831,7 @@ std::shared_ptr<CWebSession> CWebSock::GetSession() {
const CString sCookieSessionId = GetRequestCookie("SessionId");
std::shared_ptr<CWebSession> *pSession = Sessions.m_mspSessions.GetItem(sCookieSessionId);
if (pSession != NULL) {
if (pSession != nullptr) {
// Refresh the timeout
Sessions.m_mspSessions.AddItem((*pSession)->GetId(), *pSession);
(*pSession)->UpdateLastActive();
@@ -853,7 +853,7 @@ std::shared_ptr<CWebSession> CWebSock::GetSession() {
sSessionID = CString::RandomString(32);
sSessionID += ":" + GetRemoteIP() + ":" + CString(GetRemotePort());
sSessionID += ":" + GetLocalIP() + ":" + CString(GetLocalPort());
sSessionID += ":" + CString(time(NULL));
sSessionID += ":" + CString(time(nullptr));
sSessionID = sSessionID.SHA256();
DEBUG("Auto generated session: [" + sSessionID + "]");
@@ -889,7 +889,7 @@ Csock* CWebSock::GetSockObj(const CString& sHost, unsigned short uPort) {
// All listening is done by CListener, thus CWebSock should never have
// to listen, but since GetSockObj() is pure virtual...
DEBUG("CWebSock::GetSockObj() called - this should never happen!");
return NULL;
return nullptr;
}
CString CWebSock::GetSkinName() {