Speed up compilation of cmd
Modified: trunk/reactos/subsys/system/cmd/cmd.c
Modified: trunk/reactos/subsys/system/cmd/cmd.h
Modified: trunk/reactos/subsys/system/cmd/cmd.xml
Modified: trunk/reactos/subsys/system/cmd/copy.c
Modified: trunk/reactos/subsys/system/cmd/dir.c
Modified: trunk/reactos/subsys/system/cmd/free.c
Modified: trunk/reactos/subsys/system/cmd/move.c

Modified: trunk/reactos/subsys/system/cmd/cmd.c
--- trunk/reactos/subsys/system/cmd/cmd.c	2005-11-27 11:30:44 UTC (rev 19677)
+++ trunk/reactos/subsys/system/cmd/cmd.c	2005-11-27 11:59:02 UTC (rev 19678)
@@ -176,10 +176,45 @@
 #endif
 
 /*
- *  is character a delimeter when used on first word?
+ * convert
  *
+ * insert commas into a number
  */
+INT
+ConvertULargeInteger (ULARGE_INTEGER num, LPTSTR des, INT len, BOOL bPutSeperator)
+{
+	TCHAR temp[32];
+	INT c = 0;
+	INT n = 0;
 
+	if (num.QuadPart == 0)
+	{
+		des[0] = _T('0');
+		des[1] = _T('\0');
+		n = 1;
+	}
+	else
+	{
+		temp[31] = 0;
+		while (num.QuadPart > 0)
+		{
+			if ((((c + 1) % (nNumberGroups + 1)) == 0) && (bPutSeperator))
+				temp[30 - c++] = cThousandSeparator;
+                        temp[30 - c++] = (TCHAR)(num.QuadPart % 10) + _T('0');
+			num.QuadPart /= 10;
+		}
+
+		for (n = 0; n <= c; n++)
+			des[n] = temp[31 - c + n];
+	}
+
+	return n;
+}
+
+/*
+ * is character a delimeter when used on first word?
+ *
+ */
 static BOOL IsDelimiter (TCHAR c)
 {
 	return (c == _T('/') || c == _T('=') || c == _T('\0') || _istspace (c));

Modified: trunk/reactos/subsys/system/cmd/cmd.h
--- trunk/reactos/subsys/system/cmd/cmd.h	2005-11-27 11:30:44 UTC (rev 19677)
+++ trunk/reactos/subsys/system/cmd/cmd.h	2005-11-27 11:59:02 UTC (rev 19678)
@@ -93,6 +93,7 @@
 
 
 /* Prototypes for CMD.C */
+INT ConvertULargeInteger (ULARGE_INTEGER num, LPTSTR des, INT len, BOOL bPutSeperator);
 VOID ParseCommandLine (LPTSTR);
 LPCTSTR GetEnvVarOrSpecial ( LPCTSTR varName );
 VOID AddBreakHandler (VOID);

Modified: trunk/reactos/subsys/system/cmd/cmd.xml
--- trunk/reactos/subsys/system/cmd/cmd.xml	2005-11-27 11:30:44 UTC (rev 19677)
+++ trunk/reactos/subsys/system/cmd/cmd.xml	2005-11-27 11:59:02 UTC (rev 19678)
@@ -5,59 +5,61 @@
 	<define name="ANONYMOUSUNIONS" />
 	<define name="_WIN32_WINNT">0x0501</define>
 	<pch>precomp.h</pch>
-	<file>alias.c</file>
-	<file>attrib.c</file>
-	<file>batch.c</file>
-	<file>beep.c</file>
-	<file>call.c</file>
-	<file>chcp.c</file>
-	<file>choice.c</file>
-	<file>cls.c</file>
-	<file>cmd.c</file>
-	<file>cmdinput.c</file>
-	<file>cmdtable.c</file>
-	<file>color.c</file>
-	<file>console.c</file>
-	<file>copy.c</file>
-	<file>date.c</file>
-	<file>del.c</file>
-	<file>delay.c</file>
-	<file>dir.c</file>
-	<file>dirstack.c</file>
-	<file>echo.c</file>
-	<file>error.c</file>
-	<file>filecomp.c</file>
-	<file>for.c</file>
-	<file>free.c</file>
-	<file>goto.c</file>
-	<file>history.c</file>
-	<file>if.c</file>
-	<file>internal.c</file>
-	<file>label.c</file>
-	<file>locale.c</file>
-	<file>memory.c</file>
-	<file>misc.c</file>
-	<file>move.c</file>
-	<file>msgbox.c</file>
-	<file>path.c</file>
-	<file>pause.c</file>
-	<file>prompt.c</file>
-	<file>redir.c</file>
-	<file>ren.c</file>
-	<file>screen.c</file>
-	<file>set.c</file>
-	<file>shift.c</file>
-	<file>start.c</file>
-	<file>strtoclr.c</file>
-	<file>time.c</file>
-	<file>timer.c</file>
-	<file>title.c</file>
-	<file>type.c</file>
-	<file>ver.c</file>
-	<file>verify.c</file>
-	<file>vol.c</file>
-	<file>where.c</file>
-	<file>window.c</file>
+	<compilationunit name="unit.c">
+		<file>alias.c</file>
+		<file>attrib.c</file>
+		<file>batch.c</file>
+		<file>beep.c</file>
+		<file>call.c</file>
+		<file>chcp.c</file>
+		<file>choice.c</file>
+		<file>cls.c</file>
+		<file>cmd.c</file>
+		<file>cmdinput.c</file>
+		<file>cmdtable.c</file>
+		<file>color.c</file>
+		<file>console.c</file>
+		<file>copy.c</file>
+		<file>date.c</file>
+		<file>del.c</file>
+		<file>delay.c</file>
+		<file>dir.c</file>
+		<file>dirstack.c</file>
+		<file>echo.c</file>
+		<file>error.c</file>
+		<file>filecomp.c</file>
+		<file>for.c</file>
+		<file>free.c</file>
+		<file>goto.c</file>
+		<file>history.c</file>
+		<file>if.c</file>
+		<file>internal.c</file>
+		<file>label.c</file>
+		<file>locale.c</file>
+		<file>memory.c</file>
+		<file>misc.c</file>
+		<file>move.c</file>
+		<file>msgbox.c</file>
+		<file>path.c</file>
+		<file>pause.c</file>
+		<file>prompt.c</file>
+		<file>redir.c</file>
+		<file>ren.c</file>
+		<file>screen.c</file>
+		<file>set.c</file>
+		<file>shift.c</file>
+		<file>start.c</file>
+		<file>strtoclr.c</file>
+		<file>time.c</file>
+		<file>timer.c</file>
+		<file>title.c</file>
+		<file>type.c</file>
+		<file>ver.c</file>
+		<file>verify.c</file>
+		<file>vol.c</file>
+		<file>where.c</file>
+		<file>window.c</file>
+	</compilationunit>
 </module>
 <module name="cmd" type="win32cui" installbase="system32" installname="cmd.exe" usewrc="false">
 	<include base="ReactOS">include/wine</include>

Modified: trunk/reactos/subsys/system/cmd/copy.c
--- trunk/reactos/subsys/system/cmd/copy.c	2005-11-27 11:30:44 UTC (rev 19677)
+++ trunk/reactos/subsys/system/cmd/copy.c	2005-11-27 11:59:02 UTC (rev 19678)
@@ -324,7 +324,7 @@
 }
  
  
-static INT Overwrite (LPTSTR fn)
+static INT CopyOverwrite (LPTSTR fn)
 {
 	/*ask the user if they want to override*/
 	TCHAR szMsg[RC_STRING_MAX_SIZE];
@@ -844,7 +844,7 @@
 
 			/* Handle any overriding / prompting that needs to be done */
 			if(((!(dwFlags & COPY_NO_PROMPT) && IsExistingFile (tmpDestPath)) || dwFlags & COPY_PROMPT) && !bTouch)
-				nOverwrite = Overwrite(tmpDestPath);
+				nOverwrite = CopyOverwrite(tmpDestPath);
 			if(nOverwrite == PROMPT_NO || nOverwrite == PROMPT_BREAK)
 				continue;
 			if(nOverwrite == PROMPT_ALL || (nOverwrite == PROMPT_YES && bAppend))

Modified: trunk/reactos/subsys/system/cmd/dir.c
--- trunk/reactos/subsys/system/cmd/dir.c	2005-11-27 11:30:44 UTC (rev 19677)
+++ trunk/reactos/subsys/system/cmd/dir.c	2005-11-27 11:59:02 UTC (rev 19678)
@@ -982,38 +982,6 @@
 }
 #endif
 
-static INT
-ConvertULargeInteger (ULARGE_INTEGER num, LPTSTR des, INT len, BOOL bPutSeperator)
-{
-	TCHAR temp[32];
-	INT c = 0;
-	INT n = 0;
-
-	if (num.QuadPart == 0)
-	{
-		des[0] = _T('0');
-		des[1] = _T('\0');
-		n = 1;
-	}
-	else
-	{
-		temp[31] = 0;
-		while (num.QuadPart > 0)
-		{
-			if ((((c + 1) % (nNumberGroups + 1)) == 0) && (bPutSeperator))
-				temp[30 - c++] = cThousandSeparator;
-   temp[30 - c++] = (TCHAR)(num.QuadPart % 10) + _T('0');
-			num.QuadPart /= 10;
-		}
-
-		for (n = 0; n <= c; n++)
-			des[n] = temp[31 - c + n];
-	}
-
-	return n;
-}
-
-
 static VOID
 DirPrintFileDateTime(TCHAR *lpDate,
                      TCHAR *lpTime,

Modified: trunk/reactos/subsys/system/cmd/free.c
--- trunk/reactos/subsys/system/cmd/free.c	2005-11-27 11:30:44 UTC (rev 19677)
+++ trunk/reactos/subsys/system/cmd/free.c	2005-11-27 11:59:02 UTC (rev 19678)
@@ -16,45 +16,6 @@
 
 #ifdef INCLUDE_CMD_FREE
 
-
-/*
- * convert
- *
- * insert commas into a number
- */
-
-static INT
-ConvertULargeInteger (ULARGE_INTEGER num, LPTSTR des, INT len)
-{
-	TCHAR temp[32];
-	INT c = 0;
-	INT n = 0;
-
-	if (num.QuadPart == 0)
-	{
-		des[0] = _T('0');
-		des[1] = _T('\0');
-		n = 1;
-	}
-	else
-	{
-		temp[31] = 0;
-		while (num.QuadPart > 0)
-		{
-			if (((c + 1) % (nNumberGroups + 1)) == 0)
-				temp[30 - c++] = cThousandSeparator;
-			temp[30 - c++] = (TCHAR)(num.QuadPart % 10) + _T('0');
-			num.QuadPart /= 10;
-		}
-
-		for (n = 0; n <= c; n++)
-			des[n] = temp[31 - c + n];
-	}
-
-	return n;
-}
-
-
 static VOID
 PrintDiskInfo (LPTSTR szDisk)
 {
@@ -112,13 +73,13 @@
 	}
 
 	uliSize.QuadPart = dwSecPerCl * dwBytPerSec * dwTotCl;
-	ConvertULargeInteger (uliSize, szTotal, 40);
+	ConvertULargeInteger (uliSize, szTotal, 40, TRUE);
 
 	uliSize.QuadPart = dwSecPerCl * dwBytPerSec * (dwTotCl - dwFreeCl);
-	ConvertULargeInteger (uliSize, szUsed, 40);
+	ConvertULargeInteger (uliSize, szUsed, 40, TRUE);
 
 	uliSize.QuadPart = dwSecPerCl * dwBytPerSec * dwFreeCl;
-	ConvertULargeInteger (uliSize, szFree, 40);
+	ConvertULargeInteger (uliSize, szFree, 40, TRUE);
 
 
 	LoadString(CMD_ModuleHandle, STRING_FREE_HELP1, szMsg, RC_STRING_MAX_SIZE);

Modified: trunk/reactos/subsys/system/cmd/move.c
--- trunk/reactos/subsys/system/cmd/move.c	2005-11-27 11:30:44 UTC (rev 19677)
+++ trunk/reactos/subsys/system/cmd/move.c	2005-11-27 11:59:02 UTC (rev 19678)
@@ -53,7 +53,7 @@
 	MOVE_PATHS_ON_DIF_VOL = 0x080 /* source and destination paths are on different volume */
 };
 
-static INT Overwrite (LPTSTR fn)
+static INT MoveOverwrite (LPTSTR fn)
 {
 	/*ask the user if they want to override*/
 	TCHAR szMsg[RC_STRING_MAX_SIZE];
@@ -412,7 +412,7 @@
 			continue;
 		if(!(dwFlags & MOVE_OVER_YES) &&
 		    (dwMoveStatusFlags & MOVE_DEST_EXISTS))
-			nOverwrite = Overwrite (szFullDestPath);
+			nOverwrite = MoveOverwrite (szFullDestPath);
 		if (nOverwrite == PROMPT_NO || nOverwrite == PROMPT_BREAK)
 			continue;
 		if (nOverwrite == PROMPT_ALL)