* Reduce the scope of some variables.

svn path=/trunk/; revision=54136
This commit is contained in:
Amine Khaldi
2011-10-14 17:50:16 +00:00
parent 87ba1dad43
commit 4ee928adff
5 changed files with 7 additions and 11 deletions
+1 -3
View File
@@ -206,8 +206,6 @@ RemoveAssociation(LPTSTR extension)
INT CommandAssoc (LPTSTR param)
{
LPTSTR lpEqualSign = NULL;
/* print help */
if (!_tcsncmp (param, _T("/?"), 2))
{
@@ -221,7 +219,7 @@ INT CommandAssoc (LPTSTR param)
PrintAllAssociations();
else
{
lpEqualSign = _tcschr(param, _T('='));
LPTSTR lpEqualSign = _tcschr(param, _T('='));
if(lpEqualSign != NULL)
{
LPTSTR fileType = lpEqualSign + 1;
+1 -3
View File
@@ -1260,13 +1260,11 @@ QsortFiles(LPWIN32_FIND_DATA ptrArray[], /* [IN/OUT] The array with file info po
LPDIRSWITCHFLAGS lpFlags) /* [IN] The flags that we will use to sort */
{
LPWIN32_FIND_DATA lpTemp; /* A temporary pointer */
int First, Last, Temp;
BOOL Way;
if (i < j)
{
First = i;
Last = j;
int First = i, Last = j, Temp;
Way = TRUE;
while (i != j)
{
+1 -1
View File
@@ -209,7 +209,6 @@ BOOL ShowCompletionMatches (LPTSTR str, INT charcount)
TCHAR path[MAX_PATH];
TCHAR fname[MAX_PATH];
TCHAR directory[MAX_PATH];
UINT longestfname = 0;
SHORT screenwidth;
/* expand current file name */
@@ -277,6 +276,7 @@ BOOL ShowCompletionMatches (LPTSTR str, INT charcount)
hFile = FindFirstFile (path, &file);
if (hFile != INVALID_HANDLE_VALUE)
{
UINT longestfname = 0;
/* Get the size of longest filename first. */
do
{
+1 -2
View File
@@ -48,7 +48,6 @@ INT cmd_start (LPTSTR Rest)
TCHAR szFullCmdLine [CMDLINE_LENGTH];
PROCESS_INFORMATION prci;
STARTUPINFO stui;
INT i = 0;
#ifdef UNICODE
DWORD dwCreationFlags = CREATE_NEW_CONSOLE | CREATE_UNICODE_ENVIRONMENT;
#else
@@ -213,7 +212,7 @@ INT cmd_start (LPTSTR Rest)
/* Parsing the command that gets called by start, and it's parameters */
{
BOOL bInside = FALSE;
INT i;
/* find the end of the command and put the arguments in param */
for (i = 0; Rest[i]; i++)
{
+3 -2
View File
@@ -28,8 +28,6 @@
VOID ShortVersion (VOID)
{
OSVERSIONINFO VersionInfo;
unsigned RosVersionLen;
LPTSTR RosVersion;
ConOutResPrintf(STRING_CMD_SHELLINFO, _T(KERNEL_RELEASE_STR), _T(KERNEL_VERSION_BUILD_STR));
VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
@@ -37,6 +35,9 @@ VOID ShortVersion (VOID)
memset(VersionInfo.szCSDVersion, 0, sizeof(VersionInfo.szCSDVersion));
if (GetVersionEx(&VersionInfo))
{
LPTSTR RosVersion;
unsigned RosVersionLen;
RosVersion = VersionInfo.szCSDVersion + _tcslen(VersionInfo.szCSDVersion) + 1;
RosVersionLen = sizeof(VersionInfo.szCSDVersion) / sizeof(VersionInfo.szCSDVersion[0]) -
(RosVersion - VersionInfo.szCSDVersion);