- Fix multiple typos and bugs, found by PVS-Studio

svn path=/trunk/; revision=53519
This commit is contained in:
Dmitry Chapyshev 2011-09-01 15:30:19 +00:00
parent 72aa51ee36
commit 74b3d51978
12 changed files with 17 additions and 17 deletions

View file

@ -766,7 +766,7 @@ WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
isnew = TRUE; isnew = TRUE;
display_dur = TRUE; display_dur = TRUE;
ZeroMemory( file_path, MAX_PATH ); ZeroMemory( file_path, MAX_PATH * sizeof(TCHAR) );
EnableWindow( slider, FALSE ); EnableWindow( slider, FALSE );

View file

@ -441,7 +441,7 @@ SmCreateClient (PRTL_USER_PROCESS_INFORMATION ProcessInfo, PWSTR ProgramName)
*/ */
RtlCopyMemory (SmpClientDirectory.CandidateClient->ProgramName, RtlCopyMemory (SmpClientDirectory.CandidateClient->ProgramName,
ProgramName, ProgramName,
SM_SB_NAME_MAX_LENGTH); SM_SB_NAME_MAX_LENGTH * sizeof(WCHAR));
} }
} else { } else {
DPRINT1("SM: %s: CandidateClient %p pending!\n", __FUNCTION__, DPRINT1("SM: %s: CandidateClient %p pending!\n", __FUNCTION__,

View file

@ -450,7 +450,7 @@ AddScreenSavers(HWND hwndDlg, PDATA pData)
lpBackSlash = _tcsrchr(szSearchPath, _T('\\')); lpBackSlash = _tcsrchr(szSearchPath, _T('\\'));
if (lpBackSlash != NULL) if (lpBackSlash != NULL)
{ {
lpBackSlash = '\0'; *lpBackSlash = '\0';
SearchScreenSavers(hwndScreenSavers, szSearchPath, pData); SearchScreenSavers(hwndScreenSavers, szSearchPath, pData);
} }
} }

View file

@ -719,7 +719,7 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::Exec(const GUID *pguidCmdGroup, DWORD n
if (fRebarWindow == NULL) if (fRebarWindow == NULL)
return E_FAIL; return E_FAIL;
if (IsEqualIID(pguidCmdGroup, IID_IDeskBand)) if (IsEqualIID(*pguidCmdGroup, IID_IDeskBand))
{ {
switch (nCmdID) switch (nCmdID)
{ {

View file

@ -90,7 +90,7 @@ Mapdesc::setBboxsize( INREAL *mat )
} }
void void
Mapdesc::identify( REAL dest[MAXCOORDS][MAXCOORDS] ) Mapdesc::identify( REAL (&dest)[MAXCOORDS][MAXCOORDS] )
{ {
memset( dest, 0, sizeof( dest ) ); memset( dest, 0, sizeof( dest ) );
for( int i=0; i != hcoords; i++ ) for( int i=0; i != hcoords; i++ )

View file

@ -317,7 +317,7 @@ static int ctl2_find_guid(
while (offset != -1) { while (offset != -1) {
guidentry = (MSFT_GuidEntry *)&This->typelib_segment_data[MSFT_SEG_GUID][offset]; guidentry = (MSFT_GuidEntry *)&This->typelib_segment_data[MSFT_SEG_GUID][offset];
if (IsEqualGUID(guidentry, guid)) return offset; if (IsEqualGUID(*guidentry, guid)) return offset;
offset = guidentry->next_hash; offset = guidentry->next_hash;
} }

View file

@ -563,7 +563,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
} }
/* Clean up state data: */ /* Clean up state data: */
MEMSET_BZERO(context, sizeof(context)); MEMSET_BZERO(context, sizeof(*context));
usedspace = 0; usedspace = 0;
} }
@ -584,7 +584,7 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) {
} }
*buffer = 0; *buffer = 0;
} else { } else {
MEMSET_BZERO(context, sizeof(context)); MEMSET_BZERO(context, sizeof(*context));
} }
MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH); MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH);
return buffer; return buffer;
@ -893,7 +893,7 @@ void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
} }
/* Zero out state data */ /* Zero out state data */
MEMSET_BZERO(context, sizeof(context)); MEMSET_BZERO(context, sizeof(*context));
} }
char *SHA512_End(SHA512_CTX* context, char buffer[]) { char *SHA512_End(SHA512_CTX* context, char buffer[]) {
@ -913,7 +913,7 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) {
} }
*buffer = 0; *buffer = 0;
} else { } else {
MEMSET_BZERO(context, sizeof(context)); MEMSET_BZERO(context, sizeof(*context));
} }
MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH);
return buffer; return buffer;
@ -968,7 +968,7 @@ void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
} }
/* Zero out state data */ /* Zero out state data */
MEMSET_BZERO(context, sizeof(context)); MEMSET_BZERO(context, sizeof(*context));
} }
char *SHA384_End(SHA384_CTX* context, char buffer[]) { char *SHA384_End(SHA384_CTX* context, char buffer[]) {
@ -988,7 +988,7 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) {
} }
*buffer = 0; *buffer = 0;
} else { } else {
MEMSET_BZERO(context, sizeof(context)); MEMSET_BZERO(context, sizeof(*context));
} }
MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH);
return buffer; return buffer;

View file

@ -1157,7 +1157,7 @@ HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
if (len < sizeof(WIN32_FIND_DATAW)) if (len < sizeof(WIN32_FIND_DATAW))
return E_INVALIDARG; return E_INVALIDARG;
ZeroMemory(pfd, sizeof (WIN32_FIND_DATAA)); ZeroMemory(pfd, sizeof (WIN32_FIND_DATAW));
_ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime)); _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0); pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0); pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);

View file

@ -1607,7 +1607,7 @@ l_ATA_SILICON_IMAGE_ID:
{ 0xc2, 0x82, 0x042, 0x8a, 0x4a, 0x0a } }; { 0xc2, 0x82, 0x042, 0x8a, 0x4a, 0x0a } };
static const UCHAR cmd_wdma_modes[] = { 0x87, 0x32, 0x3f }; static const UCHAR cmd_wdma_modes[] = { 0x87, 0x32, 0x3f };
static const UCHAR cmd_pio_modes[] = { 0xa9, 0x57, 0x44, 0x32, 0x3f }; static const UCHAR cmd_pio_modes[] = { 0xa9, 0x57, 0x44, 0x32, 0x3f };
ULONG treg = 0x54 + (dev < 3) ? (dev << 1) : 7; ULONG treg = 0x54 + ((dev < 3) ? (dev << 1) : 7);
udmamode = min(udmamode, 5); udmamode = min(udmamode, 5);
/* enable UDMA mode */ /* enable UDMA mode */

View file

@ -118,7 +118,7 @@ CmGetSystemControlValues(IN PVOID SystemHiveData,
if (!SystemHiveData) return; if (!SystemHiveData) return;
/* Initialize the Hive View List and the security cache */ /* Initialize the Hive View List and the security cache */
RtlZeroMemory(SystemHive, sizeof(SystemHive)); RtlZeroMemory(SystemHive, sizeof(*SystemHive));
CmpInitHiveViewList((PCMHIVE)SystemHive); CmpInitHiveViewList((PCMHIVE)SystemHive);
CmpInitSecurityCache((PCMHIVE)SystemHive); CmpInitSecurityCache((PCMHIVE)SystemHive);

View file

@ -298,7 +298,7 @@ IntEngGradientFillRect(
#define SMALLER(a,b) (a->y < b->y) || (a->y == b->y && a->x < b->x) #define SMALLER(a,b) (a->y < b->y) || (a->y == b->y && a->x < b->x)
#define SWAP(a,b,c) c = a;\ #define SWAP(a,b,c) c = a;\
a = b;\ a = b;\
a = c b = c
#define NLINES 3 #define NLINES 3
BOOL FASTCALL BOOL FASTCALL
IntEngGradientFillTriangle( IntEngGradientFillTriangle(

View file

@ -667,7 +667,7 @@ GreStretchBltMask(
MaskPoint.y = YOriginMask; MaskPoint.y = YOriginMask;
IntLPtoDP(DCMask, &MaskPoint, 1); IntLPtoDP(DCMask, &MaskPoint, 1);
MaskPoint.x += DCMask->ptlDCOrig.x; MaskPoint.x += DCMask->ptlDCOrig.x;
MaskPoint.y += DCMask->ptlDCOrig.x; MaskPoint.y += DCMask->ptlDCOrig.y;
} }
/* Perform the bitblt operation */ /* Perform the bitblt operation */