DWORD type = 0;
DWORD size = 0;
int retVal = COption::OPT_OK;
- auto [strPath, strValueName] = SplitName(strName);
+ [[maybe_unused]] auto [strPath, strValueName] = SplitName(strName);
// Get type and size of value in registry
retValReg = RegQueryValueEx(hKey, strValueName.c_str(), 0, &type,
// open input file
bool success = conflictFile.OpenReadOnly(conflictFileName);
+ if (!success)
+ return false;
// Create output files
bool success2 = workingCopy.Open(workingCopyFileName, _T("wb"));
+ if (!success2)
+ return false;
bool success3 = newRevision.Open(newRevisionFileName, _T("wb"));
+ if (!success3)
+ return false;
bool success4 = baseRevision.Open(baseRevisionFileName, _T("wb"));
+ if (!success4)
+ return false;
// detect codepage of conflict file
FileTextEncoding encoding = codepage_detect::Guess(conflictFileName, iGuessEncodingType);
m_pDirView = newView;
// MFC has a view list for us, so lets check against it
POSITION pos = GetFirstViewPosition();
- CDirView * temp = static_cast<CDirView *>(GetNextView(pos));
- ASSERT(temp == m_pDirView); // verify that our stashed pointer is the same as MFC's
+ ASSERT(m_pDirView == static_cast<CDirView *>(GetNextView(pos))); // verify that our stashed pointer is the same as MFC's
}
/**
bm.Attach(LoadBitmapAndConvertTo32bit(AfxGetInstanceHandle(), nIDResource, nNewWidth * nCount, nNewHeight, bGrayscale, RGB(0xff, 0, 0xff)));
VERIFY(ImgList.Create(nNewWidth, nNewHeight, ILC_COLOR32, nCount, 0));
- int nIndex = ImgList.Add(&bm, nullptr);
- ASSERT(-1 != nIndex);
+ ASSERT(-1 != ImgList.Add(&bm, nullptr));
}
/**
{
PluginInfo* pluginFound = nullptr;
String pluginName;
- auto [suggestedPlugins, allPlugins] = FileTransform::CreatePluginMenuInfos(_T(""), events, baseId);
+ [[maybe_unused]] auto [suggestedPlugins, allPlugins] = FileTransform::CreatePluginMenuInfos(_T(""), events, baseId);
for (const auto& [processType, pluginList] : allPlugins)
{
for (const auto& [caption, name, id, plugin] : pluginList)
int CMergeDoc::m_nBuffersTemp = 2;
-static void SaveBuffForDiff(CDiffTextBuffer & buf, const String& filepath, int nStartLine = 0, int nLines = -1);
+static int SaveBuffForDiff(CDiffTextBuffer & buf, const String& filepath, int nStartLine = 0, int nLines = -1);
/////////////////////////////////////////////////////////////////////////////
// CMergeDoc
* (the plugins are optional, not the conversion)
* @todo Show SaveToFile() errors?
*/
-static void SaveBuffForDiff(CDiffTextBuffer & buf, const String& filepath, int nStartLine, int nLines)
+static int SaveBuffForDiff(CDiffTextBuffer & buf, const String& filepath, int nStartLine, int nLines)
{
// and we don't repack the file
PackingInfo tempPacker(false);
// write buffer out to temporary file
String sError;
- int retVal = buf.SaveToFile(filepath, true, sError, tempPacker,
+ return buf.SaveToFile(filepath, true, sError, tempPacker,
CRLFSTYLE::AUTOMATIC, false, nStartLine, nLines);
}
DWORD dwFlags[3] = { 0 };
PathContext paths = m_filePaths;
String strDesc[3];
- int nBuffers = m_nBuffers;
PackingInfo infoUnpacker(m_infoUnpacker.GetPluginPipeline());
for (int pane = 0; pane < m_nBuffers; pane++)
void CMergeEditView::OnUpdateAllLeft(CCmdUI* pCmdUI)
{
// Check that left side is not readonly
- auto [srcPane, dstPane] = CMergeFrameCommon::MenuIDtoXY(pCmdUI->m_nID, m_nThisPane, GetDocument()->m_nBuffers);
+ [[maybe_unused]] auto [srcPane, dstPane] = CMergeFrameCommon::MenuIDtoXY(pCmdUI->m_nID, m_nThisPane, GetDocument()->m_nBuffers);
if (!IsReadOnly(dstPane))
pCmdUI->Enable(GetDocument()->m_diffList.HasSignificantDiffs());
else
void CMergeEditView::OnUpdateAllRight(CCmdUI* pCmdUI)
{
// Check that right side is not readonly
- auto [srcPane, dstPane] = CMergeFrameCommon::MenuIDtoXY(pCmdUI->m_nID, m_nThisPane, GetDocument()->m_nBuffers);
+ [[maybe_unused]] auto [srcPane, dstPane] = CMergeFrameCommon::MenuIDtoXY(pCmdUI->m_nID, m_nThisPane, GetDocument()->m_nBuffers);
if (!IsReadOnly(dstPane))
pCmdUI->Enable(GetDocument()->m_diffList.HasSignificantDiffs());
else
auto& wndSplitter = dynamic_cast<CMergeEditFrame *>(GetParentFrame())->GetSplitter();
CMergeDoc *pDoc = GetDocument();
- CMergeEditView *pView = pDoc->GetView(0, m_nThisPane);
int nBuffer = m_nThisPane;
if (pDoc->m_nGroups <= 2)
{