Author: cfinck Date: Sat May 17 03:49:39 2008 New Revision: 33545
URL: http://svn.reactos.org/svn/reactos?rev=33545&view=rev Log: - Fix some warnings spotted by MSVC - Define cmd_exit to ExitProcess if _DEBUG_MEM is not defined. Fixes compilation, when _DEBUG_MEM is turned off.
Modified: trunk/reactos/base/shell/cmd/cmddbg.h trunk/reactos/base/shell/cmd/cmdinput.c trunk/reactos/base/shell/cmd/dir.c trunk/reactos/base/shell/cmd/filecomp.c trunk/reactos/base/shell/cmd/internal.c
Modified: trunk/reactos/base/shell/cmd/cmddbg.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmddbg.h?rev... ============================================================================== --- trunk/reactos/base/shell/cmd/cmddbg.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/cmddbg.h [iso-8859-1] Sat May 17 03:49:39 2008 @@ -31,5 +31,6 @@ #define cmd_free(ptr) free(ptr) #define cmd_dup(str) _tcsdup(str) #define cmd_checkbuffer(ptr) +#define cmd_exit(code) ExitProcess(code)
#endif
Modified: trunk/reactos/base/shell/cmd/cmdinput.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmdinput.c?r... ============================================================================== --- trunk/reactos/base/shell/cmd/cmdinput.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/cmdinput.c [iso-8859-1] Sat May 17 03:49:39 2008 @@ -518,7 +518,7 @@ else { LPCTSTR last = PeekHistory(-1); - if (last && charcount < _tcslen (last)) + if (last && charcount < (INT)_tcslen (last)) { PreviousChar = last[current]; ConOutChar(PreviousChar);
Modified: trunk/reactos/base/shell/cmd/dir.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/dir.c?rev=33... ============================================================================== --- trunk/reactos/base/shell/cmd/dir.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/dir.c [iso-8859-1] Sat May 17 03:49:39 2008 @@ -1849,7 +1849,7 @@
prev_volume[0] = _T('\0');
- for(loop = 0; loop < entries; loop++) + for(loop = 0; loop < (UINT)entries; loop++) { if (CheckCtrlBreak(BREAK_INPUT)) {
Modified: trunk/reactos/base/shell/cmd/filecomp.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/filecomp.c?r... ============================================================================== --- trunk/reactos/base/shell/cmd/filecomp.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/filecomp.c [iso-8859-1] Sat May 17 03:49:39 2008 @@ -483,8 +483,9 @@ }
} - int __cdecl compare(const void *arg1,const void *arg2) - { + +int __cdecl compare(const void *arg1,const void *arg2) +{ FileName * File1; FileName * File2; INT ret; @@ -503,7 +504,7 @@ cmd_free(File1); cmd_free(File2); return ret; - } +}
VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor) {
Modified: trunk/reactos/base/shell/cmd/internal.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/internal.c?r... ============================================================================== --- trunk/reactos/base/shell/cmd/internal.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/internal.c [iso-8859-1] Sat May 17 03:49:39 2008 @@ -591,7 +591,7 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param) { TCHAR dir[MAX_PATH]; /* pointer to the directory to change to */ - char ch; + TCHAR ch; INT args; LPTSTR *arg = NULL; INT i; @@ -622,20 +622,22 @@ }
dir[0] = 0; + /* check for options anywhere in command line */ for (i = 0; i < args; i++) { - if (*arg[i] == _T('/')) + if (*arg[i] == '/') { /*found a command, but check to make sure it has something after it*/ if (_tcslen (arg[i]) == 2) { ch = _totupper (arg[i][1]); - if (ch == _T('S')) + + if (ch == 'S') { RD_SUB = TRUE; } - else if (ch == _T('Q')) + else if (ch == 'Q') { RD_QUIET = TRUE; } @@ -648,7 +650,7 @@ } }
- if (dir[0] == _T('\0')) + if (dir[0] == '\0') { /* No folder to remove */ ConErrResPuts(STRING_ERROR_REQ_PARAM_MISSING); @@ -657,9 +659,10 @@ }
GetFullPathName(dir,MAX_PATH,szFullPath,NULL); + /* remove trailing \ if any, but ONLY if dir is not the root dir */ - if (_tcslen (szFullPath) >= 2 && szFullPath[_tcslen (szFullPath) - 1] == _T('\')) - szFullPath[_tcslen(szFullPath) - 1] = _T('\0'); + if (_tcslen (szFullPath) >= 2 && szFullPath[_tcslen (szFullPath) - 1] == '\') + szFullPath[_tcslen(szFullPath) - 1] = '\0';
if(RD_SUB) { @@ -695,11 +698,11 @@ FindClose (hFile); nErrorLevel = 1; return 1; - }while (FindNextFile (hFile, &f)); + } while (FindNextFile (hFile, &f)); FindClose (hFile); } /* reovme the \* */ - szFullPath[_tcslen(szFullPath) - 2] = _T('\0'); + szFullPath[_tcslen(szFullPath) - 2] = '\0'; }
if (!DeleteFolder(szFullPath))