Skip to content

Commit

Permalink
Reduce C style casts
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Strickroth <email@cs-ware.de>
  • Loading branch information
csware committed Aug 18, 2016
1 parent 5c34d7f commit 59eda4d
Show file tree
Hide file tree
Showing 46 changed files with 94 additions and 97 deletions.
2 changes: 1 addition & 1 deletion src/Git/GitIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ int CGitHeadFileList::CallBack(const unsigned char *sha1, const char *base, int
{
#define S_IFGITLINK 0160000

CGitHeadFileList *p = (CGitHeadFileList*)context;
CGitHeadFileList* p = reinterpret_cast<CGitHeadFileList*>(context);

if ((mode & S_IFDIR) && (mode & S_IFMT) != S_IFGITLINK)
return READ_TREE_RECURSIVE;
Expand Down
8 changes: 4 additions & 4 deletions src/ResText/ResModule.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// TortoiseGit - a Windows shell extension for easy version control

// Copyright (C) 2015 - TortoiseGit
// Copyright (C) 2015-2016 - TortoiseGit
// Copyright (C) 2003-2008, 2010-2016 - TortoiseSVN

// This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -2045,7 +2045,7 @@ BOOL CResModule::ReplaceRibbon(LPCTSTR lpszType, WORD wLanguage)

BOOL CALLBACK CResModule::EnumResNameCallback(HMODULE /*hModule*/, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR lParam)
{
CResModule* lpResModule = (CResModule*)lParam;
auto lpResModule = reinterpret_cast<CResModule*>(lParam);

if (lpszType == RT_STRING)
{
Expand Down Expand Up @@ -2095,15 +2095,15 @@ BOOL CALLBACK CResModule::EnumResNameCallback(HMODULE /*hModule*/, LPCTSTR lpszT
#pragma warning(disable: 4189)
BOOL CALLBACK CResModule::EnumResNameWriteCallback(HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR lParam)
{
CResModule* lpResModule = (CResModule*)lParam;
auto lpResModule = reinterpret_cast<CResModule*>(lParam);
return EnumResourceLanguages(hModule, lpszType, lpszName, (ENUMRESLANGPROC)&lpResModule->EnumResWriteLangCallback, lParam);
}
#pragma warning(pop)

BOOL CALLBACK CResModule::EnumResWriteLangCallback(HMODULE /*hModule*/, LPCTSTR lpszType, LPTSTR lpszName, WORD wLanguage, LONG_PTR lParam)
{
BOOL bRes = FALSE;
CResModule* lpResModule = (CResModule*)lParam;
auto lpResModule = reinterpret_cast<CResModule*>(lParam);

if (lpszType == RT_STRING)
{
Expand Down
2 changes: 1 addition & 1 deletion src/TGitCache/DirectoryWatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ bool CDirectoryWatcher::IsPathWatched(const CTGitPath& path)

unsigned int CDirectoryWatcher::ThreadEntry(void* pContext)
{
((CDirectoryWatcher*)pContext)->WorkerThread();
reinterpret_cast<CDirectoryWatcher*>(pContext)->WorkerThread();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/TGitCache/FolderCrawler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void CFolderCrawler::ReleasePathForUpdate(const CTGitPath& path)

unsigned int CFolderCrawler::ThreadEntry(void* pContext)
{
((CFolderCrawler*)pContext)->WorkerThread();
reinterpret_cast<CFolderCrawler*>(pContext)->WorkerThread();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/TGitCache/ShellUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void CShellUpdater::AddPathForUpdate(const CTGitPath& path)

unsigned int CShellUpdater::ThreadEntry(void* pContext)
{
((CShellUpdater*)pContext)->WorkerThread();
reinterpret_cast<CShellUpdater*>(pContext)->WorkerThread();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/TortoiseGitBlame/PropertiesWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void CPropertiesWnd::UpdateProperties(GitRevLoglist* pRev)

RemoveParent();

CLogDataVector *pLogEntry = &((CMainFrame*)AfxGetApp()->GetMainWnd())->m_wndOutput.m_LogList.m_logEntries;
CLogDataVector* pLogEntry = &static_cast<CMainFrame*>(AfxGetApp()->GetMainWnd())->m_wndOutput.m_LogList.m_logEntries;

CGitHashMap & hashMap = pLogEntry->m_pLogCache->m_HashMap;
for (size_t i = 0; i < pRev->m_ParentHash.size(); ++i)
Expand Down
6 changes: 1 addition & 5 deletions src/TortoiseGitBlame/TortoiseGitBlameDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,9 @@ BOOL CTortoiseGitBlameDoc::OnOpenDocument(LPCTSTR lpszPathName,CString Rev)
{
CWnd* pWnd = GetMainFrame()->GetDescendantWindow(AFX_IDW_PANE_FIRST, TRUE);
if (pWnd && pWnd->IsKindOf(RUNTIME_CLASS(CTortoiseGitBlameView)))
{
pView = (CTortoiseGitBlameView*)pWnd;
}
pView = static_cast<CTortoiseGitBlameView*>(pWnd);
else
{
return FALSE;
}
}
pView->ParseBlame();

Expand Down
4 changes: 2 additions & 2 deletions src/TortoiseGitBlame/TortoiseGitBlameDoc.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// TortoiseGit - a Windows shell extension for easy version control

// Copyright (C) 2008-2011,2013 - TortoiseGit
// Copyright (C) 2008-2011, 2013, 2016 - TortoiseGit

// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -63,7 +63,7 @@ class CTortoiseGitBlameDoc : public CDocument
#endif
CMainFrame *GetMainFrame()
{
return (CMainFrame*)AfxGetApp()->GetMainWnd();
return reinterpret_cast<CMainFrame*>(AfxGetApp()->GetMainWnd());
}

protected:
Expand Down
4 changes: 2 additions & 2 deletions src/TortoiseGitBlame/TortoiseGitBlameView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,7 @@ void CTortoiseGitBlameView::OnViewDetectMovedOrCopiedLines(DWORD dwDetectMovedOr

theApp.WriteInt(_T("DetectMovedOrCopiedLines"), m_dwDetectMovedOrCopiedLines);

CTortoiseGitBlameDoc *document = (CTortoiseGitBlameDoc *) m_pDocument;
auto document = static_cast<CTortoiseGitBlameDoc*>(m_pDocument);
if (!document->m_CurrentFileName.IsEmpty())
{
document->m_lLine = (int)SendEditor(SCI_GETFIRSTVISIBLELINE) + 1;
Expand Down Expand Up @@ -2002,7 +2002,7 @@ void CTortoiseGitBlameView::OnUpdateViewDetectMovedOrCopiedLinesToggleFromExisti
void CTortoiseGitBlameView::ReloadDocument()
{
theApp.DoWaitCursor(1);
CTortoiseGitBlameDoc *document = (CTortoiseGitBlameDoc *) m_pDocument;
auto document = static_cast<CTortoiseGitBlameDoc*>(m_pDocument);
if (!document->m_CurrentFileName.IsEmpty())
{
document->m_lLine = (int)SendEditor(SCI_GETFIRSTVISIBLELINE) + 1;
Expand Down
2 changes: 1 addition & 1 deletion src/TortoiseIDiff/NiceTrackbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

LRESULT CALLBACK CNiceTrackbar::NiceTrackbarProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
CNiceTrackbar* self = (CNiceTrackbar*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
auto self = reinterpret_cast<CNiceTrackbar*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));

switch (message) {
case WM_LBUTTONDOWN:
Expand Down
6 changes: 3 additions & 3 deletions src/TortoiseMerge/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContex
TRACE0("Failed to create first pane\n");
return FALSE;
}
m_pwndBottomView = (CBottomView *)m_wndSplitter.GetPane(1,0);
m_pwndBottomView = static_cast<CBottomView*>(m_wndSplitter.GetPane(1, 0));
m_pwndBottomView->m_pwndLocator = &m_wndLocatorBar;
m_pwndBottomView->m_pwndLineDiffBar = &m_wndLineDiffBar;
if (m_bUseRibbons)
Expand All @@ -552,7 +552,7 @@ BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContex
TRACE0("Failed to create second pane\n");
return FALSE;
}
m_pwndLeftView = (CLeftView *)m_wndSplitter2.GetPane(0,0);
m_pwndLeftView = static_cast<CLeftView*>(m_wndSplitter2.GetPane(0, 0));
m_pwndLeftView->m_pwndLocator = &m_wndLocatorBar;
m_pwndLeftView->m_pwndLineDiffBar = &m_wndLineDiffBar;
if (m_bUseRibbons)
Expand All @@ -567,7 +567,7 @@ BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContex
TRACE0("Failed to create third pane\n");
return FALSE;
}
m_pwndRightView = (CRightView *)m_wndSplitter2.GetPane(0,1);
m_pwndRightView = static_cast<CRightView*>(m_wndSplitter2.GetPane(0, 1));
m_pwndRightView->m_pwndLocator = &m_wndLocatorBar;
m_pwndRightView->m_pwndLineDiffBar = &m_wndLineDiffBar;
if (m_bUseRibbons)
Expand Down
2 changes: 1 addition & 1 deletion src/TortoiseMerge/MovedBlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ LineToGroupMap::~LineToGroupMap()

tsvn_svn_diff_t_extension * CreateDiffExtension(svn_diff_t * base, apr_pool_t * pool)
{
tsvn_svn_diff_t_extension * ext = (tsvn_svn_diff_t_extension *)apr_palloc(pool, sizeof(tsvn_svn_diff_t_extension));
auto ext = static_cast<tsvn_svn_diff_t_extension*>(apr_palloc(pool, sizeof(tsvn_svn_diff_t_extension)));
ext->next = NULL;
ext->moved_to = -1;
ext->moved_from = -1;
Expand Down
9 changes: 5 additions & 4 deletions src/TortoisePlink/LoginDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// TortoiseSVN - a Windows shell extension for easy version control
// TortoiseGit - a Windows shell extension for easy version control

// Copyright (C) 2013, 2016 - TortoiseGit
// Copyright (C) 2003, 2013 - TortoiseSVN

// This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -62,7 +63,7 @@ BOOL CALLBACK LoginDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
if (uMsg == WM_INITDIALOG)
{
LoginDialog* pDlg = (LoginDialog*) lParam;
auto pDlg = reinterpret_cast<LoginDialog*>(lParam);
pDlg->_hdlg = hwndDlg;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
// Set prompt text
Expand All @@ -79,14 +80,14 @@ BOOL CALLBACK LoginDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
else if (uMsg == WM_COMMAND && LOWORD(wParam) == IDCANCEL && HIWORD(wParam) == BN_CLICKED)
{
LoginDialog* pDlg = (LoginDialog*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
auto pDlg = reinterpret_cast<LoginDialog*>(GetWindowLongPtr(hwndDlg, GWLP_USERDATA));
pDlg->myOK = false;
EndDialog(hwndDlg, IDCANCEL);
return 1;
}
else if (uMsg == WM_COMMAND && LOWORD(wParam) == IDOK && HIWORD(wParam) == BN_CLICKED)
{
LoginDialog* pDlg = (LoginDialog*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
auto pDlg = reinterpret_cast<LoginDialog*>(GetWindowLongPtr(hwndDlg, GWLP_USERDATA));
pDlg->myOK = true;
pDlg->RetrieveValues();
EndDialog(hwndDlg, IDOK);
Expand Down
2 changes: 1 addition & 1 deletion src/TortoiseProc/AddDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void CAddDlg::OnBnClickedSelectall()

UINT CAddDlg::AddThreadEntry(LPVOID pVoid)
{
return ((CAddDlg*)pVoid)->AddThread();
return reinterpret_cast<CAddDlg*>(pVoid)->AddThread();
}

UINT CAddDlg::AddThread()
Expand Down
6 changes: 3 additions & 3 deletions src/TortoiseProc/BrowseRefsDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ class CRefLeafListCompareFunc

static int CALLBACK StaticCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
return ((CRefLeafListCompareFunc*)lParamSort)->Compare(lParam1,lParam2);
return reinterpret_cast<CRefLeafListCompareFunc*>(lParamSort)->Compare(lParam1, lParam2);
}

int Compare(LPARAM lParam1, LPARAM lParam2)
{
return Compare(
(CShadowTree*)m_pList->GetItemData((int)lParam1),
(CShadowTree*)m_pList->GetItemData((int)lParam2));
reinterpret_cast<CShadowTree*>(m_pList->GetItemData((int)lParam1)),
reinterpret_cast<CShadowTree*>(m_pList->GetItemData((int)lParam2)));
}

int Compare(const CShadowTree* pLeft, const CShadowTree* pRight)
Expand Down
2 changes: 1 addition & 1 deletion src/TortoiseProc/ChangedDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ BOOL CChangedDlg::OnInitDialog()

UINT CChangedDlg::ChangedStatusThreadEntry(LPVOID pVoid)
{
return ((CChangedDlg*)pVoid)->ChangedStatusThread();
return reinterpret_cast<CChangedDlg*>(pVoid)->ChangedStatusThread();
}

UINT CChangedDlg::ChangedStatusThread()
Expand Down
4 changes: 2 additions & 2 deletions src/TortoiseProc/CheckForUpdatesDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void CCheckForUpdatesDlg::OnCancel()

UINT CCheckForUpdatesDlg::CheckThreadEntry(LPVOID pVoid)
{
return ((CCheckForUpdatesDlg*)pVoid)->CheckThread();
return reinterpret_cast<CCheckForUpdatesDlg*>(pVoid)->CheckThread();
}

UINT CCheckForUpdatesDlg::CheckThread()
Expand Down Expand Up @@ -669,7 +669,7 @@ void CCheckForUpdatesDlg::OnBnClickedButtonUpdate()

UINT CCheckForUpdatesDlg::DownloadThreadEntry(LPVOID pVoid)
{
return ((CCheckForUpdatesDlg*)pVoid)->DownloadThread();
return reinterpret_cast<CCheckForUpdatesDlg*>(pVoid)->DownloadThread();
}

bool CCheckForUpdatesDlg::VerifyUpdateFile(const CString& filename, const CString& filenameSignature, const CString& reportingFilename)
Expand Down
2 changes: 1 addition & 1 deletion src/TortoiseProc/ChooseVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CChooseVersion
CWinThread* m_pLoadingThread;
static UINT LoadingThreadEntry(LPVOID pVoid)
{
return ((CChooseVersion*)pVoid)->LoadingThread();
return reinterpret_cast<CChooseVersion*>(pVoid)->LoadingThread();
};
volatile LONG m_bLoadingThreadRunning;

Expand Down
2 changes: 1 addition & 1 deletion src/TortoiseProc/Commands/CleanupCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static bool GetSubmodulePathList(SubmodulePayload &payload);

static int SubmoduleCallback(git_submodule *sm, const char * /*name*/, void *payload)
{
auto spayload = (SubmodulePayload *)payload;
auto spayload = reinterpret_cast<SubmodulePayload*>(payload);
CString path = CUnicodeUtils::GetUnicode(git_submodule_path(sm));
CString fullPath(spayload->basePath);
fullPath += _T("\\");
Expand Down
2 changes: 1 addition & 1 deletion src/TortoiseProc/CommitIsOnRefsDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void CCommitIsOnRefsDlg::StartGetRefsThread()

UINT CCommitIsOnRefsDlg::GetRefsThreadEntry(LPVOID pVoid)
{
return ((CCommitIsOnRefsDlg*)pVoid)->GetRefsThread();
return reinterpret_cast<CCommitIsOnRefsDlg*>(pVoid)->GetRefsThread();
}

UINT CCommitIsOnRefsDlg::GetRefsThread()
Expand Down
4 changes: 2 additions & 2 deletions src/TortoiseProc/FileDiffDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ BOOL CFileDiffDlg::OnInitDialog()

UINT CFileDiffDlg::DiffThreadEntry(LPVOID pVoid)
{
return ((CFileDiffDlg*)pVoid)->DiffThread();
return reinterpret_cast<CFileDiffDlg*>(pVoid)->DiffThread();
}

UINT CFileDiffDlg::DiffThread()
Expand Down Expand Up @@ -1290,7 +1290,7 @@ int CFileDiffDlg::RevertSelectedItemToVersion(CString rev)
while ((index = m_cFileList.GetNextSelectedItem(pos)) >= 0)
{
CString cmd, out;
CTGitPath *fentry = (CTGitPath *)m_arFilteredList[index];
CTGitPath* fentry = m_arFilteredList[index];
cmd.Format(_T("git.exe checkout %s -- \"%s\""), (LPCTSTR)rev, (LPCTSTR)fentry->GetGitPathString());
if (g_Git.Run(cmd, &out, CP_UTF8))
{
Expand Down
2 changes: 1 addition & 1 deletion src/TortoiseProc/FileDiffDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class CFileDiffDlg : public CResizableStandAloneDialog

static UINT LoadRefThreadEntry(LPVOID pVoid)
{
return ((CFileDiffDlg *)pVoid)->LoadRefThread();
return reinterpret_cast<CFileDiffDlg*>(pVoid)->LoadRefThread();
};

UINT LoadRefThread();
Expand Down
20 changes: 9 additions & 11 deletions src/TortoiseProc/GitLogCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ ULONGLONG CLogCache::GetOffset(const CGitHash& hash, SLogCacheIndexFile* pData)
if (!pData)
return 0;

SLogCacheIndexItem *p=(SLogCacheIndexItem *)bsearch(hash.m_hash,pData->m_Item,
SLogCacheIndexItem* p=reinterpret_cast<SLogCacheIndexItem*>(bsearch(hash.m_hash, pData->m_Item,
pData->m_Header.m_ItemCount,
sizeof(SLogCacheIndexItem),
Compare);
Compare));

if(p)
return p->m_Offset;
Expand Down Expand Up @@ -145,7 +145,7 @@ int CLogCache::FetchCacheIndex(CString GitDir)

if (!m_pCacheIndex)
{
m_pCacheIndex = (SLogCacheIndexFile*)MapViewOfFile(m_IndexFileMap,FILE_MAP_READ,0,0,0);
m_pCacheIndex = reinterpret_cast<SLogCacheIndexFile*>(MapViewOfFile(m_IndexFileMap, FILE_MAP_READ, 0, 0, 0));
if (!m_pCacheIndex)
break;
}
Expand Down Expand Up @@ -192,7 +192,7 @@ int CLogCache::FetchCacheIndex(CString GitDir)
break;
}

if(!CheckHeader( (SLogCacheDataFileHeader*)m_pCacheData))
if (!CheckHeader(reinterpret_cast<SLogCacheDataFileHeader*>(m_pCacheData)))
break;

if (m_DataFileLength < sizeof(SLogCacheDataFileHeader) + m_pCacheIndex->m_Header.m_ItemCount * sizeof(SLogCacheDataFileHeader))
Expand Down Expand Up @@ -275,8 +275,7 @@ int CLogCache::LoadOneItem(GitRevLoglist& Rev,ULONGLONG offset)
if (offset + sizeof(SLogCacheRevItemHeader) > m_DataFileLength)
return -2;

SLogCacheRevItemHeader *header;
header = (SLogCacheRevItemHeader *)(this->m_pCacheData + offset);
SLogCacheRevItemHeader* header = reinterpret_cast<SLogCacheRevItemHeader*>(m_pCacheData + offset);

if( !CheckHeader(header))
return -2;
Expand All @@ -285,7 +284,7 @@ int CLogCache::LoadOneItem(GitRevLoglist& Rev,ULONGLONG offset)
SLogCacheRevFileHeader *fileheader;

offset += sizeof(SLogCacheRevItemHeader);
fileheader =(SLogCacheRevFileHeader *)(this->m_pCacheData + offset);
fileheader = reinterpret_cast<SLogCacheRevFileHeader*>(m_pCacheData + offset);

for (DWORD i = 0; i < header->m_FileCount; ++i)
{
Expand Down Expand Up @@ -329,7 +328,7 @@ int CLogCache::LoadOneItem(GitRevLoglist& Rev,ULONGLONG offset)
Rev.m_Files.AddPath(path);

offset += sizeof(*fileheader) + fileheader->m_OldFileNameSize*sizeof(TCHAR) + fileheader->m_FileNameSize*sizeof(TCHAR) - sizeof(TCHAR);
fileheader = (SLogCacheRevFileHeader *) (this->m_pCacheData + offset);
fileheader = reinterpret_cast<SLogCacheRevFileHeader*>(m_pCacheData + offset);
}
return 0;
}
Expand Down Expand Up @@ -377,8 +376,7 @@ int CLogCache::SaveCache()
SLogCacheIndexFile* pIndex = nullptr;
if(this->m_pCacheIndex)
{
pIndex = (SLogCacheIndexFile *)malloc(sizeof(SLogCacheIndexFile)
+sizeof(SLogCacheIndexItem) * (m_pCacheIndex->m_Header.m_ItemCount) );
pIndex = reinterpret_cast<SLogCacheIndexFile*>(malloc(sizeof(SLogCacheIndexFile) + sizeof(SLogCacheIndexItem) * (m_pCacheIndex->m_Header.m_ItemCount)));
if (!pIndex)
return -1;

Expand Down Expand Up @@ -483,7 +481,7 @@ int CLogCache::SaveCache()
if(m_IndexFileMap == INVALID_HANDLE_VALUE)
break;

m_pCacheIndex = (SLogCacheIndexFile*)MapViewOfFile(m_IndexFileMap,FILE_MAP_WRITE,0,0,0);
m_pCacheIndex = reinterpret_cast<SLogCacheIndexFile*>(MapViewOfFile(m_IndexFileMap, FILE_MAP_WRITE, 0, 0, 0));
if (!m_pCacheIndex)
break;

Expand Down
Loading

0 comments on commit 59eda4d

Please sign in to comment.