{
static LPCTSTR braces = _T("{}()[]<>");
LPCTSTR pos = _tcschr (braces, c);
- return pos ? (int) (pos - braces) + 1 : 0;
+ return pos != nullptr ? (int) (pos - braces) + 1 : 0;
}
int
if (source_coding < 0)
{
posit = fget_coding (string, &source_coding);
- if (posit)
+ if (posit != 0)
cod_pos = string + posit;
}
if (source_coding < 0)
sc = piClassFactory->lpVtbl->CreateInstance(piClassFactory, 0, &IID_IDispatch, &pv);
}
}
- if (!pv)
+ if (pv == NULL)
FreeLibrary(hLibrary);
}
return pv;
path[i] = ctxt.GetNormalizedPath(i);
// If we have temp context it means we are comparing archives
- if (pTempPathContext)
+ if (pTempPathContext != nullptr)
{
std::vector<String> name(path.size());
for (int i = 0; i < static_cast<int>(path.size()); ++i)
while (pNf.get() != nullptr)
{
WorkNotification* pWorkNf = dynamic_cast<WorkNotification*>(pNf.get());
- if (pWorkNf) {
+ if (pWorkNf != nullptr) {
m_pCtxt->m_pCompareStats->BeginCompare(&pWorkNf->data(), m_id);
if (!m_pCtxt->ShouldAbort())
CompareDiffItem(pWorkNf->data(), m_pCtxt);
CShellContextMenu* pMenu = GetCorrespondingShellContextMenu(m_hCurrentMenu);
- if (pMenu)
+ if (pMenu != nullptr)
{
LRESULT res = 0;
pMenu->HandleMenuMessage(message, wParam, lParam, res);
PrediffingInfo * infoPrediffer = nullptr;
// Get existing or new plugin infos
- if (pCtxt->m_piPluginInfos)
+ if (pCtxt->m_piPluginInfos != nullptr)
pCtxt->FetchPluginInfos(filteredFilenames, &infoUnpacker,
&infoPrediffer);
{
CView * pActiveView = GetParentFrame()->GetActiveView();
CMergeEditView * pMergeEditView = dynamic_cast<CMergeEditView *>(pActiveView);
- if (!pMergeEditView)
+ if (pMergeEditView == nullptr)
pMergeEditView = GetView(0, 0); // default to left view (in case some location or detail view active)
return pMergeEditView;
}
void CMergeDoc::SetUnpacker(const PackingInfo * infoNewHandler)
{
- if (infoNewHandler)
+ if (infoNewHandler != nullptr)
{
*m_pInfoUnpacker = *infoNewHandler;
}
template<class T> struct AutoReleaser
{
explicit AutoReleaser(T *ptr) : p(ptr) {}
- ~AutoReleaser() { if (p) p->Release(); }
+ ~AutoReleaser() { if (p!=nullptr) p->Release(); }
T *p;
};
int GetFunctionsFromScript(IDispatch *piDispatch, vector<String>& namesArray, vector<int>& IdArray, INVOKEKIND wantedKind)
{
UINT iValidFunc = 0;
- if (piDispatch)
+ if (piDispatch != nullptr)
{
ITypeInfo *piTypeInfo=nullptr;
unsigned iTInfo = 0; // 0 for type information of IDispatch itself
void PluginsListDlg::OnBnClickedPluginSettings()
{
POSITION pos = m_list.GetFirstSelectedItemPosition();
- if (pos)
+ if (pos != nullptr)
{
String pluginName = static_cast<const TCHAR *>(m_list.GetItemText(m_list.GetNextSelectedItem(pos), 0));
for (int i = 0; TransformationCategories[i] != nullptr; ++i)
{
PluginInfo * plugin = CAllThreadsScripts::GetActiveSet()->GetPluginByName(TransformationCategories[i], pluginName);
- if (plugin)
+ if (plugin != nullptr)
{
EnableWindow(false);
plugin::InvokeShowSettingsDialog(plugin->m_lpDispatch);
theApp.LoadAndOpenProjectFile(projectFile);\r
CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
EXPECT_NE(nullptr, pFrame);\r
- if (pFrame)\r
+ if (pFrame != nullptr)\r
pFrame->PostMessage(WM_CLOSE);\r
}\r
\r
theApp.LoadAndOpenProjectFile(projectFile);\r
CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
EXPECT_NE(nullptr, pFrame);\r
- if (pFrame)\r
+ if (pFrame != nullptr)\r
pFrame->PostMessage(WM_CLOSE);\r
}\r
\r
// Convert "%userprofile%\My Documents" to "C:\Documents and Settings\username\My Documents"
TCHAR expandedPath[MAX_PATH_FULL];
const TCHAR *lpcszPath = sPath.c_str();
- if (bExpandEnvs && _tcschr(lpcszPath, '%'))
+ if (bExpandEnvs && _tcschr(lpcszPath, '%') != nullptr)
{
DWORD dwLen = ExpandEnvironmentStrings(lpcszPath, expandedPath, MAX_PATH_FULL);
if (dwLen > 0 && dwLen < MAX_PATH_FULL)