Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

fogcreek shellext: renamed local variables for consistency, part 4

Changeset 52406a84c3ae

Parent efb98170ad2d

by David Golub

Changes to one file · Browse files at 52406a84c3ae Showing diff from parent efb98170ad2d Diff from another changeset...

 
117
118
119
120
 
121
122
123
 
129
130
131
132
 
133
134
 
135
136
 
137
138
139
140
 
141
142
143
 
144
145
 
146
147
148
 
150
151
152
153
 
154
155
156
157
158
 
 
159
160
161
 
 
162
163
164
 
165
166
167
168
 
 
 
169
170
 
171
172
173
174
175
176
 
 
177
178
179
 
187
188
189
190
 
191
192
193
194
 
195
196
197
198
 
199
200
201
202
 
203
204
205
206
207
208
 
 
209
210
211
212
213
214
215
 
216
217
218
 
226
227
228
229
 
230
231
232
 
233
234
235
 
259
260
261
262
263
 
 
264
265
266
267
 
268
269
270
 
117
118
119
 
120
121
122
123
 
129
130
131
 
132
133
 
134
135
 
136
137
138
139
 
140
141
142
 
143
144
 
145
146
147
148
 
150
151
152
 
153
154
155
156
 
 
157
158
159
 
 
160
161
162
163
 
164
165
 
 
 
166
167
168
169
 
170
171
172
173
174
 
 
175
176
177
178
179
 
187
188
189
 
190
191
192
193
 
194
195
196
197
 
198
199
200
201
 
202
203
204
205
206
 
 
207
208
209
210
211
212
213
214
 
215
216
217
218
 
226
227
228
 
229
230
231
 
232
233
234
235
 
259
260
261
 
 
262
263
264
265
266
 
267
268
269
270
@@ -117,7 +117,7 @@
  return 0;   }   - CString iconpath = thgdir + "\\icons\\" + strIconName; + CString strIconPath = thgdir + "\\icons\\" + strIconName;     const CIconCache::CPair* p = iconcache.Lookup(strIconName);   if (p != NULL) @@ -129,20 +129,20 @@
  return 0;   }   - HICON h = (HICON)::LoadImage(0, iconpath, IMAGE_ICON, + HICON hIcon = (HICON)::LoadImage(0, strIconPath, IMAGE_ICON,   16, 16, LR_LOADFROMFILE); - if (!h) + if (!hIcon)   { - ATLTRACE("GetTortoiseIcon: can't find '%s'\n", (LPCTSTR)iconpath); + ATLTRACE("GetTortoiseIcon: can't find '%s'\n", (LPCTSTR)strIconPath);   return 0;   }   - iconcache[iconpath] = h; + iconcache[strIconPath] = hIcon;     ATLTRACE("GetTortoiseIcon: added '%s' to iconcache_ (%d icons in cache)\n", - (LPCTSTR)iconpath, iconcache.GetCount()); + (LPCTSTR)strIconPath, iconcache.GetCount());   - return h; + return hIcon;  }     @@ -150,30 +150,30 @@
 {   ATLTRACE("GetHgRepoRoot('%s')\n", lpszPath);   - CString p = (::PathIsUNCServerShare(lpszPath) || ::PathIsDirectory(lpszPath)) ? + CString strPath = (::PathIsUNCServerShare(lpszPath) || ::PathIsDirectory(lpszPath)) ?   lpszPath : DirName(lpszPath);   for (;;)   { - CString tdir = p + "\\.hg"; - if (::PathIsUNCServerShare(tdir)) + CString strHgDir = strPath + "\\.hg"; + if (::PathIsUNCServerShare(strHgDir))   { - ATLTRACE("GetHgRepoRoot: tdir is UNC share '%s'\n", (LPCTSTR)tdir); - p.Empty(); + ATLTRACE("GetHgRepoRoot: tdir is UNC share '%s'\n", (LPCTSTR)strHgDir); + strPath.Empty();   break;   } - else if (::PathIsDirectory(tdir)) + else if (::PathIsDirectory(strHgDir))   break; - CString oldp = p; - p = DirName(p); - if (p == oldp) + CString strOldPath = strPath; + strPath = DirName(strPath); + if (strPath == strOldPath)   { - p.Empty(); + strPath.Empty();   break;   }   }   - ATLTRACE("GetHgRepoRoot: returning '%s'\n", (LPCTSTR)p); - return p; + ATLTRACE("GetHgRepoRoot: returning '%s'\n", (LPCTSTR)strPath); + return strPath;  }     @@ -187,32 +187,32 @@
 // processes while we have it open  FILE* fopenReadRenameAllowed(LPCTSTR lpszPath)  { - HANDLE fh = ::CreateFile(lpszPath, GENERIC_READ, + HANDLE hFile = ::CreateFile(lpszPath, GENERIC_READ,   FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,   0, OPEN_EXISTING, 0, 0);   - if (fh == INVALID_HANDLE_VALUE) + if (hFile == INVALID_HANDLE_VALUE)   return 0;     // get C runtime file descriptor from file handle - int fd = _open_osfhandle((intptr_t)fh, _O_RDONLY); + int fd = _open_osfhandle((intptr_t)hFile, _O_RDONLY);   if (fd == -1)   {   ATLTRACE("fopenReadRenameAllowed: _open_osfhandle failed\n"); - ::CloseHandle(fh); + ::CloseHandle(hFile);   return 0;   }     // get C runtime FILE from file descriptor - FILE* f = _fdopen(fd, "r"); - if (f == 0) + FILE* pFile = _fdopen(fd, "r"); + if (pFile == 0)   {   ATLTRACE("fopenReadRenameAllowed: _fdopen failed\n");   _close(fd);   return 0;   }   - return f; + return pFile;  }     @@ -226,10 +226,10 @@
    DWORD cbData = 600;   LPWSTR lpszData = strRes.GetBuffer(cbData); - LONG rv = ::RegQueryValueExW(hKey, lpszName, 0, 0, (LPBYTE)lpszData, &cbData); + LONG lRes = ::RegQueryValueExW(hKey, lpszName, 0, 0, (LPBYTE)lpszData, &cbData);   strRes.ReleaseBuffer(cbData);   - if (rv == ERROR_SUCCESS) + if (lRes == ERROR_SUCCESS)   return 1;     ATLTRACE(L"GetRegSZValueW('%s') failed\n", lpszName); @@ -259,12 +259,12 @@
   void Tokenize(CString str, CAtlList<CString>& rTokens, LPCTSTR lpszDelimiters)  { - int pos = 0; - CString strToken = str.Tokenize(lpszDelimiters, pos); + int nPos = 0; + CString strToken = str.Tokenize(lpszDelimiters, nPos);   while (!strToken.IsEmpty())   {   rTokens.AddTail(strToken); - strToken = str.Tokenize(lpszDelimiters, pos); + strToken = str.Tokenize(lpszDelimiters, nPos);   }  }