@brief Constructor.
*/
LineInfo::LineInfo()
-: m_pcLine(NULL)
+: m_pcLine(nullptr)
, m_nLength(0)
, m_nMax(0)
, m_nEolChars(0)
UndoRecord () // default constructor\r
: m_dwFlags(0)\r
, m_nAction(0)\r
- , m_paSavedRevisionNumbers(NULL)\r
- , m_pszText(NULL)\r
+ , m_paSavedRevisionNumbers(nullptr)\r
+ , m_pszText(nullptr)\r
{\r
}\r
\r
UndoRecord (const UndoRecord & src) // copy constructor\r
: m_dwFlags(0)\r
, m_nAction(0)\r
- , m_paSavedRevisionNumbers(NULL)\r
- , m_pszText(NULL)\r
+ , m_paSavedRevisionNumbers(nullptr)\r
+ , m_pszText(nullptr)\r
{\r
Clone(src);\r
}\r
if (!p)
return 0;
*s = p;
- assert(*s);
+ assert(*s != 0);
memcpy(*s + *len, a, alen * sizeof(TCHAR));
} else {
*s = (LPTSTR) malloc(NewLen * sizeof(TCHAR));
- assert(*s);
+ assert(*s != 0);
memcpy(*s, a, alen * sizeof(TCHAR));
*len = 0;
}
* @brief Constructor.
*/
CChildFrame::CChildFrame()
-: m_hIdentical(NULL)
-, m_hDifferent(NULL)
+: m_hIdentical(nullptr)
+, m_hDifferent(nullptr)
{
m_bActivated = false;
std::fill_n(m_nLastSplitPos, 2, 0);
#endif
if(psubmenu){
pgoodmenu=psubmenu->FindAnotherMenuOption(nId,nLoc,bcsubs,bclocs);
- if(pgoodmenu)return(pgoodmenu);
+ if(pgoodmenu != nullptr)
+ return pgoodmenu;
}
else if(nId==(int)GetMenuItemID(i)){
INT_PTR numsubs=bcsubs.GetSize();
}
if(foundflag){
nLoc=static_cast<UINT>(i);
- return(this);
+ return this;
}
}
}
nLoc = static_cast<UINT>(-1);
- return(NULL);
+ return nullptr;
}
BCMenu *BCMenu::FindMenuOption(int nId,UINT& nLoc)
#endif
if(psubmenu){
pgoodmenu=psubmenu->FindMenuOption(nId,nLoc);
- if(pgoodmenu)return(pgoodmenu);
+ if(pgoodmenu != nullptr)
+ return pgoodmenu;
}
else if(nId==(int)GetMenuItemID(i)){
nLoc=i;
- return(this);
+ return this;
}
}
nLoc = static_cast<UINT>(-1);
- return(NULL);
+ return nullptr;
}
BCMenuData *BCMenu::FindMenuOption(wchar_t *lpstrText)
#else
psubmenu=static_cast<BCMenu *>(GetSubMenu(i));
#endif
- if(psubmenu){
+ if(psubmenu != nullptr){
pmenulist=psubmenu->FindMenuOption(lpstrText);
- if(pmenulist)return(pmenulist);
+ if(pmenulist != nullptr)
+ return pmenulist;
}
else{
for(j=0;j<=m_MenuList.GetUpperBound();++j){
const wchar_t *szWide;//SK: we use const to prevent misuse of this Ptr
szWide = m_MenuList[j]->GetWideString ();
if(szWide && !wcscmp(lpstrText,szWide))//SK: modified for dynamic allocation
- return(m_MenuList[j]);
+ return m_MenuList[j];
}
}
}
- return(NULL);
+ return nullptr;
}
BOOL BCMenu::LoadMenu(LPCTSTR lpszResourceName)
{
ASSERT_VALID(this);
- ASSERT(lpszResourceName != NULL);
+ ASSERT(lpszResourceName != nullptr);
// Find the Menu Resource:
HINSTANCE hInst = AfxFindResourceHandle(lpszResourceName,RT_MENU);
HRSRC hRsrc = ::FindResource(hInst,lpszResourceName,RT_MENU);
- if (hRsrc == NULL){
- hInst = NULL;
+ if (hRsrc == nullptr){
+ hInst = nullptr;
hRsrc = ::FindResource(hInst,lpszResourceName,RT_MENU);
}
- if(hRsrc == NULL)return FALSE;
+ if(hRsrc == nullptr)
+ return FALSE;
// Load the Menu Resource:
HGLOBAL hGlobal = LoadResource(hInst, hRsrc);
- if(hGlobal == NULL)return FALSE;
+ if(hGlobal == nullptr)
+ return FALSE;
// first destroy the menu if we're trying to loadmenu again
DestroyMenu();
// Attempt to create us as a menu...
- if(!CMenu::CreateMenu())return FALSE;
+ if(!CMenu::CreateMenu())
+ return FALSE;
// Get Item template Header, and calculate offset of MENUITEMTEMPLATES
for(int i=0;i<=m_MenuList.GetUpperBound();++i){
if(m_MenuList[i]->nID==nID && !m_MenuList[i]->syncflag){
m_MenuList[i]->syncflag=1;
- return(m_MenuList[i]);
+ return m_MenuList[i];
}
}
- return(NULL);
+ return nullptr;
}
void BCMenu::InitializeMenuList(int value)
BITMAP BitMap;
bmp.GetBitmap(&BitMap);
- ddc.CreateCompatibleDC(NULL);
+ ddc.CreateCompatibleDC(nullptr);
CBitmap * pddcOldBmp = ddc.SelectObject(&bmp);
// use this to get the background color, takes into account color shifting
CDC ddc2;
CBitmap bmp2;
- ddc2.CreateCompatibleDC(NULL);
+ ddc2.CreateCompatibleDC(nullptr);
bmp2.CreateCompatibleBitmap(&ddc,BitMap.bmWidth,BitMap.bmHeight);
col=RGB(255,0,255); // Original was RGB(192,192,192)
CBitmap * pddcOldBmp2 = ddc2.SelectObject(&bmp2);
BITMAP BitMap;
bmp.GetBitmap(&BitMap);
- ddc.CreateCompatibleDC(NULL);
+ ddc.CreateCompatibleDC(nullptr);
CBitmap * pddcOldBmp = ddc.SelectObject(&bmp);
// use this to get the background color, takes into account color shifting
CDC ddc2;
CBitmap bmp2;
- ddc2.CreateCompatibleDC(NULL);
+ ddc2.CreateCompatibleDC(nullptr);
bmp2.CreateCompatibleBitmap(&ddc,BitMap.bmWidth,BitMap.bmHeight);
CBitmap * pddcOldBmp2 = ddc2.SelectObject(&bmp2);
CRect rect(0,0,BitMap.bmWidth,BitMap.bmHeight);
{
// create a monochrome memory DC
CDC ddc;
- ddc.CreateCompatibleDC(0);
+ ddc.CreateCompatibleDC(nullptr);
CBitmap bwbmp;
bwbmp.CreateCompatibleBitmap(&ddc, nWidth, nHeight);
CBitmap * pddcOldBmp = ddc.SelectObject(&bwbmp);
CDC dc;
- dc.CreateCompatibleDC(0);
+ dc.CreateCompatibleDC(nullptr);
CBitmap * pdcOldBmp = dc.SelectObject(&bmp);
// build a mask
{
GetDisabledBitmap(bmp,bgcolor);
CDC dc;
- dc.CreateCompatibleDC(NULL);
+ dc.CreateCompatibleDC(nullptr);
CBitmap * pdcOldBmp = dc.SelectObject(&bmp);
drawdc->BitBlt(nXDest,nYDest,nWidth, nHeight, &dc,0,0,SRCCOPY);
// reset DCs
AfxFindResourceHandle(MAKEINTRESOURCE(nResourceId),RT_BITMAP);
HRSRC hRsrc =
::FindResource(hInst,MAKEINTRESOURCE(nResourceId),RT_BITMAP);
- if (hRsrc == NULL){
- hInst = NULL;
+ if (hRsrc == nullptr){
+ hInst = nullptr;
hRsrc = ::FindResource(hInst,MAKEINTRESOURCE(nResourceId),RT_BITMAP);
}
- if (hRsrc == NULL)return NULL;
+ if (hRsrc == nullptr)
+ return nullptr;
// determine how many colors in the bitmap
HGLOBAL hglb;
- if ((hglb = LoadResource(hInst, hRsrc)) == NULL)
- return NULL;
+ if ((hglb = LoadResource(hInst, hRsrc)) == nullptr)
+ return nullptr;
LPBITMAPINFOHEADER lpBitmap = (LPBITMAPINFOHEADER)LockResource(hglb);
- if (lpBitmap == NULL)return NULL;
+ if (lpBitmap == nullptr)
+ return nullptr;
WORD numcol = NumBitmapColors(lpBitmap);
::FreeResource(hglb);
- if(numcol!=16)return(NULL);
+ if(numcol!=16)
+ return nullptr;
return AfxLoadSysColorBitmap(hInst, hRsrc, FALSE);
}
public:
CExconverterMLang()
- : m_pmlang(NULL)
- , m_hLibMLang(NULL)
+ : m_pmlang(nullptr)
+ , m_hLibMLang(nullptr)
, m_mlangcookie(0)
{
}
const WORD wSourceLangId = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
CLanguageSelect::CLanguageSelect()
-: m_hCurrentDll(0)
+: m_hCurrentDll(nullptr)
, m_wCurLanguage(wSourceLangId)
, m_codepage(0)
{
void CLanguageSelect::SetIndicators(CStatusBar &sb, const UINT *rgid, int n) const
{
HGDIOBJ hf = (HGDIOBJ)sb.SendMessage(WM_GETFONT);
- CClientDC dc(0);
+ CClientDC dc(nullptr);
if (hf)
hf = dc.SelectObject(hf);
if (n)
CFont m_font;
public:
- CMDITabBar() : m_bInSelchange(false), m_pMainFrame(NULL), m_bMouseTracking(false), m_bCloseButtonDown(false), m_bAutoMaxWidth(true), m_nDraggingTabItemIndex(-1) {}
+ CMDITabBar() : m_bInSelchange(false), m_pMainFrame(nullptr), m_bMouseTracking(false), m_bCloseButtonDown(false), m_bAutoMaxWidth(true), m_nDraggingTabItemIndex(-1) {}
virtual ~CMDITabBar() {}
BOOL Create(CMDIFrameWnd* pParentWnd);
void UpdateTabs();
return CSize(0, 0);
CSize sz(hmWidth,hmHeight);
if (pDC==NULL) {
- CWindowDC dc(NULL);
+ CWindowDC dc(nullptr);
dc.HIMETRICtoDP(&sz); // convert to pixels
} else {
pDC->HIMETRICtoDP(&sz);
// move the focus to the first dlg ctrl
if (bAndFocus)
{
- CWnd* pCtrl = pPage->GetNextDlgTabItem(NULL);
+ CWnd* pCtrl = pPage->GetNextDlgTabItem(nullptr);
if (pCtrl)
pCtrl->SetFocus();
* @brief Default constructor.
*/
CRegKeyEx::CRegKeyEx()
-: m_hKey(NULL)
+: m_hKey(nullptr)
{
}
*/
LONG CRegKeyEx::WriteDword(LPCTSTR pszKey, DWORD dwVal)
{
- assert(m_hKey);
- assert(pszKey);
+ assert(m_hKey != nullptr);
+ assert(pszKey != nullptr);
return RegSetValueEx(m_hKey, pszKey, 0L, REG_DWORD,
(const LPBYTE) &dwVal, sizeof(DWORD));
}
*/
LONG CRegKeyEx::WriteBool(LPCTSTR pszKey, bool bVal)
{
- assert(m_hKey);
- assert(pszKey);
+ assert(m_hKey != nullptr);
+ assert(pszKey != nullptr);
DWORD dwVal = (DWORD)bVal;
return RegSetValueEx(m_hKey, pszKey, 0L, REG_DWORD,
(const LPBYTE) &dwVal, sizeof(DWORD));
*/
LONG CRegKeyEx::WriteFloat(LPCTSTR pszKey, float fVal)
{
- assert(m_hKey);
- assert(pszKey);
+ assert(m_hKey != nullptr);
+ assert(pszKey != nullptr);
String s = strutils::to_str(fVal);
return RegSetValueEx(m_hKey, pszKey, 0L, REG_SZ,
(const LPBYTE) s.c_str(), static_cast<DWORD>((s.length() + 1))*sizeof(TCHAR) );
*/
LONG CRegKeyEx::WriteString(LPCTSTR pszKey, LPCTSTR pszData)
{
- assert(m_hKey);
- assert(pszKey);
- assert(pszData);
+ assert(m_hKey != nullptr);
+ assert(pszKey != nullptr);
+ assert(pszData != nullptr);
return RegSetValueEx(m_hKey, pszKey, 0L, REG_SZ,
(const LPBYTE) pszData, static_cast<DWORD>(_tcslen(pszData)+ 1)*sizeof(TCHAR));
*/
DWORD CRegKeyEx::ReadDword(LPCTSTR pszKey, DWORD defval)
{
- assert(m_hKey);
- assert(pszKey);
+ assert(m_hKey != nullptr);
+ assert(pszKey != nullptr);
DWORD dwType;
DWORD dwSize = sizeof (DWORD);
*/
float CRegKeyEx::ReadFloat(LPCTSTR pszKey, float defval)
{
- assert(m_hKey);
- assert(pszKey);
+ assert(m_hKey != nullptr);
+ assert(pszKey != nullptr);
DWORD dwType;
DWORD dwSize = 100;
*/
bool CRegKeyEx::ReadBool(LPCTSTR pszKey, bool defval)
{
- assert(m_hKey);
- assert(pszKey);
+ assert(m_hKey != nullptr);
+ assert(pszKey != nullptr);
DWORD dwType;
DWORD dwSize = sizeof(DWORD);
*/
String CRegKeyEx::ReadString (LPCTSTR pszKey, LPCTSTR defval)
{
- assert(m_hKey);
- assert(pszKey);
+ assert(m_hKey != nullptr);
+ assert(pszKey != nullptr);
DWORD dwType;
DWORD dwSize = 0;
*/
void CRegKeyEx::ReadChars (LPCTSTR pszKey, LPTSTR pData, DWORD dwLen, LPCTSTR defval)
{
- assert(m_hKey);
- assert(pszKey);
+ assert(m_hKey != nullptr);
+ assert(pszKey != nullptr);
DWORD dwType;
DWORD len = dwLen;
#endif
CShellContextMenu::CShellContextMenu(UINT cmdFirst, UINT cmdLast)
-: m_pPreferredMenu(NULL)
-, m_pShellContextMenu2(NULL)
-, m_pShellContextMenu3(NULL)
-, m_hShellContextMenu(NULL)
+: m_pPreferredMenu(nullptr)
+, m_pShellContextMenu2(nullptr)
+, m_pShellContextMenu3(nullptr)
+, m_hShellContextMenu(nullptr)
, m_cmdFirst(cmdFirst)
, m_cmdLast(cmdLast)
{
// (HMENU)hMenu = (HMENU)lpDrawItem->hwndItem;
// TRACE(_T(" hMenu == 0x%p\n"), hMenu);
//}
- //assert(0);
+ //assert(false);
}
}
else if (m_pShellContextMenu2)
if (FAILED(/*hr = */m_pShellContextMenu2->HandleMenuMsg(message, wParam, lParam)))
{
//TRACE(_T("HandleMenuMsg(%x) failed with error: %lx\n"), message, hr);
- //assert(0);
+ //assert(false);
}
}
// indicate that we've processed the message
if (FAILED(/*hr = */m_pShellContextMenu3->HandleMenuMsg2(message, wParam, lParam, &retval)))
{
//TRACE(_T("HandleMenuMsg2(%x) failed with error: %lx\n"), message, hr);
- //assert(0);
+ //assert(false);
}
return true;
}
: m_bOneToOneMapping(false)
, m_function(0)
, m_flags(0)
- , m_parentWindow(NULL)
+ , m_parentWindow(nullptr)
, m_isCanceled(false)
{
}
HIMAGELIST CSuperComboBox::m_himlSystem = NULL;
CSuperComboBox::CSuperComboBox()
- : m_pDropHandler(NULL)
+ : m_pDropHandler(nullptr)
{
m_bEditChanged = false;
m_bDoComplete = false;
_AFX_THREAD_STATE* pState = AfxGetThreadState();
if (!pState->m_bNeedTerm)
{
- SCODE sc = ::OleInitialize(NULL);
+ SCODE sc = ::OleInitialize(nullptr);
if (FAILED(sc))
AfxMessageBox(_T("OLE initialization failed. Make sure that the OLE libraries are the correct version"));
else
/////////////
UniMemFile::UniMemFile()
- : m_hMapping(NULL)
- , m_base(NULL)
- , m_data(NULL)
- , m_current(NULL)
+ : m_hMapping(nullptr)
+ , m_base(nullptr)
+ , m_data(nullptr)
+ , m_current(nullptr)
{
}
{
m_base = 0;
}
- m_data = NULL;
- m_current = NULL;
- if (m_hMapping != NULL)
+ m_data = nullptr;
+ m_current = nullptr;
+ if (m_hMapping != nullptr)
{
delete m_hMapping;
- m_hMapping = NULL;
+ m_hMapping = nullptr;
}
}
*/
bool UniMemFile::WriteString(const String & line)
{
- assert(0); // unimplemented -- currently cannot write to a UniMemFile!
+ assert(false); // unimplemented -- currently cannot write to a UniMemFile!
return false;
}
/////////////
UniStdioFile::UniStdioFile()
- : m_fp(0)
+ : m_fp(nullptr)
, m_data(0)
, m_ucrbuff(128)
{
bool UniStdioFile::ReadString(String & line, bool * lossy)
{
- assert(0); // unimplemented -- currently cannot read from a UniStdioFile!
+ assert(false); // unimplemented -- currently cannot read from a UniStdioFile!
return false;
}
bool UniStdioFile::ReadString(String & line, String & eol, bool * lossy)
{
- assert(0); // unimplemented -- currently cannot read from a UniStdioFile!
+ assert(false); // unimplemented -- currently cannot read from a UniStdioFile!
return false;
}
*/
void CVersionInfo::QueryValue(LPCTSTR szId, String& s)
{
- assert(m_pVffInfo != NULL);
+ assert(m_pVffInfo != nullptr);
LPTSTR lpVersion; // String pointer to 'version' text
UINT uVersionLen;
bool bRetCode;
{
public:
storageForPlugins()
- : m_bstr(NULL)
+ : m_bstr(nullptr)
, m_bOriginalIsUnicode(false)
, m_bCurrentIsUnicode(false)
, m_bCurrentIsFile(false)
m_bActive = false;
CDC dc;
- dc.CreateCompatibleDC(NULL);
+ dc.CreateCompatibleDC(nullptr);
m_sFontFace = (::EnumFontFamilies(dc.m_hDC,
_T("Tahoma"), (FONTENUMPROC) EnumFontFamProc, 0) == 0) ?
int m_nDirs; /**< number of directories to compare */
struct ThreadState
{
- ThreadState() : m_nHitCount(0), m_pDiffItem(NULL) {}
+ ThreadState() : m_nHitCount(0), m_pDiffItem(nullptr) {}
Poco::AtomicCounter m_nHitCount;
const DIFFITEM *m_pDiffItem;
};
FileWriteString(GetCompilerVersion());
LPCTSTR szCmdLine = ::GetCommandLine();
- assert(szCmdLine != NULL);
+ assert(szCmdLine != nullptr);
// Skip the quoted executable file name.
- if (szCmdLine != NULL)
+ if (szCmdLine != nullptr)
{
szCmdLine = _tcschr(szCmdLine, '"');
- if (szCmdLine != NULL)
+ if (szCmdLine != nullptr)
{
szCmdLine += 1; // skip the opening quote.
szCmdLine = _tcschr(szCmdLine, '"');
- if (szCmdLine != NULL)
+ if (szCmdLine != nullptr)
{
szCmdLine += 1; // skip the closing quote.
}
void CDiffContext::FetchPluginInfos(const String& filteredFilenames,
PackingInfo ** infoUnpacker, PrediffingInfo ** infoPrediffer)
{
- assert(m_piPluginInfos);
+ assert(m_piPluginInfos != nullptr);
m_piPluginInfos->FetchPluginInfos(filteredFilenames, infoUnpacker, infoPrediffer);
}
/** @brief Clear inf structure to pristine */
void DiffFileData::Reset()
{
- assert(m_inf);
+ assert(m_inf != nullptr);
// If diffutils put data in, have it cleanup
if (m_used)
{
static DIFFITEM emptyitem; /**< singleton to represent a diffitem that doesn't have any data */
- DIFFITEM() : parent(NULL), nidiffs(-1), nsdiffs(-1), customFlags1(0) { }
+ DIFFITEM() : parent(nullptr), nidiffs(-1), nsdiffs(-1), customFlags1(0) { }
~DIFFITEM();
bool isEmpty() const { return this == &emptyitem; }
*/
void DiffItemList::SetDiffStatusCode(uintptr_t diffpos, unsigned diffcode, unsigned mask)
{
- assert(diffpos);
+ assert(diffpos != NULL);
DIFFITEM & di = GetDiffRefAt(diffpos);
- assert(! ((~mask) & diffcode) ); // make sure they only set flags in their mask
+ assert( ((~mask) & diffcode) == 0 ); // make sure they only set flags in their mask
di.diffcode.diffcode &= (~mask); // remove current data
di.diffcode.diffcode |= diffcode; // add new data
}
*/
void DiffItemList::SetDiffCounts(uintptr_t diffpos, unsigned diffs, unsigned ignored)
{
- assert(diffpos);
+ assert(diffpos != NULL);
DIFFITEM & di = GetDiffRefAt(diffpos);
di.nidiffs = ignored; // see StoreDiffResult() in DirScan.cpp
di.nsdiffs = diffs;
*/
unsigned DiffItemList::GetCustomFlags1(uintptr_t diffpos) const
{
- assert(diffpos);
+ assert(diffpos != NULL);
const DIFFITEM & di = GetDiffAt(diffpos);
return di.customFlags1;
}
*/
void DiffItemList::SetCustomFlags1(uintptr_t diffpos, unsigned flag)
{
- assert(diffpos);
+ assert(diffpos != NULL);
DIFFITEM & di = GetDiffRefAt(diffpos);
di.customFlags1 = flag;
}
}
else
{
- assert(0);
+ assert(false);
return NULL;
}
}
* @brief Default constructor.
*/
CDiffThread::CDiffThread()
-: m_pDiffContext(NULL)
+: m_pDiffContext(nullptr)
, m_bAborting(false)
, m_bPaused(false)
, m_pDiffParm(new DiffFuncStruct)
Poco::Semaphore *pSemaphore; /**< Semaphore for synchronizing threads. */
DiffFuncStruct()
- : context(NULL)
+ : context(nullptr)
, nThreadState(0/*CDiffThread::THREAD_NOTSTARTED*/)
- , m_pAbortgate(NULL)
+ , m_pAbortgate(nullptr)
, bOnlyRequested(false)
- , pSemaphore(NULL)
+ , pSemaphore(nullptr)
{}
};
//////////////////////////////////////////////////////////////////////
CDiffViewBar::CDiffViewBar()
-: m_hwndFrame(NULL)
+: m_hwndFrame(nullptr)
{
}
*/
void CDiffWrapper::GetOptions(DIFFOPTIONS *options) const
{
- assert(options);
+ assert(options != nullptr);
DIFFOPTIONS tmpOptions = {0};
m_options.GetAsDiffOptions(tmpOptions);
*options = tmpOptions;
*/
void CDiffWrapper::SetOptions(const DIFFOPTIONS *options)
{
- assert(options);
+ assert(options != nullptr);
m_options.SetFromDiffOptions(*options);
}
*/
void CDiffWrapper::SetPatchOptions(const PATCHOPTIONS *options)
{
- assert(options);
+ assert(options != nullptr);
m_options.m_contextLines = options->nContext;
switch (options->outputStyle)
{
if (thisob->match0>=0)
{
- assert(thisob->inserted);
+ assert(thisob->inserted > 0);
for (int i=0; i<thisob->inserted; ++i)
{
int line0 = i+thisob->match0 + (trans_a0-first0-1);
}
if (thisob->match1>=0)
{
- assert(thisob->deleted);
+ assert(thisob->deleted > 0);
for (int i=0; i<thisob->deleted; ++i)
{
int line0 = i+thisob->line0 + (trans_a0-first0-1);
{
if (thisob->match0>=0)
{
- assert(thisob->inserted);
+ assert(thisob->inserted > 0);
for (int i=0; i<thisob->inserted; ++i)
{
int line0 = i+thisob->match0 + (trans_a0-first0-1);
}
if (thisob->match1>=0)
{
- assert(thisob->deleted);
+ assert(thisob->deleted > 0);
for (int i=0; i<thisob->deleted; ++i)
{
int line0 = i+thisob->line0 + (trans_a0-first0-1);
// Someone could figure out these pieces and probably simplify this.
// Update DIFFITEM code (comparison result)
- assert(! ((~mask) & diffcode) ); // make sure they only set flags in their mask
+ assert( ((~mask) & diffcode) == 0 ); // make sure they only set flags in their mask
di.diffcode.diffcode &= (~mask); // remove current data
di.diffcode.diffcode |= diffcode; // add new data
* @brief Constructor.
*/
DirCmpReport::DirCmpReport(const std::vector<String> & colRegKeys)
-: m_pList(NULL)
-, m_pFile(NULL)
+: m_pList(nullptr)
+, m_pFile(nullptr)
, m_nColumns(0)
, m_colRegKeys(colRegKeys)
, m_sSeparator(_T(","))
-, m_pFileCmpReport(NULL)
+, m_pFileCmpReport(nullptr)
, m_bIncludeFileCmpReport(false)
, m_bOutputUTF8(false)
{
*/
bool DirCmpReport::GenerateReport(String &errStr)
{
- assert(m_pList != NULL);
- assert(m_pFile == NULL);
+ assert(m_pList != nullptr);
+ assert(m_pFile == nullptr);
bool bRet = false;
DirCmpReportDlg dlg;
DirCompProgressBar::DirCompProgressBar()
: m_bCompareReady(false)
, m_prevState(CompareStats::STATE_IDLE)
-, m_pCompareStats(NULL)
+, m_pCompareStats(nullptr)
#ifdef __ITaskbarList3_INTERFACE_DEFINED__
-, m_pTaskbarList(NULL)
+, m_pTaskbarList(nullptr)
#endif
{
}
if (m_pDirView)
m_pDirView->UpdateResources();
- SetTitle(NULL);
+ SetTitle(nullptr);
Redisplay();
}
m_pCompareStats->Swap(idx1, idx2);
for (int nIndex = 0; nIndex < m_nDirs; nIndex++)
UpdateHeaderPath(nIndex);
- SetTitle(NULL);
+ SetTitle(nullptr);
}
bool CDirDoc::MoveableToNextDiff()
IMPLEMENT_DYNCREATE(CDirFrame, CMDIChildWnd)
CDirFrame::CDirFrame()
-: m_hIdentical(NULL)
-, m_hDifferent(NULL)
+: m_hIdentical(nullptr)
+, m_hDifferent(nullptr)
{
}
{
if (col < 0 || col >= countof(f_cols))
{
- assert(0); // fix caller, should not ask for nonexistent columns
- return 0;
+ assert(false); // fix caller, should not ask for nonexistent columns
+ return nullptr;
}
return &f_cols[col];
}
{
if (col < 0 || col >= countof(f_cols3))
{
- assert(0); // fix caller, should not ask for nonexistent columns
- return 0;
+ assert(false); // fix caller, should not ask for nonexistent columns
+ return nullptr;
}
return &f_cols3[col];
}
{
if (col < 0 || col >= countof(f_cols))
{
- assert(0); // fix caller, should not ask for nonexistent columns
+ assert(false); // fix caller, should not ask for nonexistent columns
return false;
}
return f_cols[col].idName == idname;
{
if (col < 0 || col >= sizeof(f_cols3)/sizeof(f_cols3[0]))
{
- assert(0); // fix caller, should not ask for nonexistent columns
+ assert(false); // fix caller, should not ask for nonexistent columns
return false;
}
return f_cols3[col].idName == idname;
const DirColInfo * pColInfo = GetDirColInfo(col);
if (!pColInfo)
{
- assert(0); // fix caller, should not ask for nonexistent columns
- return 0;
+ assert(false); // fix caller, should not ask for nonexistent columns
+ return false;
}
return pColInfo->defSortUp;
}
const DirColInfo * pColInfo = GetDirColInfo(col);
if (!pColInfo)
{
- assert(0); // fix caller, should not ask for nonexistent columns
+ assert(false); // fix caller, should not ask for nonexistent columns
return _T("???");
}
ColGetFncPtrType fnc = pColInfo->getfnc;
const DirColInfo * pColInfo = GetDirColInfo(col);
if (!pColInfo)
{
- assert(0); // fix caller, should not ask for nonexistent columns
+ assert(false); // fix caller, should not ask for nonexistent columns
return 0;
}
size_t offset = pColInfo->offset;
, m_bHasMoveOperations(false)
, m_bHasRenameOperations(false)
, m_bHasDelOperations(false)
-, m_hParentWindow(NULL)
+, m_hParentWindow(nullptr)
, m_pCopyOperations(new ShellFileOperations())
, m_pMoveOperations(new ShellFileOperations())
, m_pRenameOperations(new ShellFileOperations())
explicit PackingInfo(PLUGIN_MODE bMode = (PLUGIN_MODE)FileTransform::g_bUnpackerMode)
: PluginForFile(bMode)
, subcode(0)
- , pufile(0)
+ , pufile(nullptr)
, disallowMixedEOL(false)
{
}
* @brief Constructor.
*/
FilterList::FilterList()
-: m_lastMatchExpression(NULL)
+: m_lastMatchExpression(nullptr)
{
}
* @brief Constructor, initializes members.
*/
CGhostTextView::CGhostTextView()
-: m_pGhostTextBuffer(NULL)
+: m_pGhostTextBuffer(nullptr)
, m_nTopSubLinePushed(0)
{
}
* @brief Constructor.
*/
CHexMergeDoc::CHexMergeDoc()
-: m_pDirDoc(NULL)
+: m_pDirDoc(nullptr)
{
m_nBuffers = m_nBuffersTemp;
m_filePaths.SetSize(m_nBuffers);
- std::fill_n(m_pView, m_nBuffers, static_cast<CHexMergeView *>(NULL));
+ std::fill_n(m_pView, m_nBuffers, static_cast<CHexMergeView *>(nullptr));
std::fill_n(m_nBufferType, m_nBuffers, BUFFER_NORMAL);
}
sText.insert(0, _T("* "));
pf->GetHeaderInterface()->SetText(pane, sText);
- SetTitle(NULL);
+ SetTitle(nullptr);
}
// CHexMergeFrame construction/destruction
CHexMergeFrame::CHexMergeFrame()
-: m_hIdentical(NULL)
-, m_hDifferent(NULL)
+: m_hIdentical(nullptr)
+, m_hDifferent(nullptr)
{
std::fill_n(m_nLastSplitPos, 2, 0);
m_pMergeDoc = 0;
* @brief Constructor.
*/
CHexMergeView::CHexMergeView()
-: m_pif(0)
+: m_pif(nullptr)
, m_nThisPane(0)
{
}
std::string ret;\r
if (ImageList_GetImageInfo(hImageList, iconIndex, &imageInfo))\r
{\r
- HDC hdcMem = CreateCompatibleDC(NULL);\r
+ HDC hdcMem = CreateCompatibleDC(nullptr);\r
BITMAPINFO bmpinfo = { 0 };\r
bmpinfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);\r
int w = imageInfo.rcImage.right - imageInfo.rcImage.left;\r
// CImgMergeFrame construction/destruction
CImgMergeFrame::CImgMergeFrame()
-: m_hIdentical(NULL)
-, m_hDifferent(NULL)
-, m_pDirDoc(NULL)
+: m_hIdentical(nullptr)
+, m_hDifferent(nullptr)
+, m_pDirDoc(nullptr)
, m_bAutoMerged(false)
-, m_pImgMergeWindow(NULL)
-, m_pImgToolWindow(NULL)
+, m_pImgMergeWindow(nullptr)
+, m_pImgToolWindow(nullptr)
{
std::fill_n(m_nLastSplitPos, 2, 0);
std::fill_n(m_nBufferType, 3, BUFFER_NORMAL);
m_strDesc[pane] = strDesc ? strDesc[pane] : _T("");
m_nBufferType[pane] = (!strDesc || strDesc[pane].empty()) ? BUFFER_NORMAL : BUFFER_NORMAL_NAMED;
}
- SetTitle(NULL);
+ SetTitle(nullptr);
LPCTSTR lpszWndClass = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW,
LoadCursor(NULL, IDC_ARROW), (HBRUSH)(COLOR_WINDOW+1), NULL);
*/
LineFiltersDlg::LineFiltersDlg()
: CTrPropertyPage(LineFiltersDlg::IDD)
-, m_pList(NULL)
+, m_pList(nullptr)
{
//{{AFX_DATA_INIT(LineFiltersDlg)
m_bIgnoreRegExp = FALSE;
* @brief Default constructor.
*/
LineFiltersList::LineFiltersList()
-: m_pOptionsMgr(NULL)
+: m_pOptionsMgr(nullptr)
{
}
*/
void LineFiltersList::Initialize(COptionsMgr *pOptionsMgr)
{
- assert(pOptionsMgr);
+ assert(pOptionsMgr != nullptr);
String valuename(FiltersRegPath);
m_pOptionsMgr = pOptionsMgr;
*/
void LineFiltersList::SaveFilters()
{
- assert(m_pOptionsMgr);
+ assert(m_pOptionsMgr != nullptr);
String valuename(FiltersRegPath);
size_t count = m_items.size();
//////////////////////////////////////////////////////////////////////
CLocationBar::CLocationBar()
-: m_hwndFrame(NULL)
+: m_hwndFrame(nullptr)
{
}
*/
CMainFrame::CMainFrame()
: m_bFirstTime(true)
-, m_pDropHandler(NULL)
+, m_pDropHandler(nullptr)
, m_bShowErrors(false)
{
}
CMergeApp::CMergeApp() :
m_bNeedIdleTimer(false)
-, m_pOpenTemplate(0)
-, m_pDiffTemplate(0)
-, m_pHexMergeTemplate(0)
-, m_pDirTemplate(0)
-, m_mainThreadScripts(NULL)
+, m_pOpenTemplate(nullptr)
+, m_pDiffTemplate(nullptr)
+, m_pHexMergeTemplate(nullptr)
+, m_pDirTemplate(nullptr)
+, m_mainThreadScripts(nullptr)
, m_nLastCompareResult(0)
, m_bNonInteractive(false)
, m_pOptions(new CRegOptionsMgr())
break;
default:
// no other valid option
- assert (0);
+ assert (false);
ucr::setDefaultCodepage(GetACP());
}
}
struct Merge7zFormatMergePluginImpl : public Merge7z::Format
{
- Merge7zFormatMergePluginImpl() : m_plugin(NULL) {}
+ Merge7zFormatMergePluginImpl() : m_plugin(nullptr) {}
virtual HRESULT DeCompressArchive(HWND, LPCTSTR path, LPCTSTR folder);
virtual HRESULT CompressArchive(HWND, LPCTSTR path, Merge7z::DirItemEnumerator *);
virtual Inspector *Open(HWND, LPCTSTR);
CMergeDoc::CMergeDoc()
: m_bEnableRescan(true)
, m_nCurDiff(-1)
-, m_pDirDoc(NULL)
+, m_pDirDoc(nullptr)
, m_bMixedEol(false)
, m_pInfoUnpacker(new PackingInfo)
, m_pEncodingErrorBar(nullptr)
, m_nThisPane(0)
, m_nThisGroup(0)
, m_bDetailView(false)
-, m_piMergeEditStatus(0)
+, m_piMergeEditStatus(nullptr)
, m_bAutomaticRescan(false)
, fTimerWaitingForIdle(0)
, m_lineBegin(0)
*/
void SetDefaults(COptionsMgr *pOptionsMgr)
{
- HDC hDC = GetDC(NULL);
+ HDC hDC = GetDC(nullptr);
const int logPixelsY = GetDeviceCaps(hDC, LOGPIXELSY);
// *****
// Build a new LOGFONT with values from the 'actual' values of the in-memory Options::Font table.
// The Registry is not accessed.
LOGFONT lfnew = { 0 };
- HDC hDC = GetDC(NULL);
+ HDC hDC = GetDC(nullptr);
lfnew.lfHeight = -MulDiv(pOptionsMgr->GetInt(name + OPT_FONT_POINTSIZE), GetDeviceCaps(hDC, LOGPIXELSY), 72);
if (lfnew.lfHeight == 0)
lfnew.lfHeight = pOptionsMgr->GetInt(name + OPT_FONT_HEIGHT);
{
// Store LOGFONT values into both the 'actual' value of the in-memory Options::Font table, and
// into the appropriate Registry entries.
- HDC hDC = GetDC(NULL);
+ HDC hDC = GetDC(nullptr);
pOptionsMgr->SaveOption(name + OPT_FONT_USECUSTOM, bUseCustom);
pOptionsMgr->SaveOption(name + OPT_FONT_POINTSIZE, -MulDiv(lf->lfHeight, 72, GetDeviceCaps(hDC, LOGPIXELSY)));
pOptionsMgr->SaveOption(name + OPT_FONT_HEIGHT, lf->lfHeight);
m_sel = (pPathContext->GetSize() == 0) ? -1 : 0;
}
- PathContextIterator() : m_pPathContext(NULL), m_sel(-1)
+ PathContextIterator() : m_pPathContext(nullptr), m_sel(-1)
{
}
for (size_t i = 0 ; i < m_aAvailableThreads.size() ; i++)
if (m_aAvailableThreads[i] && m_aAvailableThreads[i]->m_nThreadId == nThreadId)
return m_aAvailableThreads[i];
- assert(0);
+ assert(false);
return NULL;
}
CScriptsOfThread * CAllThreadsScripts::GetActiveSetNoAssert()
static void ShowPluginErrorMessage(IDispatch *piScript, LPTSTR description)
{
PluginInfo * pInfo = CAllThreadsScripts::GetActiveSet()->GetPluginInfo(piScript);
- assert(pInfo != NULL);
- assert(description != NULL);
+ assert(pInfo != nullptr);
+ assert(description != nullptr);
AppErrorMessageBox(strutils::format(_T("%s: %s"), pInfo->m_name.c_str(), description));
}
PropRegistry::PropRegistry(COptionsMgr *optionsMgr)
: OptionsPanel(optionsMgr, PropRegistry::IDD)
-, m_bUseRecycleBin(TRUE)
+, m_bUseRecycleBin(true)
, m_tempFolderType(0)
{
}
);
CMarkdown::CMarkdown(const char *upper, const char *ahead, unsigned flags):
-first(0), lower(0), upper(upper), ahead(ahead),
+first(nullptr), lower(nullptr), upper(upper), ahead(ahead),
memcmp(flags & IgnoreCase ? ::_memicmp : ::memcmp),
utags(flags & HtmlUTags ? htmlUTags : NULL)
{
}
CMarkdown::FileImage::FileImage(const TCHAR *path, size_t trunc, unsigned flags)
-: pImage(NULL), cbImage(0), nByteOrder(0), m_pSharedMemory(NULL), pCopy(NULL)
+: pImage(nullptr), cbImage(0), nByteOrder(0), m_pSharedMemory(nullptr), pCopy(nullptr)
{
if (flags & Mapping)
{