Fix some bugs, reported by GCC.
authorDmitry Gorbachev <gorbachev@reactos.org>
Sat, 25 Jul 2009 07:42:15 +0000 (07:42 +0000)
committerDmitry Gorbachev <gorbachev@reactos.org>
Sat, 25 Jul 2009 07:42:15 +0000 (07:42 +0000)
svn path=/trunk/; revision=42193

rostests/dxtest/ddraw/DDraw/display_modes.cpp
rostests/dxtest/ddraw/Surface/misc.cpp
rostests/tests/regqueryvalue/regqueryvalue.c

index 2b3b24c..3143575 100644 (file)
@@ -24,8 +24,8 @@ HRESULT CALLBACK EnumDisplayModes( LPDDSURFACEDESC2 pDDSD, ENUMCONTEXT* Context
        DDSURFACEDESC2 DisplayMode = {0};
        DisplayMode.dwSize = sizeof(DDSURFACEDESC2);
 
-       TEST ( pDDSD->dwFlags == DDSD_HEIGHT | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_REFRESHRATE);
-       TEST ( pDDSD->ddpfPixelFormat.dwFlags == DDPF_RGB | DDPF_PALETTEINDEXED8 || pDDSD->ddpfPixelFormat.dwFlags == DDPF_RGB );
+       TEST ( pDDSD->dwFlags == (DDSD_HEIGHT | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_REFRESHRATE));
+       TEST ( pDDSD->ddpfPixelFormat.dwFlags == (DDPF_RGB | DDPF_PALETTEINDEXED8) || pDDSD->ddpfPixelFormat.dwFlags == DDPF_RGB );
        TEST ( Context->DirectDraw->SetDisplayMode (pDDSD->dwWidth, pDDSD->dwHeight, pDDSD->ddpfPixelFormat.dwRGBBitCount, pDDSD->dwRefreshRate, 0) == DD_OK);
        TEST ( Context->DirectDraw->GetMonitorFrequency (&lpdwFrequency) == DD_OK && lpdwFrequency == pDDSD->dwRefreshRate);
        TEST ( Context->DirectDraw->GetDisplayMode (&DisplayMode) == DD_OK
@@ -33,7 +33,7 @@ HRESULT CALLBACK EnumDisplayModes( LPDDSURFACEDESC2 pDDSD, ENUMCONTEXT* Context
                && pDDSD->dwWidth == DisplayMode.dwWidth
                && pDDSD->dwRefreshRate == DisplayMode.dwRefreshRate
                && pDDSD->ddpfPixelFormat.dwRGBBitCount == DisplayMode.ddpfPixelFormat.dwRGBBitCount
-               && DisplayMode.dwFlags == DDSD_HEIGHT | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_REFRESHRATE );
+               && DisplayMode.dwFlags == (DDSD_HEIGHT | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_REFRESHRATE) );
 
        setcout++;
        return DDENUMRET_OK;
index 41c13c0..0c323db 100644 (file)
@@ -2,7 +2,7 @@ BOOL CreateSurface(LPDIRECTDRAWSURFACE7* pSurface);
 
 BOOL Test_Misc (INT* passed, INT* failed)
 {
-       LPDIRECTDRAWSURFACE7 Surface;
+    LPDIRECTDRAWSURFACE7 Surface;
     if(!CreateSurface(&Surface))
         return FALSE;
 
@@ -12,7 +12,7 @@ BOOL Test_Misc (INT* passed, INT* failed)
     DDSCAPS2 Caps;
     TEST (Surface->GetCaps((DDSCAPS2*)0xdeadbeef) == DDERR_INVALIDPARAMS);
     TEST (Surface->GetCaps(&Caps) == DD_OK && Caps.dwCaps == 0x10004040
-        && Caps.dwCaps2 == Caps.dwCaps3 == Caps.dwCaps4 == 0); // FIXME: Replace 0x10004040
+          && Caps.dwCaps2 == 0 && Caps.dwCaps3 == 0 && Caps.dwCaps4 == 0); // FIXME: Replace 0x10004040
 
     // GetDC / ReleaseDC
     HDC hdc;
index dd275e6..eae7d30 100644 (file)
@@ -63,7 +63,6 @@ int main( int argc, char **argv ) {
 
   free( WcharResult );
   free( CharResult );
-  free( ValueNameWC );
 
   return 0;
 }