Fix msvc warnings

svn path=/trunk/; revision=20877
This commit is contained in:
Alex Ionescu 2006-01-15 00:45:06 +00:00
parent efa50c8848
commit d8b6e8e1a5

View file

@ -45,24 +45,28 @@ LengthOfStrResource(IN HINSTANCE hInst,
lpName = (LPWSTR)MAKEINTRESOURCE((uID >> 4) + 1); lpName = (LPWSTR)MAKEINTRESOURCE((uID >> 4) + 1);
/* Find the string table block */ /* Find the string table block */
if ((hrSrc = FindResourceW(hInst, hrSrc = FindResourceW(hInst, lpName, (LPWSTR)RT_STRING);
lpName, if (hrSrc)
(LPWSTR)RT_STRING)) &&
(hRes = LoadResource(hInst,
hrSrc)) &&
(lpStr = LockResource(hRes)))
{ {
UINT x; hRes = LoadResource(hInst, hrSrc);
if (hRes)
/* Find the string we're looking for */
uID &= 0xF; /* position in the block, same as % 16 */
for (x = 0; x < uID; x++)
{ {
lpStr += (*lpStr) + 1; lpStr = LockResource(hRes);
} if (lpStr)
{
UINT x;
/* Found the string */ /* Find the string we're looking for */
return (int)(*lpStr); uID &= 0xF; /* position in the block, same as % 16 */
for (x = 0; x < uID; x++)
{
lpStr += (*lpStr) + 1;
}
/* Found the string */
return (int)(*lpStr);
}
}
} }
return -1; return -1;
} }
@ -85,10 +89,11 @@ AllocAndLoadString(OUT LPTSTR *lpTarget,
if ((*lpTarget) != NULL) if ((*lpTarget) != NULL)
{ {
INT Ret; INT Ret;
if (!(Ret = LoadString(hInst, Ret = LoadString(hInst,
uID, uID,
*lpTarget, *lpTarget,
ln))) ln);
if (!Ret)
{ {
HeapFree(GetProcessHeap(), HeapFree(GetProcessHeap(),
0, 0,
@ -322,7 +327,7 @@ BuildSidString:
_tprintf(_T("%s\\%s:"), _tprintf(_T("%s\\%s:"),
Domain, Domain,
Name); Name);
IndentAccess = _tcslen(Domain) + _tcslen(Name); IndentAccess = (DWORD)_tcslen(Domain) + _tcslen(Name);
} }
else else
{ {
@ -330,7 +335,7 @@ BuildSidString:
_tprintf(_T("%s:"), _tprintf(_T("%s:"),
DisplayString); DisplayString);
IndentAccess = _tcslen(DisplayString); IndentAccess = (DWORD)_tcslen(DisplayString);
} }
/* print the ACE Flags */ /* print the ACE Flags */
@ -503,9 +508,9 @@ PrintSpecialAccess:
#ifdef _UNICODE #ifdef _UNICODE
int main(void) int __cdecl main(void)
#else #else
int _main (int argc, char *argv[]) int __cdecl _main (int argc, char *argv[])
#endif #endif
{ {
#ifdef _UNICODE #ifdef _UNICODE