Changeset dffce7f97154…
Parent 25e30a8d371a…
by
Changes to 28 files · Browse files at dffce7f97154 Showing diff from parent 25e30a8d371a Diff from another changeset...
@@ -125,10 +125,10 @@ ;
-void CTortoiseHgCmenuBase::AddMenuList(UINT idCmd, const CString& name)
+void CTortoiseHgCmenuBase::AddMenuList(UINT idCmd, const CString& strName)
{
- ATLTRACE("AddMenuList: idCmd = %d, name = '%s'\n", idCmd, name);
- m_mapMenuId[idCmd] = m_mapMenuDesc[name];
+ ATLTRACE("AddMenuList: idCmd = %d, name = '%s'\n", idCmd, strName);
+ m_mapMenuId[idCmd] = m_mapMenuDesc[strName];
}
@@ -159,16 +159,16 @@ RegCloseKey(hkey);
}
-void CTortoiseHgCmenuBase::InitMenuMaps(const CMenuDescription *menuDescs, int sz)
+void CTortoiseHgCmenuBase::InitMenuMaps(const CMenuDescription *pMenuDescs, int nCount)
{
if (m_mapMenuDesc.IsEmpty())
{
CString lang;
GetRegistryConfig("CMenuLang", lang);
- for (int i = 0; i < sz; i++)
+ for (int i = 0; i < nCount; i++)
{
- CMenuDescription md = menuDescs[i];
+ CMenuDescription md = pMenuDescs[i];
if (md.name.IsEmpty())
{
@@ -286,21 +286,21 @@}
-void CTortoiseHgCmenuBase::InsertMenuItemByName(HMENU hMenu, const CString& name, UINT indexMenu,
- UINT idCmd, UINT idCmdFirst, const CStringW& prefix)
+void CTortoiseHgCmenuBase::InsertMenuItemByName(HMENU hMenu, const CString& strName, UINT indexMenu,
+ UINT idCmd, UINT idCmdFirst, const CStringW& strPrefix)
{
- const CMenuDescriptionMap::CPair* pPair = m_mapMenuDesc.Lookup(name);
+ const CMenuDescriptionMap::CPair* pPair = m_mapMenuDesc.Lookup(strName);
if (pPair == NULL)
{
- ATLTRACE("***** InsertMenuItemByName: can't find menu info for '%s'\n", (LPCTSTR)name);
+ ATLTRACE("***** InsertMenuItemByName: can't find menu info for '%s'\n", (LPCTSTR)strName);
return;
}
const CMenuDescription& md = pPair->m_value;
- AddMenuList(idCmd - idCmdFirst, name);
+ AddMenuList(idCmd - idCmdFirst, strName);
InsertMenuItemWithIcon1(
- hMenu, indexMenu, idCmd, prefix + md.menuText, md.iconName);
+ hMenu, indexMenu, idCmd, strPrefix + md.menuText, md.iconName);
}
@@ -741,7 +741,7 @@}
-void CTortoiseHgCmenuBase::RunDialog(const CString& cmd)
+void CTortoiseHgCmenuBase::RunDialog(const CString& strCmd)
{
CString dir = GetTHgProgRoot();
if (dir.IsEmpty())
@@ -765,7 +765,7 @@ else
FindClose(hfind);
- hgcmd = Quote(hgcmd) + " --nofork " + cmd;
+ hgcmd = Quote(hgcmd) + " --nofork " + strCmd;
CString cwd;
if (!m_strFolder.IsEmpty())
@@ -782,7 +782,7 @@ return;
}
- if (cmd == "thgstatus")
+ if (strCmd == "thgstatus")
{
if (CTHgStatus::Remove(cwd) != 0)
{
|
@@ -24,14 +24,14 @@ CMenuDescriptionMap m_mapMenuDesc;
CMenuIdCmdMap m_mapMenuId;
- virtual void RunDialog(const CString& cmd);
+ virtual void RunDialog(const CString& strCmd);
- void TweakMenuForVista(HMENU menu);
+ void TweakMenuForVista(HMENU hMenu);
void PrintDebugHeader(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj);
- void InitMenuMaps(const CMenuDescription *menuDescs, int sz);
- void InsertMenuItemByName(HMENU hMenu, const CString& name, UINT indexMenu,
- UINT idCmd, UINT idCmdFirst, const CStringW& prefix);
- void AddMenuList(UINT idCmd, const CString& name);
+ void InitMenuMaps(const CMenuDescription *pMenuDescs, int nCount);
+ void InsertMenuItemByName(HMENU hMenu, const CString& strName, UINT indexMenu,
+ UINT idCmd, UINT idCmdFirst, const CStringW& strPrefix);
+ void AddMenuList(UINT idCmd, const CString& strName);
public:
CTortoiseHgCmenuBase();
|
@@ -69,13 +69,13 @@ }
-void CTortoiseHgDropHandler::RunDialog(const CString& cmd)
+void CTortoiseHgDropHandler::RunDialog(const CString& strCmd)
{
- if (cmd == "drag_move" || cmd == "drag_copy") {
+ if (strCmd == "drag_move" || strCmd == "drag_copy") {
//Append the current directory as the dest
m_arrFiles.Add(m_strFolder);
}
- CTortoiseHgCmenuBase::RunDialog(cmd);
+ CTortoiseHgCmenuBase::RunDialog(strCmd);
}
|
@@ -10,7 +10,7 @@ {
protected:
- virtual void RunDialog(const CString& cmd);
+ virtual void RunDialog(const CString& strCmd);
public:
CTortoiseHgDropHandler();
|
@@ -70,8 +70,8 @@ }
-CTortoiseHgOverlay::CTortoiseHgOverlay(char tortoiseClass) :
- m_chTortoiseClass(tortoiseClass)
+CTortoiseHgOverlay::CTortoiseHgOverlay(char chClass) :
+ m_chTortoiseClass(chClass)
{
}
|
@@ -10,7 +10,7 @@ const char m_chTortoiseClass;
protected:
- explicit CTortoiseHgOverlay(char Class);
+ explicit CTortoiseHgOverlay(char chClass);
BEGIN_COM_MAP(CTortoiseHgOverlay)
COM_INTERFACE_ENTRY(IShellIconOverlayIdentifier)
|
|
|
@@ -23,15 +23,16 @@ #include "Winstat.h"
-CDirectory::CDirectory(CDirectory* p, const CString& n, const CString& basepath) :
- m_pParent(p), m_strName(n)
+CDirectory::CDirectory(CDirectory* pParent, const CString& strName,
+ const CString& strBasePath) :
+ m_pParent(pParent), m_strName(strName)
{
- if (n.IsEmpty())
- m_strPath = basepath;
- else if (basepath.IsEmpty())
- m_strPath = n;
+ if (strName.IsEmpty())
+ m_strPath = strBasePath;
+ else if (strBasePath.IsEmpty())
+ m_strPath = strName;
else
- m_strPath = basepath + '/' + n;
+ m_strPath = strBasePath + '/' + strName;
}
@@ -68,7 +69,7 @@}
-int CDirectory::Add(CString n, CDirentry& e)
+int CDirectory::Add(CString strName, CDirentry& rEntry)
{
CString base;
CString rest;
@@ -78,16 +79,16 @@ for (;;)
{
- if (!SplitBase(n, base, rest)) {
- ATLTRACE("CDirectory('%s')::add(%d): splitbase returned 0\n",
- (LPCTSTR)Path(), (LPCTSTR)n);
+ if (!SplitBase(strName, base, rest)) {
+ ATLTRACE("CDirectory('%s')::Add(%d): splitbase returned 0\n",
+ (LPCTSTR)Path(), (LPCTSTR)strName);
return 0;
}
if (base.IsEmpty())
{
- e.m_strName = n;
- cur->m_listFiles.AddTail(e);
+ rEntry.m_strName = strName;
+ cur->m_listFiles.AddTail(rEntry);
return 1;
}
@@ -108,13 +109,13 @@ cur->m_listSubdirs.AddTail(d);
}
- n = rest;
+ strName = rest;
cur = d;
}
}
-const CDirentry* CDirectory::Get(CString n) const
+const CDirentry* CDirectory::Get(CString strRelPath) const
{
CString base;
CString rest;
@@ -125,10 +126,10 @@ {
loopstart:
- if (!SplitBase(n, base, rest))
+ if (!SplitBase(strRelPath, base, rest))
{
- ATLTRACE("CDirectory('%s')::get(%d): splitbase returned 0\n",
- (LPCTSTR)Path(), n);
+ ATLTRACE("CDirectory('%s')::Get(%d): splitbase returned 0\n",
+ (LPCTSTR)Path(), (LPCTSTR)strRelPath);
return 0;
}
@@ -138,7 +139,7 @@ while (position != NULL)
{
const CDirentry& rItem = cur->m_listFiles.GetNext(position);
- if (rItem.m_strName == n)
+ if (rItem.m_strName == strRelPath)
return &rItem;
}
return 0;
@@ -151,7 +152,7 @@ if (pItem->m_strName == base)
{
cur = pItem;
- n = rest;
+ strRelPath = rest;
goto loopstart;
}
}
@@ -161,7 +162,7 @@}
-CDirectory* CDirectory::GetDir(CString n)
+CDirectory* CDirectory::GetDir(CString strRelPath)
{
CString base;
CString rest;
@@ -172,15 +173,15 @@ {
loopstart:
- if (!SplitBase(n, base, rest))
+ if (!SplitBase(strRelPath, base, rest))
{
- ATLTRACE("Directory('%s')::getdir(%d): splitbase returned 0\n",
- Path(), n);
+ ATLTRACE("Directory('%s')::getdir('%s'): splitbase returned 0\n",
+ (LPCTSTR)Path(), (LPCTSTR)strRelPath);
return 0;
}
const bool leaf = base.IsEmpty();
- const CString& searchstr = (leaf ? n : base);
+ const CString& searchstr = (leaf ? strRelPath : base);
POSITION position = cur->m_listSubdirs.GetHeadPosition();
while (position != NULL)
@@ -191,7 +192,7 @@ if (leaf)
return pItem;
cur = pItem;
- n = rest;
+ strRelPath = rest;
goto loopstart;
}
}
|
@@ -30,15 +30,15 @@ CAtlList<CDirentry> m_listFiles;
public:
- CDirectory(CDirectory* p, const CString& n, const CString& basepath);
+ CDirectory(CDirectory* pParent, const CString& strName, const CString& strBasePath);
~CDirectory();
const CString& Path() const { return m_strPath; }
- int Add(CString relpath, CDirentry& e);
+ int Add(CString strRelPath, CDirentry& rEntry);
- const CDirentry* Get(CString relpath) const;
- CDirectory* GetDir(CString n);
+ const CDirentry* Get(CString strRelPath) const;
+ CDirectory* GetDir(CString strRelPath);
void Print() const;
};
|
@@ -142,18 +142,18 @@ };
-CDirectoryStatus* CDirectoryStatus::Get(
- const CString& hgroot, const CString& cwd)
+CDirectoryStatus* CDirectoryStatus::Get(const CString& strHgRoot,
+ const CString& strCwd)
{
static CCacheEntry ce;
unsigned tc = GetTickCount();
- if (ce.strHgRoot != hgroot || (tc - ce.uTickCount) > 2000)
+ if (ce.strHgRoot != strHgRoot || (tc - ce.uTickCount) > 2000)
{
ce.strHgRoot.Empty();
- ce.bReadFailed = (ce.ds.Read(hgroot, cwd) == 0);
- ce.strHgRoot = hgroot;
+ ce.bReadFailed = (ce.ds.Read(strHgRoot, strCwd) == 0);
+ ce.strHgRoot = strHgRoot;
ce.uTickCount = GetTickCount();
}
|
@@ -30,7 +30,7 @@ public:
CDirectoryStatus() : m_bNoIcons(false) {}
- static CDirectoryStatus* Get(const CString& hgroot, const CString& cwd);
+ static CDirectoryStatus* Get(const CString& strHgRoot, const CString& strCwd);
char Status(CString relpath) const;
bool NoIcons() const { return m_bNoIcons; }
|
@@ -21,28 +21,28 @@ #include "Winstat.h"
-int CDirentry::Read(FILE* f, CString& relpath)
+int CDirentry::Read(FILE* pFile, CString& strRelPath)
{
- if (fread(&m_chState, sizeof(char), 1, f) != 1)
+ if (fread(&m_chState, sizeof(char), 1, pFile) != 1)
return 0;
unsigned length = 0;
- fread(&m_uMode, sizeof(unsigned), 1, f);
- fread(&m_uSize, sizeof(unsigned), 1, f);
- fread(&m_uMTime, sizeof(unsigned), 1, f);
- fread(&length, sizeof(length), 1, f);
+ fread(&m_uMode, sizeof(unsigned), 1, pFile);
+ fread(&m_uSize, sizeof(unsigned), 1, pFile);
+ fread(&m_uMTime, sizeof(unsigned), 1, pFile);
+ fread(&length, sizeof(length), 1, pFile);
m_uMode = ntohl(m_uMode);
m_uSize = ntohl(m_uSize);
m_uMTime = ntohl(m_uMTime);
length = ntohl(length);
- LPSTR lpszBuf = relpath.GetBuffer(length);
- fread(lpszBuf, sizeof(char), length, f);
- relpath.ReleaseBuffer(length);
+ LPSTR lpszBuf = strRelPath.GetBuffer(length);
+ fread(lpszBuf, sizeof(char), length, pFile);
+ strRelPath.ReleaseBuffer(length);
- relpath = relpath.MakeLower();
+ strRelPath = strRelPath.MakeLower();
return 1;
}
@@ -53,9 +53,9 @@ switch (m_chState)
{
case 'n':
- if (m_uSize != (unsigned)stat.size)
+ if (m_uSize != (unsigned)stat.ullSize)
return 'M'; // modified
- if (m_uMTime == (unsigned)stat.mtime)
+ if (m_uMTime == (unsigned)stat.ullMTime)
return 'C'; // clean
return 'P'; // must peek into file contents
case 'm':
|
@@ -18,10 +18,7 @@ #ifndef DIRENTRY_H
#define DIRENTRY_H
-// Visual Studio has UINT32 instead of uint32_t
-#ifndef uint32_t
-#define uint32_t UINT32
-#endif
+#include <stdint.h>
class CWinstat;
@@ -35,7 +32,7 @@
CString m_strName;
- int Read(FILE* f, CString& relpath);
+ int Read(FILE* pFile, CString& strRelPath);
char Status(const CWinstat& stat) const;
bool Unset() const {
|
|
|
@@ -29,22 +29,22 @@ }
-CDirstate* CDirstateCache::Get(const CString& hgroot, const CString& cwd,
- bool& unset, bool usekbfiles)
+CDirstate* CDirstateCache::Get(const CString& strHgRoot, const CString& strCwd,
+ bool& bUnset, bool bUseKbfiles)
{
- unset = false;
+ bUnset = false;
POSITION position = Cache().GetHeadPosition();
while (position != NULL)
{
CEntry& rItem = Cache().GetAt(position);
- if (hgroot == rItem.hgroot && usekbfiles == rItem.usekbfiles)
+ if (strHgRoot == rItem.strHgRoot && bUseKbfiles == rItem.bUseKbfiles)
break;
Cache().GetNext(position);
}
CWinstat stat;
- CString path = hgroot + (usekbfiles ? "\\.hg\\kilnbfiles\\dirstate"
+ CString path = strHgRoot + (bUseKbfiles ? "\\.hg\\kilnbfiles\\dirstate"
: "\\.hg\\dirstate");
unsigned tc = GetTickCount();
@@ -63,64 +63,64 @@ if (Cache().GetCount() >= 10)
{
CEntry e = Cache().RemoveTail();
- ATLTRACE("CDirstateCache::get: dropping '%s'\n", (LPCTSTR)e.hgroot);
- delete e.dstate;
+ ATLTRACE("CDirstateCache::get: dropping '%s'\n", (LPCTSTR)e.strHgRoot);
+ delete e.pDirstate;
}
CEntry e;
- e.hgroot = hgroot;
- e.usekbfiles = usekbfiles;
- e.tickcount = tc;
+ e.strHgRoot = strHgRoot;
+ e.bUseKbfiles = bUseKbfiles;
+ e.uTickCount = tc;
Cache().AddHead(e);
position = Cache().GetHeadPosition();
}
CEntry& rItem = Cache().GetAt(position);
- if (!new_stat && tc - rItem.tickcount > 500)
+ if (!new_stat && tc - rItem.uTickCount > 500)
{
if (0 != stat.lstat(path, true))
{
ATLTRACE("CDirstateCache::get: lstat('%s') failed\n", (LPCTSTR)path);
- ATLTRACE("CDirstateCache::get: dropping '%s'\n", (LPCTSTR)rItem.hgroot);
- delete rItem.dstate;
+ ATLTRACE("CDirstateCache::get: dropping '%s'\n", (LPCTSTR)rItem.strHgRoot);
+ delete rItem.pDirstate;
Cache().RemoveAt(position);
return 0;
}
- rItem.tickcount = tc;
+ rItem.uTickCount = tc;
ATLTRACE("CDirstateCache::get: lstat('%s') ok\n", (LPCTSTR)path);
new_stat = true;
}
- if (rItem.dstate)
+ if (rItem.pDirstate)
{
- unset = rItem.unset;
+ bUnset = rItem.bUnset;
if (!new_stat)
- return rItem.dstate;
+ return rItem.pDirstate;
- if (rItem.dstate_mtime == stat.mtime
- && rItem.dstate_size == stat.size)
+ if (rItem.llMTime == stat.ullMTime
+ && rItem.llSize == stat.ullSize)
{
- return rItem.dstate;
+ return rItem.pDirstate;
}
- ATLTRACE("CDirstateCache::get: refreshing '%s'\n", hgroot);
+ ATLTRACE("CDirstateCache::get: refreshing '%s'\n", strHgRoot);
}
else
{
- ATLTRACE("CDirstateCache::get: reading '%s'\n", hgroot);
+ ATLTRACE("CDirstateCache::get: reading '%s'\n", strHgRoot);
}
- unset = false;
+ bUnset = false;
unsigned tc0 = GetTickCount();
- CAutoPtr<CDirstate> ds = CDirstate::Read(path, unset);
+ CAutoPtr<CDirstate> ds = CDirstate::Read(path, bUnset);
unsigned tc1 = GetTickCount();
bool request_thgstatus_update = true;
- if (unset)
+ if (bUnset)
{
- if (rItem.unset)
+ if (rItem.bUnset)
{
ATLTRACE("CDirstateCache::get: **** old and new have unset entries\n");
request_thgstatus_update = false;
@@ -131,46 +131,46 @@ }
}
- rItem.unset = unset;
+ rItem.bUnset = bUnset;
- delete rItem.dstate;
- rItem.dstate = ds.Detach();
+ delete rItem.pDirstate;
+ rItem.pDirstate = ds.Detach();
unsigned delta = tc1 - tc0;
ATLTRACE("CDirstateCache::get: read done in %d ticks, %d repos in cache\n",
delta, Cache().GetCount());
- rItem.dstate_mtime = stat.mtime;
- rItem.dstate_size = stat.size;
+ rItem.llMTime = stat.ullMTime;
+ rItem.llSize = stat.ullSize;
if (request_thgstatus_update)
{
ATLTRACE("CDirstateCache::get: calling Thgstatus::update\n");
- CTHgStatus::Update(cwd);
+ CTHgStatus::Update(strCwd);
}
else
{
ATLTRACE("CDirstateCache::get: omitting Thgstatus::update\n");
}
- return rItem.dstate;
+ return rItem.pDirstate;
}
-void CDirstateCache::Invalidate(const CString& hgroot, bool usekbfiles)
+void CDirstateCache::Invalidate(const CString& strHgRoot, bool bUseKbfiles)
{
- if (hgroot.IsEmpty())
+ if (strHgRoot.IsEmpty())
return;
POSITION position = Cache().GetHeadPosition();
while (position != NULL)
{
CEntry& rItem = Cache().GetAt(position);
- if (hgroot == rItem.hgroot && usekbfiles == rItem.usekbfiles)
+ if (strHgRoot == rItem.strHgRoot && bUseKbfiles == rItem.bUseKbfiles)
{
- delete rItem.dstate;
+ delete rItem.pDirstate;
Cache().RemoveAt(position);
- ATLTRACE("Dirstatecache::invalidate('%s')\n", (LPCTSTR)hgroot);
+ ATLTRACE("Dirstatecache::invalidate('%s')\n", (LPCTSTR)strHgRoot);
break;
}
}
|
@@ -24,31 +24,30 @@ {
struct CEntry
{
- CDirstate* dstate;
- __int64 dstate_mtime;
- __int64 dstate_size;
+ CDirstate* pDirstate;
+ LONGLONG llMTime;
+ LONGLONG llSize;
- CString hgroot;
- unsigned tickcount;
- bool unset;
- bool usekbfiles;
+ CString strHgRoot;
+ unsigned uTickCount;
+ bool bUnset;
+ bool bUseKbfiles;
CEntry() :
- dstate(0),
- dstate_mtime(0),
- dstate_size(0),
- tickcount(0),
- unset(false),
- usekbfiles(false)
- {}
+ pDirstate(0),
+ llMTime(0),
+ llSize(0),
+ uTickCount(0),
+ bUnset(false),
+ bUseKbfiles(false) {}
};
static CAtlList<CEntry>& Cache();
public:
- static CDirstate* Get(const CString& hgroot, const CString& cwd, bool& unset,
- bool usekbfiles = false);
- static void Invalidate(const CString& hgroot, bool usekbfiles = false);
+ static CDirstate* Get(const CString& strHgRoot, const CString& strCwd,
+ bool& bUnset, bool bUseKbfiles = false);
+ static void Invalidate(const CString& strHgRoot, bool bUseKbfiles = false);
};
#endif
|
|
|
@@ -202,42 +202,38 @@ }
-int HgQueryDirstate(
- const char cls,
- const CString& path,
- const char& filterStatus,
- char& outStatus
-)
+int HgQueryDirstate(char chClass, const CString& strPath, char chFilterStatus,
+ char& chOutStatus)
{
- CString dp = "["; dp += cls; dp += "] HgQueryDirstate: ";
+ CString dp = "["; dp += chClass; dp += "] HgQueryDirstate: ";
static QueryState last;
- if (path.IsEmpty())
+ if (strPath.IsEmpty())
return 0;
QueryState cur;
- cur.path = path;
+ cur.path = strPath;
cur.tickcount = ::GetTickCount();
const bool outdated = cur.tickcount - last.tickcount > 2000;
- if (!outdated && last.path == path)
+ if (!outdated && last.path == strPath)
{
- outStatus = last.status;
- if (outStatus == 'P')
- outStatus = 'M';
+ chOutStatus = last.status;
+ if (chOutStatus == 'P')
+ chOutStatus = 'M';
return 1;
}
- if (::PathIsRoot(path))
+ if (::PathIsRoot(strPath))
{
last = cur;
return 0;
}
- if (findHgRoot(cls, cur, last, outdated) == 0)
+ if (findHgRoot(chClass, cur, last, outdated) == 0)
return 0;
int offset = cur.hgroot.GetLength();
@@ -248,9 +244,9 @@ return 0;
}
- if (path[offset] == '\\')
+ if (strPath[offset] == '\\')
offset++;
- CString relpath = path.Mid(offset);
+ CString relpath = strPath.Mid(offset);
for (int i = 0; i < relpath.GetLength(); ++i)
{
@@ -267,8 +263,8 @@
if (relpath.IsEmpty())
{
- outStatus = (pdirsta ? pdirsta->Status(relpath) : '?');
- cur.status = outStatus;
+ chOutStatus = (pdirsta ? pdirsta->Status(relpath) : '?');
+ cur.status = chOutStatus;
cur.tickcount = ::GetTickCount();
last = cur;
return 1;
@@ -286,13 +282,13 @@ }
CWinstat stat;
- if (0 != stat.lstat(path))
+ if (0 != stat.lstat(strPath))
{
- ATLTRACE("%s lstat('%s') failed", (LPCTSTR)dp, (LPCTSTR)path);
+ ATLTRACE("%s lstat('%s') failed", (LPCTSTR)dp, (LPCTSTR)strPath);
last = cur;
return 0;
}
- cur.isdir = stat.isdir;
+ cur.isdir = stat.bIsDir;
#if 0
ATLTRACE("%s stat.lstat('%s') -> stat.isdir is %d\n" << (LPCTSTR)dp,
(LPCTSTR)cur.path, (int)stat.isdir);
@@ -311,8 +307,8 @@ }
}
- outStatus = (pdirsta ? pdirsta->Status(relpath) : '?');
- cur.status = outStatus;
+ chOutStatus = (pdirsta ? pdirsta->Status(relpath) : '?');
+ cur.status = chOutStatus;
cur.tickcount = ::GetTickCount();
last = cur;
return 1;
@@ -334,14 +330,14 @@ }
}
- outStatus = e->Status(stat);
+ chOutStatus = e->Status(stat);
if (unset)
goto exit;
bool update = false;
- if (outStatus == 'M')
+ if (chOutStatus == 'M')
{
CString relbase;
if (pdirsta && get_relpath(cur.hgroot, cur.basedir, relbase))
@@ -355,7 +351,7 @@ update = true;
}
}
- else if (outStatus == 'P')
+ else if (chOutStatus == 'P')
{
static unsigned lasttickcount;
@@ -374,13 +370,13 @@ if (update)
{
ATLTRACE("%s calling Thgstatus::Update\n", (LPCTSTR)dp);
- CTHgStatus::Update(path);
+ CTHgStatus::Update(strPath);
}
exit:
- cur.status = outStatus;
- if (outStatus == 'P')
- outStatus = 'M';
+ cur.status = chOutStatus;
+ if (chOutStatus == 'P')
+ chOutStatus = 'M';
cur.tickcount = ::GetTickCount();
last = cur;
return 1;
|
@@ -1,11 +1,7 @@ #ifndef _QUERY_DIRSTATE_H
#define _QUERY_DIRSTATE_H
-int HgQueryDirstate(
- const char myClass,
- const CString& path,
- const char& filterStatus,
- char& outStatus
-);
+int HgQueryDirstate(char chClass, const CString& strPath, char chFilterStatus,
+ char& chOutStatus);
#endif
|
@@ -1,7 +1,7 @@ #include "stdafx.h"
#include "RegistryConfig.h"
-int GetRegistryConfig(const CString& name, CString& res)
+int GetRegistryConfig(const CString& strName, CString& strRes)
{
LPCTSTR subkey = "Software\\TortoiseHg";
@@ -13,9 +13,9 @@ return 0;
DWORD cbData = MAX_PATH;
- LPTSTR lpszData = res.GetBuffer(cbData);
- rv = RegQueryValueExA(hkey, name, 0, 0, (LPBYTE)lpszData, &cbData);
- res.ReleaseBuffer(cbData);
+ LPTSTR lpszData = strRes.GetBuffer(cbData);
+ rv = RegQueryValueExA(hkey, strName, 0, 0, (LPBYTE)lpszData, &cbData);
+ strRes.ReleaseBuffer(cbData);
RegCloseKey(hkey);
return rv == ERROR_SUCCESS;
|
@@ -1,6 +1,6 @@ #ifndef REGISTRY_CONFIG_H_
#define REGISTRY_CONFIG_H_
-int GetRegistryConfig(const CString& name, CString& res);
+int GetRegistryConfig(const CString& strName, CString& strRes);
#endif
|
@@ -30,7 +30,7 @@ }
-int CTHgStatus::SendRequest(const CString& request)
+int CTHgStatus::SendRequest(const CString& strRequest)
{
static const CString pname = GetPipeName();
@@ -40,10 +40,11 @@ BOOL fSuccess;
DWORD cbRead;
- ATLTRACE("CTHgStatus:SendRequest: sending '%s' to %s\n", (LPCTSTR)request, (LPCTSTR)pname);
+ ATLTRACE("CTHgStatus:SendRequest: sending '%s' to %s\n",
+ (LPCTSTR)strRequest, (LPCTSTR)pname);
- fSuccess = ::CallNamedPipeA(pname, (void*)(LPCTSTR)request, request.GetLength(),
- 0, 0, &cbRead, NMPWAIT_NOWAIT);
+ fSuccess = ::CallNamedPipeA(pname, (void*)(LPCTSTR)strRequest,
+ strRequest.GetLength(), 0, 0, &cbRead, NMPWAIT_NOWAIT);
DWORD err = GetLastError();
if (fSuccess || err == ERROR_MORE_DATA || err == ERROR_PIPE_NOT_CONNECTED)
|
@@ -19,17 +19,17 @@
class CTHgStatus
{
- static int SendRequest(const CString& request);
+ static int SendRequest(const CString& strRequest);
public:
- static int Update(const CString& path) {
- return SendRequest("update|" + path);
+ static int Update(const CString& strPath) {
+ return SendRequest("update|" + strPath);
}
- static int Remove(const CString& path) {
- return SendRequest("remove|" + path);
+ static int Remove(const CString& strPath) {
+ return SendRequest("remove|" + strPath);
}
- static int Error(const CString& text) {
- return SendRequest("error|" + text);
+ static int Error(const CString& strText) {
+ return SendRequest("error|" + strText);
}
static int Terminate() {
return SendRequest("terminate|");
|
@@ -2,14 +2,14 @@ #include "TortoiseUtils.h"
#include "IconBitmapUtils.h"
-HBITMAP GetTortoiseIconBitmap(const CString& iconname)
+HBITMAP GetTortoiseIconBitmap(const CString& strIconName)
{
CIconBitmapUtils bmpUtils;
typedef CAtlMap<CString, HBITMAP> CBitmapCache;
static CBitmapCache bmpcache;
- const CBitmapCache::CPair* p = bmpcache.Lookup(iconname);
+ const CBitmapCache::CPair* p = bmpcache.Lookup(strIconName);
if (p != NULL)
return p->m_value;
@@ -19,7 +19,7 @@ return 0;
}
- HICON hIcon = GetTortoiseIcon(iconname);
+ HICON hIcon = GetTortoiseIcon(strIconName);
if (!hIcon)
return 0;
@@ -31,10 +31,10 @@ return 0;
}
- bmpcache[iconname] = hBmp;
+ bmpcache[strIconName] = hBmp;
ATLTRACE("GetTortoiseIconBitmap: added '%s' to bmpcache_ (%d bitmaps in cache)\n",
- (LPCTSTR)iconname, bmpcache.GetCount());
+ (LPCTSTR)strIconName, bmpcache.GetCount());
return hBmp;
}
|
@@ -3,6 +3,6 @@
#include <windows.h>
-HBITMAP GetTortoiseIconBitmap(const CString& iconname);
+HBITMAP GetTortoiseIconBitmap(const CString& strIconName);
#endif
|
|
|
@@ -26,10 +26,10 @@ // Note: if the command is a batch file and the [full] path to the
// batch contains spaces, the path must be double-quoted.
// (see http://www.encocoservices.com/createprocess.html)
-bool LaunchCommand(const CString& command, const CString& cwd)
+bool LaunchCommand(const CString& strCommand, const CString& strCwd)
{
- ATLTRACE("LaunchCommand: %s\n", (LPCTSTR)command);
- ATLTRACE("LaunchCommand: in '%s'\n", (LPCTSTR)cwd);
+ ATLTRACE("LaunchCommand: %s\n", (LPCTSTR)strCommand);
+ ATLTRACE("LaunchCommand: in '%s'\n", (LPCTSTR)strCwd);
PROCESS_INFORMATION processInfo;
memset(&processInfo, 0, sizeof(processInfo));
@@ -38,13 +38,13 @@
int res = CreateProcessA(
NULL, // No module name, use command line
- (LPTSTR)(LPCTSTR)command,
+ (LPTSTR)(LPCTSTR)strCommand,
NULL, // Process handle not inherited
NULL, // Thread handle not inherited
FALSE,
CREATE_NO_WINDOW,
NULL, // use parent's environment
- cwd,
+ strCwd,
&startupInfo,
&processInfo
);
@@ -60,7 +60,7 @@ return true;
}
-CString GetTemporaryFile(LPCTSTR prefix)
+CString GetTemporaryFile(LPCTSTR strPrefix)
{
char tempDir[MAX_PATH + 1];
char tempFile[MAX_PATH + 1];
@@ -69,7 +69,7 @@ {
ATLTRACE("GetTemporaryFile: Failed to find temporary path\n");
}
- else if (GetTempFileName(tempDir, prefix, 0, tempFile) != 0)
+ else if (GetTempFileName(tempDir, strPrefix, 0, tempFile) != 0)
{
return tempFile;
}
@@ -81,32 +81,32 @@ return "";
}
-CString DirName(const CString& filename)
+CString DirName(const CString& strFileName)
{
- if (filename.IsEmpty())
- return filename;
- int pos = filename.ReverseFind('\\');
+ if (strFileName.IsEmpty())
+ return strFileName;
+ int pos = strFileName.ReverseFind('\\');
if (pos == -1)
return "";
- CString myfilename = filename.Left(pos);
+ CString myfilename = strFileName.Left(pos);
if (!myfilename.IsEmpty() && myfilename[myfilename.GetLength()-1] == ':')
myfilename.AppendChar('\\');
return myfilename;
}
-CString BaseName(const CString& filename)
+CString BaseName(const CString& strFileName)
{
- if (filename.IsEmpty())
- return filename;
- int pos = filename.ReverseFind('\\');
+ if (strFileName.IsEmpty())
+ return strFileName;
+ int pos = strFileName.ReverseFind('\\');
if (pos == -1)
- return filename;
- return filename.Mid(pos+1);
+ return strFileName;
+ return strFileName.Mid(pos+1);
}
// not reentrant
-HICON GetTortoiseIcon(const CString& iconname)
+HICON GetTortoiseIcon(const CString& strIconName)
{
typedef CAtlMap<CString, HICON> CIconCache;
static CIconCache iconcache;
@@ -118,9 +118,9 @@ return 0;
}
- CString iconpath = thgdir + "\\icons\\" + iconname;
+ CString iconpath = thgdir + "\\icons\\" + strIconName;
- const CIconCache::CPair* p = iconcache.Lookup(iconname);
+ const CIconCache::CPair* p = iconcache.Lookup(strIconName);
if (p != NULL)
return p->m_value;
@@ -147,12 +147,12 @@}
-CString GetHgRepoRoot(LPCTSTR path)
+CString GetHgRepoRoot(LPCTSTR lpszPath)
{
- ATLTRACE("GetHgRepoRoot('%s')\n", path);
+ ATLTRACE("GetHgRepoRoot('%s')\n", lpszPath);
- CString p = (::PathIsUNCServerShare(path) || ::PathIsDirectory(path)) ?
- path : DirName(path);
+ CString p = (::PathIsUNCServerShare(lpszPath) || ::PathIsDirectory(lpszPath)) ?
+ lpszPath : DirName(lpszPath);
for (;;)
{
CString tdir = p + "\\.hg";
@@ -178,18 +178,18 @@}
-bool IsHgRepo(LPCTSTR path)
+bool IsHgRepo(LPCTSTR lpszPath)
{
- return !GetHgRepoRoot(path).IsEmpty();
+ return !GetHgRepoRoot(lpszPath).IsEmpty();
}
// open a file for reading, allowing renames and deletes by other
// processes while we have it open
-FILE* fopenReadRenameAllowed(const char* path)
+FILE* fopenReadRenameAllowed(LPCTSTR lpszPath)
{
HANDLE fh = ::CreateFileA(
- path, GENERIC_READ,
+ lpszPath, GENERIC_READ,
FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
0, OPEN_EXISTING, 0, 0
);
@@ -220,39 +220,39 @@
// read string value from registry, wide version
-int GetRegSZValueW(HKEY hkey, const wchar_t* name, CStringW& res)
+int GetRegSZValueW(HKEY hKey, LPCWSTR lpszName, CStringW& strRes)
{
- res = L"";
+ strRes = L"";
- if (!hkey)
+ if (!hKey)
return 0;
DWORD cbData = 600;
- LPWSTR lpszData = res.GetBuffer(cbData);
- LONG rv = ::RegQueryValueExW(hkey, name, 0, 0, (LPBYTE)lpszData, &cbData);
- res.ReleaseBuffer(cbData);
+ LPWSTR lpszData = strRes.GetBuffer(cbData);
+ LONG rv = ::RegQueryValueExW(hKey, lpszName, 0, 0, (LPBYTE)lpszData, &cbData);
+ strRes.ReleaseBuffer(cbData);
if (rv == ERROR_SUCCESS)
return 1;
- ATLTRACE(L"GetRegSZValueW('%s') failed\n", name);
+ ATLTRACE(L"GetRegSZValueW('%s') failed\n", lpszName);
return 0;
}
// true if a starts with b
-bool StartsWith(const CString& a, const CString& b)
+bool StartsWith(const CString& strWhole, const CString& strPrefix)
{
- if (a.IsEmpty() || b.IsEmpty())
+ if (strWhole.IsEmpty() || strPrefix.IsEmpty())
return false;
- if (b.GetLength() > a.GetLength())
+ if (strPrefix.GetLength() > strWhole.GetLength())
return false;
- for (int i = 0; i < b.GetLength(); ++i)
+ for (int i = 0; i < strPrefix.GetLength(); ++i)
{
- if (a[i] != b[i])
+ if (strWhole[i] != strPrefix[i])
return false;
}
@@ -260,14 +260,14 @@}
-void Tokenize(CString str, CAtlList<CString>& tokens, LPCTSTR delimiters)
+void Tokenize(CString str, CAtlList<CString>& rTokens, LPCTSTR lpszDelimiters)
{
int pos = 0;
- CString strToken = str.Tokenize(delimiters, pos);
+ CString strToken = str.Tokenize(lpszDelimiters, pos);
while (!strToken.IsEmpty())
{
- tokens.AddTail(strToken);
- strToken = str.Tokenize(delimiters, pos);
+ rTokens.AddTail(strToken);
+ strToken = str.Tokenize(lpszDelimiters, pos);
}
}
|
@@ -5,16 +5,16 @@ #include <windows.h>
CString GetTHgProgRoot();
-CString GetTemporaryFile(LPCSTR prefix="THG");
-CString DirName(const CString& filename);
-CString BaseName(const CString& filename);
-bool LaunchCommand(const CString& command, const CString& cwd);
-HICON GetTortoiseIcon(const CString& iconname);
-CString GetHgRepoRoot(LPCTSTR path);
-bool IsHgRepo(const CString& path);
-FILE* fopenReadRenameAllowed(const char* path);
-int GetRegSZValueW(HKEY hkey, const wchar_t* name, CStringW& res);
-bool StartsWith(const CString& a, const CString& b);
-void Tokenize(CString str, CAtlList<CString>& tokens, LPCTSTR delimiters = " ");
+CString GetTemporaryFile(LPCSTR strPrefix = "THG");
+CString DirName(const CString& strFileName);
+CString BaseName(const CString& strFileName);
+bool LaunchCommand(const CString& strCommand, const CString& strCwd);
+HICON GetTortoiseIcon(const CString& strIconName);
+CString GetHgRepoRoot(LPCTSTR lpszPath);
+bool IsHgRepo(const CString& lpszPath);
+FILE* fopenReadRenameAllowed(LPCTSTR lpszPath);
+int GetRegSZValueW(HKEY hKey, LPCWSTR lpszName, CStringW& strRes);
+bool StartsWith(const CString& strWhole, const CString& strPrefix);
+void Tokenize(CString str, CAtlList<CString>& rTokens, LPCTSTR lpszDelimiters = " ");
#endif
|
@@ -32,15 +32,15 @@ return -1;
FindClose(hfind);
- this->mtime = (((__int64)data.ftLastWriteTime.dwHighDateTime << 32) +
+ ullMTime = (((LONGLONG)data.ftLastWriteTime.dwHighDateTime << 32) +
data.ftLastWriteTime.dwLowDateTime);
if (!time64)
{
- mtime /= divisor;
- mtime -= secs_between_epochs;
+ ullMTime /= divisor;
+ ullMTime -= secs_between_epochs;
}
- this->size = ((__int64)data.nFileSizeHigh << 32) + data.nFileSizeLow;
- this->isdir = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
+ ullSize = ((LONGLONG)data.nFileSizeHigh << 32) + data.nFileSizeLow;
+ bIsDir = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
return 0;
}
|
@@ -20,9 +20,9 @@ class CWinstat
{
public:
- unsigned __int64 size;
- unsigned __int64 mtime;
- bool isdir;
+ ULONGLONG ullSize;
+ ULONGLONG ullMTime;
+ bool bIsDir;
int lstat(const char* file, bool time64 = false);
};
|
@@ -21,31 +21,31 @@ #include "TortoiseUtils.h"
-CAutoPtr<CDirstate> CDirstate::Read(const CString& path, bool& unset)
+CAutoPtr<CDirstate> CDirstate::Read(const CString& strPath, bool& bUnset)
{
- unset = false;
+ bUnset = false;
- FILE *f = fopenReadRenameAllowed(path);
+ FILE *f = fopenReadRenameAllowed(strPath);
if (!f)
{
- ATLTRACE("Dirstate::read: can't open '%s'\n", (LPCTSTR)path);
+ ATLTRACE("Dirstate::read: can't open '%s'\n", (LPCTSTR)strPath);
return CAutoPtr<CDirstate>(NULL);
}
CAutoPtr<CDirstate> pd(new CDirstate());
- fread(&pd->parent1, sizeof(char), HASH_LENGTH, f);
- fread(&pd->parent2, sizeof(char), HASH_LENGTH, f);
+ fread(&pd->m_szParent1, sizeof(char), HASH_LENGTH, f);
+ fread(&pd->m_szParent2, sizeof(char), HASH_LENGTH, f);
CDirentry e;
CString relpath;
while (e.Read(f, relpath))
{
if (e.Unset())
- unset = true;
+ bUnset = true;
if (e.m_chState == 'a')
- ++pd->num_added_;
+ ++pd->m_nNumAdded;
pd->Add(relpath, e);
}
@@ -79,8 +79,8 @@ printf("error: could not read .hg/dirstate\n");
return;
}
- printf("parent1: %s\n", RevHashString(pd->parent1));
- printf("parent2: %s\n", RevHashString(pd->parent2));
+ printf("parent1: %s\n", RevHashString(pd->m_szParent1));
+ printf("parent2: %s\n", RevHashString(pd->m_szParent2));
printf("entries: %d\n\n", pd->Size());
pd->Root().Print();
|
@@ -24,30 +24,30 @@
class CDirstate
{
- CDirectory root_;
+ CDirectory m_dirRoot;
- unsigned num_added_; // number of entries that have state 'a'
- unsigned num_entries_;
+ unsigned m_nNumAdded; // number of entries that have state 'a'
+ unsigned m_nNumEntries;
public:
- char parent1[HASH_LENGTH];
- char parent2[HASH_LENGTH];
+ char m_szParent1[HASH_LENGTH];
+ char m_szParent2[HASH_LENGTH];
- static CAutoPtr<CDirstate> Read(const CString& path, bool& unset);
+ static CAutoPtr<CDirstate> Read(const CString& strPath, bool& bUnset);
- CDirectory& Root() { return root_; }
+ CDirectory& Root() { return m_dirRoot; }
- void Add(const CString& relpath, CDirentry& e) {
- root_.Add(relpath, e);
- ++num_entries_;
+ void Add(const CString& strRelPath, CDirentry& rEntry) {
+ m_dirRoot.Add(strRelPath, rEntry);
+ ++m_nNumEntries;
}
- unsigned NumAdded() const { return num_added_; }
- unsigned Size() const { return num_entries_; }
+ unsigned NumAdded() const { return m_nNumAdded; }
+ unsigned Size() const { return m_nNumEntries; }
private:
CDirstate() :
- root_(0, "", ""), num_added_(0), num_entries_(0) {}
+ m_dirRoot(0, "", ""), m_nNumAdded(0), m_nNumEntries(0) {}
};
#endif
|
Loading...