diff --git a/reactos/subsys/system/cmd/cmd.c b/reactos/subsys/system/cmd/cmd.c index b8f83fcac92..18417a3669d 100644 --- a/reactos/subsys/system/cmd/cmd.c +++ b/reactos/subsys/system/cmd/cmd.c @@ -148,9 +148,9 @@ #define NT_SUCCESS(StatCode) ((NTSTATUS)(StatCode) >= 0) #endif -typedef NTSTATUS (STDCALL *NtQueryInformationProcessProc)(HANDLE, PROCESSINFOCLASS, +typedef NTSTATUS (WINAPI *NtQueryInformationProcessProc)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG); -typedef NTSTATUS (STDCALL *NtReadVirtualMemoryProc)(HANDLE, PVOID, PVOID, ULONG, PULONG); +typedef NTSTATUS (WINAPI *NtReadVirtualMemoryProc)(HANDLE, PVOID, PVOID, ULONG, PULONG); BOOL bExit = FALSE; /* indicates EXIT was typed */ BOOL bCanExit = TRUE; /* indicates if this shell is exitable */ @@ -356,7 +356,7 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) } else { - INT i = 0; + UINT i = 0; BOOL bInside = FALSE; rest[0] = _T('\0'); full[0] = _T('\0'); @@ -1392,12 +1392,10 @@ Initialize (int argc, TCHAR* argv[]) #ifdef _DEBUG - INT x; - DebugPrintf (_T("[command args:\n")); - for (x = 0; x < argc; x++) + for (i = 0; i < argc; i++) { - DebugPrintf (_T("%d. %s\n"), x, argv[x]); + DebugPrintf (_T("%d. %s\n"), i, argv[i]); } DebugPrintf (_T("]\n")); #endif diff --git a/reactos/subsys/system/cmd/cmd.h b/reactos/subsys/system/cmd/cmd.h index c3dea180ee1..ea8bfe6a277 100644 --- a/reactos/subsys/system/cmd/cmd.h +++ b/reactos/subsys/system/cmd/cmd.h @@ -224,11 +224,11 @@ VOID msg_pause (VOID); /* Prototypes for FILECOMP.C */ #ifdef FEATURE_UNIX_FILENAME_COMPLETION -VOID CompleteFilename (LPTSTR, INT); +VOID CompleteFilename (LPTSTR, UINT); INT ShowCompletionMatches (LPTSTR, INT); #endif #ifdef FEATURE_4NT_FILENAME_COMPLETION -VOID CompleteFilename (LPTSTR, BOOL, LPTSTR, INT); +VOID CompleteFilename (LPTSTR, BOOL, LPTSTR, UINT); #endif diff --git a/reactos/subsys/system/cmd/cmdinput.c b/reactos/subsys/system/cmd/cmdinput.c index d48a6b3b268..d6c75d79b8a 100644 --- a/reactos/subsys/system/cmd/cmdinput.c +++ b/reactos/subsys/system/cmd/cmdinput.c @@ -138,6 +138,7 @@ VOID ReadCommand (LPTSTR str, INT maxlen) WORD wLastKey = 0; TCHAR ch; BOOL bContinue=FALSE;/*is TRUE the second case will not be executed*/ + TCHAR szPath[MAX_PATH]; /* get screen size */ GetScreenSize (&maxx, &maxy); @@ -366,8 +367,7 @@ VOID ReadCommand (LPTSTR str, INT maxlen) /* used to later see if we went down to the next line */ tempscreen = charcount; - TCHAR szPath[MAX_PATH]; - szPath[0]=_T('\0'); + szPath[0]=_T('\0'); /* str is the whole things that is on the current line that is and and out. arg 2 is weather it goes back @@ -404,7 +404,7 @@ VOID ReadCommand (LPTSTR str, INT maxlen) if(((charcount + orgx) / maxx) + orgy > maxy - 1) orgy += maxy - ((charcount + orgx) / maxx + orgy + 1); } - SetCursorXY((orgx + current) % maxx, orgy + (orgx + current) / maxx); + SetCursorXY((short)(((int)orgx + current) % maxx), (short)((int)orgy + ((int)orgx + current) / maxx)); GetCursorXY(&curx, &cury); #endif diff --git a/reactos/subsys/system/cmd/color.c b/reactos/subsys/system/cmd/color.c index c2861932e2b..8db6dc767d1 100644 --- a/reactos/subsys/system/cmd/color.c +++ b/reactos/subsys/system/cmd/color.c @@ -94,12 +94,12 @@ INT CommandColor (LPTSTR first, LPTSTR rest) } else if ( (_tcscmp(&rest[0], _T("a")) >=0 ) && (_tcscmp(&rest[0], _T("f")) <=0 ) ) { - SetConsoleTextAttribute (hConsole, (WORD) (rest[0] + 10) - _T('a') ); + SetConsoleTextAttribute (hConsole, (WORD) (rest[0] + 10 - _T('a')) ); return 0; } else if ( (_tcscmp(&rest[0], _T("A")) >=0 ) && (_tcscmp(&rest[0], _T("F")) <=0 ) ) { - SetConsoleTextAttribute (hConsole, (WORD) (rest[0] + 10) - _T('A') ); + SetConsoleTextAttribute (hConsole, (WORD) (rest[0] + 10 - _T('A')) ); return 0; } ConErrResPuts(STRING_COLOR_ERROR2); diff --git a/reactos/subsys/system/cmd/del.c b/reactos/subsys/system/cmd/del.c index 5e2d758d088..e1e32ad61d9 100644 --- a/reactos/subsys/system/cmd/del.c +++ b/reactos/subsys/system/cmd/del.c @@ -130,7 +130,7 @@ RemoveFile (LPTSTR lpFileName, DWORD dwFlags, WIN32_FIND_DATA* f) HANDLE file; DWORD temp; - LONG BufferSize = 65536; +#define BufferSize 65536 BYTE buffer[BufferSize]; LONGLONG i; LARGE_INTEGER FileSize; @@ -150,7 +150,7 @@ RemoveFile (LPTSTR lpFileName, DWORD dwFlags, WIN32_FIND_DATA* f) WriteFile (file, buffer, BufferSize, &temp, NULL); ConOutPrintf (_T("%I64d%% %s\r"),(i * (LONGLONG)100)/FileSize.QuadPart,szDeleteWipe); } - WriteFile (file, buffer, FileSize.QuadPart - i, &temp, NULL); + WriteFile (file, buffer, (DWORD)(FileSize.QuadPart - i), &temp, NULL); ConOutPrintf (_T("100%% %s\n"),szDeleteWipe); CloseHandle (file); } diff --git a/reactos/subsys/system/cmd/dir.c b/reactos/subsys/system/cmd/dir.c index 4268ba62dbf..2c21d11e178 100644 --- a/reactos/subsys/system/cmd/dir.c +++ b/reactos/subsys/system/cmd/dir.c @@ -199,8 +199,8 @@ typedef struct _DIRFINDLISTNODE } DIRFINDLISTNODE, *PDIRFINDLISTNODE; -typedef BOOL STDCALL -(*PGETFREEDISKSPACEEX)(LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER); +typedef BOOL +(WINAPI *PGETFREEDISKSPACEEX)(LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER); /* Globally save the # of dirs, files and bytes, @@ -1294,7 +1294,7 @@ DirPrintWideList(LPWIN32_FIND_DATA ptrFiles[], /* [IN] Files' Info */ { /* Calculate the lines that will be printed */ // iLines = ceil((float)dwCount/(float)iColumns); - iLines = dwCount / iColumns; + iLines = (USHORT)(dwCount / iColumns); for (i = 0;i < iLines;i++) { @@ -1982,22 +1982,25 @@ INT CommandDir(LPTSTR first, LPTSTR rest) /* Uncomment this to show the final state of switch flags*/ #ifdef _DEBUG - ConOutPrintf("Attributes mask/value %x/%x\n",stFlags.stAttribs.dwAttribMask,stFlags.stAttribs.dwAttribVal ); - ConOutPrintf("(B) Bare format : %i\n", stFlags.bBareFormat ); - ConOutPrintf("(C) Thousand : %i\n", stFlags.bTSeperator ); - ConOutPrintf("(W) Wide list : %i\n", stFlags.bWideList ); - ConOutPrintf("(D) Wide list sort by column : %i\n", stFlags.bWideListColSort ); - ConOutPrintf("(L) Lowercase : %i\n", stFlags.bLowerCase ); - ConOutPrintf("(N) New : %i\n", stFlags.bNewLongList ); - ConOutPrintf("(O) Order : %i\n", stFlags.stOrderBy.sCriteriaCount ); - for (i =0;i LastSpace; i--) - { - szPrefix[i] = szPrefix[i - 1]; - } + memmove ( &szPrefix[LastSpace+1], &szPrefix[LastSpace], (_tcslen(szPrefix)-LastSpace+1) * sizeof(TCHAR) ); - if(LastSpace + 1 == _tcslen(szPrefix)) + if((UINT)(LastSpace + 1) == _tcslen(szPrefix)) { _tcscat(szPrefix,_T("\"")); } diff --git a/reactos/subsys/system/cmd/history.c b/reactos/subsys/system/cmd/history.c index bbd4e72b62e..aae395d0d8a 100644 --- a/reactos/subsys/system/cmd/history.c +++ b/reactos/subsys/system/cmd/history.c @@ -193,8 +193,8 @@ VOID del(LPHIST_ENTRY item) if (item==NULL || item==Top || item==Bottom) { #ifdef _DEBUG - DebugPrintf(_T("del in " __FILE__ ": retrning\n" - "item is 0x%08x (Bottom is0x%08x)\n"), + DebugPrintf(_T("del in ") _T(__FILE__) _T(": retrning\n") + _T("item is 0x%08x (Bottom is0x%08x)\n"), item, Bottom); #endif return; diff --git a/reactos/subsys/system/cmd/internal.c b/reactos/subsys/system/cmd/internal.c index 7a2e15af6f6..864261a5144 100644 --- a/reactos/subsys/system/cmd/internal.c +++ b/reactos/subsys/system/cmd/internal.c @@ -276,7 +276,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) TCHAR * tmpPath; TCHAR szCurrent[MAX_PATH]; TCHAR szMsg[RC_STRING_MAX_SIZE]; - INT i; + UINT i; /* Filter out special cases first */ diff --git a/reactos/subsys/system/cmd/precomp.h b/reactos/subsys/system/cmd/precomp.h index 9ccc3eb2dcf..01e18d43434 100644 --- a/reactos/subsys/system/cmd/precomp.h +++ b/reactos/subsys/system/cmd/precomp.h @@ -1,6 +1,5 @@ #include #include -#include #include #include @@ -14,6 +13,9 @@ #include #include +#define NTOS_MODE_USER +#include + #include "cmd.h" #include "config.h" #include "batch.h"