Fix MSVC / 64 bit warnings

svn path=/trunk/; revision=56258
This commit is contained in:
Timo Kreuzer 2012-03-28 09:50:04 +00:00
parent 82c185ae72
commit 00b699d98b
12 changed files with 30 additions and 28 deletions

View file

@ -817,7 +817,7 @@ TCHAR* getExt(const TCHAR* file)
static LPTSTR
getName(const TCHAR* file, TCHAR * dest)
{
int iLen;
INT_PTR iLen;
LPTSTR end;
/* Check for "." and ".." folders */
@ -919,7 +919,7 @@ DirPrintWideList(LPWIN32_FIND_DATA ptrFiles[], /* [IN] Files' Info */
SHORT iScreenWidth;
USHORT iColumns;
USHORT iLines;
UINT iLongestName;
UINT_PTR iLongestName;
TCHAR szTempFname[MAX_PATH];
DWORD i;
DWORD j;
@ -944,7 +944,7 @@ DirPrintWideList(LPWIN32_FIND_DATA ptrFiles[], /* [IN] Files' Info */
/* Count the highest number of columns */
GetScreenSize(&iScreenWidth, 0);
iColumns = iScreenWidth / iLongestName;
iColumns = (USHORT)(iScreenWidth / iLongestName);
/* Check if there is enough space for spaces between names */
if (((iLongestName * iColumns) + iColumns) >= (UINT)iScreenWidth)
@ -1301,7 +1301,7 @@ QsortFiles(LPWIN32_FIND_DATA ptrArray[], /* [IN/OUT] The array with file info po
static INT
DirList(LPTSTR szPath, /* [IN] The path that dir starts */
LPDIRSWITCHFLAGS lpFlags) /* [IN] The flags of the listing */
{
{
BOOL fPoint; /* If szPath is a file with extension fPoint will be True*/
HANDLE hSearch; /* The handle of the search */
HANDLE hRecSearch; /* The handle for searching recursivly */

View file

@ -509,7 +509,7 @@ int __cdecl compare(const void *arg1,const void *arg2)
VOID CompleteFilename (LPTSTR strIN, BOOL bNext, LPTSTR strOut, UINT cusor)
{
/* Length of string before we complete it */
INT StartLength;
INT_PTR StartLength;
/* Length of string after completed */
//INT EndLength;
/* The number of chars added too it */

View file

@ -94,15 +94,15 @@ static BOOL Exiting(PARSED_COMMAND *Cmd)
* dynamically allocating enough space to hold it all */
static LPTSTR ReadFileContents(FILE *InputFile, TCHAR *Buffer)
{
DWORD Len = 0;
DWORD AllocLen = 1000;
SIZE_T Len = 0;
SIZE_T AllocLen = 1000;
LPTSTR Contents = cmd_alloc(AllocLen * sizeof(TCHAR));
if (!Contents)
return NULL;
while (_fgetts(Buffer, CMDLINE_LENGTH, InputFile))
{
DWORD CharsRead = _tcslen(Buffer);
ULONG_PTR CharsRead = _tcslen(Buffer);
while (Len + CharsRead >= AllocLen)
{
Contents = cmd_realloc(Contents, (AllocLen *= 2) * sizeof(TCHAR));

View file

@ -80,7 +80,7 @@ INT cmd_goto (LPTSTR param)
while (BatchGetString (textline, sizeof(textline) / sizeof(textline[0])))
{
int pos;
int size;
INT_PTR size;
/* Strip out any trailing spaces or control chars */
tmp = textline + _tcslen (textline) - 1;
@ -93,7 +93,7 @@ INT cmd_goto (LPTSTR param)
tmp = textline;
while (_istspace (*tmp))
tmp++;
/* All space after leading space terminate the string */
size = _tcslen(tmp) -1;
pos=0;

View file

@ -281,7 +281,7 @@ MakeFullPath(TCHAR * DirPath)
{
TCHAR path[MAX_PATH];
TCHAR *p = DirPath;
INT n;
INT_PTR n;
if (CreateDirectory(DirPath, NULL))
return TRUE;

View file

@ -281,7 +281,7 @@ LPTSTR *split (LPTSTR s, LPINT args, BOOL expand_wildcards)
LPTSTR start;
LPTSTR q;
INT ac;
INT len;
INT_PTR len;
arg = cmd_alloc (sizeof (LPTSTR));
if (!arg)
@ -360,7 +360,7 @@ LPTSTR *splitspace (LPTSTR s, LPINT args)
LPTSTR start;
LPTSTR q;
INT ac;
INT len;
INT_PTR len;
arg = cmd_alloc (sizeof (LPTSTR));
if (!arg)
@ -505,7 +505,7 @@ BOOL FileGetString (HANDLE hFile, LPTSTR lpBuffer, INT nBufferLength)
len = dwRead;
if (end)
{
len = (end - lpString) + 1;
len = (INT)(end - lpString) + 1;
SetFilePointer(hFile, len - dwRead, NULL, FILE_CURRENT);
}
}

View file

@ -81,22 +81,22 @@ static BOOL CreateJunction(LPCTSTR LinkName, LPCTSTR TargetName)
if (hJunction != INVALID_HANDLE_VALUE)
{
/* Allocate a buffer large enough to hold both strings, including trailing NULs */
DWORD TargetLen = wcslen(TargetFullPathW) * sizeof(WCHAR);
DWORD DataSize = FIELD_OFFSET(REPARSE_DATA_BUFFER, MountPointReparseBuffer.PathBuffer)
+ TargetNTPath.Length + sizeof(WCHAR)
+ TargetLen + sizeof(WCHAR);
SIZE_T TargetLen = wcslen(TargetFullPathW) * sizeof(WCHAR);
DWORD DataSize = (DWORD)(FIELD_OFFSET(REPARSE_DATA_BUFFER, MountPointReparseBuffer.PathBuffer)
+ TargetNTPath.Length + sizeof(WCHAR)
+ TargetLen + sizeof(WCHAR));
PREPARSE_DATA_BUFFER Data = _alloca(DataSize);
/* Fill it out and use it to turn the directory into a reparse point */
Data->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
Data->ReparseDataLength = DataSize - FIELD_OFFSET(REPARSE_DATA_BUFFER, MountPointReparseBuffer);
Data->ReparseDataLength = (WORD)(DataSize - FIELD_OFFSET(REPARSE_DATA_BUFFER, MountPointReparseBuffer));
Data->Reserved = 0;
Data->MountPointReparseBuffer.SubstituteNameOffset = 0;
Data->MountPointReparseBuffer.SubstituteNameLength = TargetNTPath.Length;
wcscpy(Data->MountPointReparseBuffer.PathBuffer,
TargetNTPath.Buffer);
Data->MountPointReparseBuffer.PrintNameOffset = TargetNTPath.Length + sizeof(WCHAR);
Data->MountPointReparseBuffer.PrintNameLength = TargetLen;
Data->MountPointReparseBuffer.PrintNameLength = (USHORT)TargetLen;
wcscpy((WCHAR *)((BYTE *)Data->MountPointReparseBuffer.PathBuffer
+ Data->MountPointReparseBuffer.PrintNameOffset),
TargetFullPathW);

View file

@ -435,7 +435,7 @@ INT cmd_move (LPTSTR param)
if (nDirLevel > 0)
{
TCHAR szTempPath[MAX_PATH];
INT nDiff;
INT_PTR nDiff;
FoundFile = TRUE; /* we need to continue our seek for files */
nDirLevel--;

View file

@ -411,7 +411,7 @@ condition_done:
return Cmd;
}
/* Parse a FOR command.
/* Parse a FOR command.
* Syntax is: FOR [options] %var IN (list) DO command */
static PARSED_COMMAND *ParseFor(void)
{
@ -536,7 +536,7 @@ static DECLSPEC_NOINLINE PARSED_COMMAND *ParseCommandPart(REDIRECTION *RedirList
PARSED_COMMAND *(*Func)(void);
TCHAR *Pos = _stpcpy(ParsedLine, CurrentToken) + 1;
DWORD TailOffset = Pos - ParsedLine;
DWORD_PTR TailOffset = Pos - ParsedLine;
/* Check for special forms */
if ((Func = ParseFor, _tcsicmp(ParsedLine, _T("for")) == 0) ||

View file

@ -203,7 +203,8 @@ INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *d
INT recReplace(DWORD dwFlags, TCHAR szSrcPath[MAX_PATH], TCHAR szDestPath[MAX_PATH], BOOL *doMore)
{
TCHAR tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH];
INT filesReplaced=0, i;
INT filesReplaced=0;
INT_PTR i;
DWORD dwAttrib = 0;
HANDLE hFile;
WIN32_FIND_DATA findBuffer;
@ -298,7 +299,8 @@ INT recFindSubDirs(DWORD dwFlags,
HANDLE hFile;
WIN32_FIND_DATA findBuffer;
TCHAR tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH];
INT filesReplaced = 0, i;
INT filesReplaced = 0;
INT_PTR i;
/* Add a wildcard to dest end so the it will be easy to itterate
over all the files and directorys in the dest directory */

View file

@ -212,7 +212,7 @@ ident_len ( LPCTSTR p )
while ( __iscsym(*p2) )
++p2;
}
return p2-p;
return (INT)(p2-p);
}
#define PARSE_IDENT(ident,identlen,p) \

View file

@ -36,7 +36,7 @@ VOID ShortVersion (VOID)
if (GetVersionEx(&VersionInfo))
{
LPTSTR RosVersion;
unsigned RosVersionLen;
SIZE_T RosVersionLen;
RosVersion = VersionInfo.szCSDVersion + _tcslen(VersionInfo.szCSDVersion) + 1;
RosVersionLen = sizeof(VersionInfo.szCSDVersion) / sizeof(VersionInfo.szCSDVersion[0]) -
@ -76,7 +76,7 @@ INT cmd_ver (LPTSTR param)
{
ConOutPuts (_T("Copyright (C) 1994-1998 Tim Norman and others."));
ConOutPuts (_T("Copyright (C) 1998-") _T(COPYRIGHT_YEAR) _T(" ReactOS Team"));
ConOutPuts (_T("Copyright (C) 1998-") _T(COPYRIGHT_YEAR) _T(" ReactOS Team"));
for (i = 0; param[i]; i++)
{