- 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.

svn path=/trunk/; revision=33545
This commit is contained in:
Colin Finck 2008-05-17 08:49:39 +00:00
parent 982ea317be
commit 3b1370bd40
5 changed files with 19 additions and 14 deletions

View file

@ -31,5 +31,6 @@ cmd_exit(int code);
#define cmd_free(ptr) free(ptr)
#define cmd_dup(str) _tcsdup(str)
#define cmd_checkbuffer(ptr)
#define cmd_exit(code) ExitProcess(code)
#endif

View file

@ -518,7 +518,7 @@ VOID ReadCommand (LPTSTR str, INT maxlen)
else
{
LPCTSTR last = PeekHistory(-1);
if (last && charcount < _tcslen (last))
if (last && charcount < (INT)_tcslen (last))
{
PreviousChar = last[current];
ConOutChar(PreviousChar);

View file

@ -1849,7 +1849,7 @@ CommandDir(LPTSTR first, LPTSTR rest)
prev_volume[0] = _T('\0');
for(loop = 0; loop < entries; loop++)
for(loop = 0; loop < (UINT)entries; loop++)
{
if (CheckCtrlBreak(BREAK_INPUT))
{

View file

@ -483,8 +483,9 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix)
}
}
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 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix)
cmd_free(File1);
cmd_free(File2);
return ret;
}
}
VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
{

View file

@ -591,7 +591,7 @@ BOOL DeleteFolder(LPTSTR FileName)
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 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
}
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 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
}
}
if (dir[0] == _T('\0'))
if (dir[0] == '\0')
{
/* No folder to remove */
ConErrResPuts(STRING_ERROR_REQ_PARAM_MISSING);
@ -657,9 +659,10 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
}
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 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
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))