Why?
Author: akhaldi
Date: Fri Oct 14 17:50:16 2011
New Revision: 54136
URL: http://svn.reactos.org/svn/reactos?rev=54136&view=rev
Log:
[CMD]
* Reduce the scope of some variables.
Modified:
trunk/reactos/base/shell/cmd/assoc.c
trunk/reactos/base/shell/cmd/dir.c
trunk/reactos/base/shell/cmd/filecomp.c
trunk/reactos/base/shell/cmd/start.c
trunk/reactos/base/shell/cmd/ver.c
Modified: trunk/reactos/base/shell/cmd/assoc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/assoc.c?rev=54136&r1=54135&r2=54136&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/assoc.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/assoc.c [iso-8859-1] Fri Oct 14 17:50:16 2011
@@ -206,8 +206,6 @@
INT CommandAssoc (LPTSTR param)
{
- LPTSTR lpEqualSign = NULL;
-
/* print help */
if (!_tcsncmp (param, _T("/?"), 2))
{
@@ -221,7 +219,7 @@
PrintAllAssociations();
else
{
- lpEqualSign = _tcschr(param, _T('='));
+ LPTSTR lpEqualSign = _tcschr(param, _T('='));
if(lpEqualSign != NULL)
{
LPTSTR fileType = lpEqualSign + 1;
Modified: trunk/reactos/base/shell/cmd/dir.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/dir.c?rev=54136&r1=54135&r2=54136&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/dir.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/dir.c [iso-8859-1] Fri Oct 14 17:50:16 2011
@@ -1260,13 +1260,11 @@
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)
{
Modified: trunk/reactos/base/shell/cmd/filecomp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/filecomp.c?rev=54136&r1=54135&r2=54136&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/filecomp.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/filecomp.c [iso-8859-1] Fri Oct 14 17:50:16 2011
@@ -209,7 +209,6 @@
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 @@
hFile = FindFirstFile (path, &file);
if (hFile != INVALID_HANDLE_VALUE)
{
+ UINT longestfname = 0;
/* Get the size of longest filename first. */
do
{
Modified: trunk/reactos/base/shell/cmd/start.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/start.c?rev=54136&r1=54135&r2=54136&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/start.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/start.c [iso-8859-1] Fri Oct 14 17:50:16 2011
@@ -48,7 +48,6 @@
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 @@
/* 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++)
{
Modified: trunk/reactos/base/shell/cmd/ver.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/ver.c?rev=54136&r1=54135&r2=54136&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/ver.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/ver.c [iso-8859-1] Fri Oct 14 17:50:16 2011
@@ -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 @@
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);