OSDN Git Service

Cppcheck: Unused variable: *
authorsdottaka <none@none>
Sun, 21 Apr 2013 11:36:04 +0000 (20:36 +0900)
committersdottaka <none@none>
Sun, 21 Apr 2013 11:36:04 +0000 (20:36 +0900)
Cppcheck: Variable * is assigned a value that is never used.

16 files changed:
Src/Common/UniFile.cpp
Src/Common/multiformatText.cpp
Src/Common/unicoder.cpp
Src/DiffTextBuffer.cpp
Src/DiffWrapper.cpp
Src/DirView.cpp
Src/FileActionScript.cpp
Src/FolderCmp.cpp
Src/HexMergeDoc.cpp
Src/IntToIntMap.h
Src/LocationView.cpp
Src/MergeDoc.cpp
Src/OpenView.cpp
Src/VSSHelper.cpp
Src/paths.cpp
Src/stringdiffs.cpp

index ff6f6ab..00ea2a6 100644 (file)
@@ -442,7 +442,6 @@ bool UniMemFile::ReadString(String & line, String & eol, bool * lossy)
        line.erase();
        eol.erase();
        const TCHAR * pchLine = (const TCHAR *)m_current;
-       String localLine;
        
        // shortcut methods in case file is in the same encoding as our Strings
 
index 5c868f4..c27efbf 100644 (file)
@@ -583,10 +583,6 @@ bool AnyCodepageToUTF8(int codepage, const String& filepath, const String& filep
                        break;
                }
 
-               // first pass : get the size of the destination file
-               size_t nSizeBOM = (bWriteBOM) ? 3 : 0;
-               size_t nDstSize = nBufSize * 2;
-
                const size_t minbufsize = 128 * 1024;
 
                // create the destination file
index b7ab5d6..5f2147f 100644 (file)
@@ -753,7 +753,6 @@ int CrossConvert(const char* src, unsigned srclen, char* dest, unsigned destsize
 
        // Now convert to TCHAR (which means defcodepage)
        flags = WC_NO_BEST_FIT_CHARS; // TODO: Think about this
-       wlen = n;
        BOOL defaulted = FALSE;
        BOOL * pdefaulted = &defaulted;
        if (cpout == CP_UTF8)
index c2692b2..234b221 100644 (file)
@@ -395,8 +395,10 @@ int CDiffTextBuffer::LoadFromFile(LPCTSTR pszFileNameInit,
                String eol, preveol;
                String sline;
                bool done = false;
+#ifdef _DEBUG
                UINT next_line_report = 100; // for trace messages
                UINT next_line_multiple = 5; // for trace messages
+#endif
                COleDateTime start = COleDateTime::GetCurrentTime(); // for trace messages
 
                // Manually grow line array exponentially
index 8b5971c..bfb3aac 100644 (file)
@@ -830,7 +830,6 @@ bool CDiffWrapper::RunFileDiff()
        // diff_2_files set bin_flag to +1 if same binary
 
        file_data * inf = diffdata.m_inf;
-       file_data * inf10 = diffdata10.m_inf;
        file_data * inf12 = diffdata12.m_inf;
        file_data * inf02 = diffdata02.m_inf;
 
index 2221cca..9c84a42 100644 (file)
@@ -889,7 +889,6 @@ bool CDirView::ListShellContextMenu(SIDE_TYPE side)
        shellContextMenu->Initialize();
 
        CDirDoc *pDoc = GetDocument();
-       String parentDir; // use it to track that all selected files are in the same parent directory
 
        int i = -1;
        while ((i = m_pList->GetNextItem(i, LVNI_SELECTED)) != -1)
@@ -4590,8 +4589,6 @@ void CDirView::PrepareDragData(String& filesForDroping)
  */
 void CDirView::OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult) 
 {
-       NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
-
        COleDataSource *DropData = new COleDataSource();
        String filesForDroping;
 
index 5af3f4f..819f683 100644 (file)
@@ -272,7 +272,6 @@ BOOL FileActionScript::Run()
        bool bFileOpSucceed = true;
        bool bUserCancelled = false;
        BOOL bRetVal = TRUE;
-       int apiRetVal = 0;
 
        CreateOperationsScripts();
 
index aa3a1f3..7ac884f 100644 (file)
@@ -464,7 +464,6 @@ exitPrepAndCompare:
  */
 void GetComparePaths(CDiffContext * pCtxt, const DIFFITEM &di, PathContext & files)
 {
-       static const TCHAR backslash[] = _T("\\");
        int nDirs = pCtxt->GetCompareDirs();
 
        files.SetSize(nDirs);
index 73bf3f6..5d03407 100644 (file)
@@ -281,7 +281,7 @@ BOOL CHexMergeDoc::PromptAndSaveIfNeeded(BOOL bAllowCancel)
                                switch (Try(m_pView[1]->SaveFile(pathMiddle.c_str())))
                                {
                                case 0:
-                                       bRSaveSuccess = TRUE;
+                                       bMSaveSuccess = TRUE;
                                        break;
                                case IDCANCEL:
                                        result = FALSE;
@@ -320,7 +320,7 @@ BOOL CHexMergeDoc::PromptAndSaveIfNeeded(BOOL bAllowCancel)
 
        // If file were modified and saving was successfull,
        // update status on dir view
-       if (bLSaveSuccess || bRSaveSuccess)
+       if (bLSaveSuccess || bMSaveSuccess || bRSaveSuccess)
        {
                UpdateDiffItem(m_pDirDoc);
        }
index 3f6a8c0..6473f4f 100644 (file)
@@ -25,8 +25,6 @@ public:
        {
                int max=0;
                int maxKey=0;
-               int key=0;
-               int n=0;
                std::map<int, int>::const_iterator pos = m_map.begin();
                while (pos != m_map.end())
                {
index 090865e..1dcdb16 100644 (file)
@@ -954,7 +954,6 @@ void CLocationView::UpdateVisiblePos(int nTopLine, int nBottomLine)
 {
        if (m_bDrawn)
        {
-               static int prevsublinecount[3] = {0};
                CMergeDoc *pDoc = GetDocument();
                int pane;
                IF_IS_TRUE_ALL(m_nSubLineCount[pane] == m_view[pane]->GetSubLineCount(), pane, pDoc->m_nBuffers)
index 1f55839..f2a00bd 100644 (file)
@@ -1022,9 +1022,6 @@ bool CMergeDoc::ListCopy(int srcPane, int dstPane, int nDiff /* = -1*/,
                int limit = cd_dend;
 
                // curView is the view which is changed, so the opposite of the source view
-               CCrystalTextView* srcView = m_pView[srcPane];
-               CCrystalTextView* dstView = m_pView[dstPane];
-
                dbuf.BeginUndoGroup(bGroupWithPrevious);
                if (cd_blank>=0)
                {
index 406d0f6..21c28ed 100644 (file)
@@ -801,7 +801,6 @@ void COpenView::OnSelectFilter()
 BOOL COpenView::LoadProjectFile(const String &path)
 {
        String filterPrefix = theApp.LoadString(IDS_FILTER_PREFIX);
-       String err;
        ProjectFile prj;
 
        if (!theApp.LoadProjectFile(path, prj))
index 823114e..1007bd8 100644 (file)
@@ -175,7 +175,6 @@ void VSSHelper::GetFullVSSPath(const String& strSavePath, bool & bVCProj)
        String ext;
        String path;
        paths_SplitFilename(strSavePath, &path, NULL, &ext);
-       String spath(path);
        String strExt = string_makelower(ext); 
        if (strExt == _T("vcproj"))
                bVCProj = true;
index 6bfaf5a..7201422 100644 (file)
@@ -313,7 +313,6 @@ bool paths_CreateIfNeeded(const String& szPath)
        }
        // Now fullPath holds our desired path
 
-       String sLong;
        TCHAR *ptr = fullPath;
        TCHAR *end = NULL;
 
index 9deb8ba..7b6e9a9 100644 (file)
@@ -152,7 +152,7 @@ sd_ComputeWordDiffs(int nFiles, const String str[3],
                }
                else
                {
-                       std::vector<wdiff> diffs10, diffs12, diffs02;
+                       std::vector<wdiff> diffs10, diffs12;
                        stringdiffs sdiffs10(str[1], str[0], case_sensitive, whitespace, breakType, &diffs10);
                        stringdiffs sdiffs12(str[1], str[2], case_sensitive, whitespace, breakType, &diffs12);
                        // Hash all words in both lines and then compare them word by word
@@ -240,8 +240,6 @@ stringdiffs::BuildWordDiffList_DP()
        //      return false;
        onp(edscript);
 
-       const int iSize1 = (int)m_words1.size();
-       const int iSize2 = (int)m_words2.size();
        int i = 1, j = 1;
        for (size_t k = 0; k < edscript.size(); k++)
        {