[9/9] wined3d: Comparing BOOLs against FALSE is redundant

H. Verbeet hverbeet at gmail.com
Tue Sep 26 13:31:58 CDT 2006


Changelog:
  - Comparing BOOLs against FALSE is redundant
-------------- next part --------------
---

 dlls/wined3d/cubetexture.c   |    2 +-
 dlls/wined3d/device.c        |   22 +++++++++++-----------
 dlls/wined3d/directx.c       |    4 ++--
 dlls/wined3d/drawprim.c      |    4 ++--
 dlls/wined3d/texture.c       |    2 +-
 dlls/wined3d/utils.c         |    2 +-
 dlls/wined3d/volume.c        |    2 +-
 dlls/wined3d/volumetexture.c |    2 +-
 8 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c
index 8146a72..7af48ba 100644
--- a/dlls/wined3d/cubetexture.c
+++ b/dlls/wined3d/cubetexture.c
@@ -143,7 +143,7 @@ static void WINAPI IWineD3DCubeTextureIm
 
     ENTER_GL();
     /* If were dirty then reload the surfaces */
-    if (This->baseTexture.dirty != FALSE) {
+    if (This->baseTexture.dirty) {
         for (i = 0; i < This->baseTexture.levels; i++) {
             for (j = D3DCUBEMAP_FACE_POSITIVE_X; j <= D3DCUBEMAP_FACE_NEGATIVE_Z ; j++) {
                 if(setGlTextureDesc)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 6b7ecfa..fb7572d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -500,7 +500,7 @@ #undef APPLY_STATE
 
     /* TODO: NV_POINT_SPRITE */
     if (GL_SUPPORT(ARB_POINT_SPRITE)) {
-        if (This->stateBlock->renderState[WINED3DRS_POINTSPRITEENABLE] != FALSE) {
+        if (This->stateBlock->renderState[WINED3DRS_POINTSPRITEENABLE]) {
            /* Doesn't work with GL_POINT_SMOOTH on on my ATI 9600, but then ATI drivers are buggered! */
            glDisable(GL_POINT_SMOOTH);
 
@@ -1059,13 +1059,13 @@ static HRESULT  WINAPI IWineD3DDeviceImp
     * ****************************************/
     switch(Pool) {
     case WINED3DPOOL_SCRATCH:
-        if(Lockable == FALSE)
+        if(!Lockable)
             FIXME("Create suface called with a pool of SCRATCH and a Lockable of FALSE \
                 which are mutually exclusive, setting lockable to true\n");
                 Lockable = TRUE;
     break;
     case WINED3DPOOL_SYSTEMMEM:
-        if(Lockable == FALSE) FIXME("Create surface called with a pool of SYSTEMMEM and a Lockable of FALSE, \
+        if(!Lockable) FIXME("Create surface called with a pool of SYSTEMMEM and a Lockable of FALSE, \
                                     this is acceptable but unexpected (I can't know how the surface can be usable!)\n");
     case WINED3DPOOL_MANAGED:
         if(Usage == WINED3DUSAGE_DYNAMIC) FIXME("Create surface called with a pool of MANAGED and a \
@@ -2859,7 +2859,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     }
 
     /* OK, we now have a light... */
-    if (Enable == FALSE) {
+    if (!Enable) {
 
         /* If we are disabling it, check it was enabled, and
            still only do something if it has assigned a glIndex (which it should have!)   */
@@ -2901,7 +2901,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
             while (pos != NULL && pos->glIndex != -1 && Index < This->maxConcurrentLights) {
 
                 /* Try to remember which index can be replaced if necessary */
-                if (bsf==NULL && pos->lightEnabled == FALSE) {
+                if (bsf==NULL && !pos->lightEnabled) {
                     /* Found a light we can replace, save as best replacement */
                     bsf = pos;
                 }
@@ -5224,7 +5224,7 @@ process_vertices_strided(IWineD3DDeviceI
              *
              */
 
-            if( doClip == FALSE ||
+            if( !doClip ||
                 ( (-rhw -eps < x) && (-rhw -eps < y) && ( -eps < z) &&
                   (x <= rhw + eps) && (y <= rhw + eps ) && (z <= rhw + eps) && 
                   ( rhw > eps ) ) ) {
@@ -5326,7 +5326,7 @@ process_vertices_strided(IWineD3DDeviceI
             if(!color_d) {
                 static BOOL warned = FALSE;
 
-                if(warned == FALSE) {
+                if(!warned) {
                     ERR("No diffuse color in source, but destination has one\n");
                     warned = TRUE;
                 }
@@ -5357,7 +5357,7 @@ process_vertices_strided(IWineD3DDeviceI
             if(!color_s) {
                 static BOOL warned = FALSE;
 
-                if(warned == FALSE) {
+                if(!warned) {
                     ERR("No specular color in source, but destination has one\n");
                     warned = TRUE;
                 }
@@ -7149,7 +7149,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     } else {
         /* Otherwise, set the render target up */
 
-        if (FALSE == This->sceneEnded) {
+        if (!This->sceneEnded) {
             IWineD3DDevice_EndScene(iface);
         }
         TRACE("clearing renderer\n");
@@ -7252,7 +7252,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
         ATI cards don't destroy pbuffers, but as soon as resource releasing callbacks are inplace
         the pSurface can be set to 0 allowing it to be reused from cache **/
         if (This->contextCache[i].Width == width && This->contextCache[i].Height == height
-          && (pbuffer_per_surface == FALSE || This->contextCache[i].pSurface == pSurface || This->contextCache[i].pSurface == NULL)) {
+          && (!pbuffer_per_surface || This->contextCache[i].pSurface == pSurface || This->contextCache[i].pSurface == NULL)) {
             *context = &This->contextCache[i];
             break;
         }
@@ -7762,7 +7762,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
 static HRESULT WINAPI IWineD3DDeviceImpl_SetDialogBoxMode(IWineD3DDevice *iface, BOOL bEnableDialogs) {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
     /** FIXME: always true at the moment **/
-    if(bEnableDialogs == FALSE) {
+    if(!bEnableDialogs) {
         FIXME("(%p) Dialogs cannot be disabled yet\n", This);
     }
     return WINED3D_OK;
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index af27994..fdde6ea 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1272,7 +1272,7 @@ static HRESULT WINAPI IWineD3DImpl_GetAd
         /* FillGLCaps updates gl_info, but we only want to store and
            reuse the values once we have a context which is valid. Values from
            a temporary context may differ from the final ones                 */
-        if (isGLInfoValid == FALSE) {
+        if (!isGLInfoValid) {
             WineD3D_Context *fake_ctx = NULL;
             if (glXGetCurrentContext() == NULL) fake_ctx = WineD3D_CreateFakeGLContext();
             /* If we don't know the device settings, go query them now */
@@ -1816,7 +1816,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDe
     /* FIXME: both the gl_info and the shader_mode should be made per adapter */
 
     /* If we don't know the device settings, go query them now */
-    if (This->isGLInfoValid == FALSE) {
+    if (!This->isGLInfoValid) {
         /* use the desktop window to fill gl caps */
         BOOL rc = IWineD3DImpl_FillGLCaps(iface, IWineD3DImpl_GetAdapterDisplay(iface, Adapter));
 
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index ff465a8..c9b14a0 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -109,8 +109,8 @@ static void init_materials(IWineD3DDevic
         This->tracking_color = IS_TRACKING;
         requires_material_reset = TRUE; /* Restore material settings as will be used */
 
-    } else if ((This->tracking_color == IS_TRACKING && isDiffuseSupplied == FALSE) ||
-               (This->tracking_color == NEEDS_TRACKING && isDiffuseSupplied == FALSE)) {
+    } else if ((This->tracking_color == IS_TRACKING && !isDiffuseSupplied) ||
+               (This->tracking_color == NEEDS_TRACKING && !isDiffuseSupplied)) {
         /* If we are tracking the current color but one isn't supplied, don't! */
         glDisable(GL_COLOR_MATERIAL);
         checkGLcall("glDisable GL_COLOR_MATERIAL");
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 2e1e65d..190d7ed 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -124,7 +124,7 @@ static void WINAPI IWineD3DTextureImpl_P
     IWineD3DTexture_BindTexture(iface);
     ENTER_GL();
         /* If were dirty then reload the surfaces */
-    if(This->baseTexture.dirty != FALSE) {
+    if(This->baseTexture.dirty) {
 
         for (i = 0; i < This->baseTexture.levels; i++) {
             if(setGlTextureDesc)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 2d072fa..138de01 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -1663,7 +1663,7 @@ #define GLINFO_LOCATION ((IWineD3DImpl *
 
                 /*FIXME("Stage %d matrix is (%.2f,%.2f),(%.2f,%.2f)\n", Stage, m[0][0], m[0][1], m[1][0], m[1][0]);*/
 
-                if (FALSE == This->texture_shader_active) {
+                if (!This->texture_shader_active) {
                   This->texture_shader_active = TRUE;
                   glEnable(GL_TEXTURE_SHADER_NV);
                 }
diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c
index 5a10b13..7eb9694 100644
--- a/dlls/wined3d/volume.c
+++ b/dlls/wined3d/volume.c
@@ -223,7 +223,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl
 
 static HRESULT WINAPI IWineD3DVolumeImpl_UnlockBox(IWineD3DVolume *iface) {
     IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
-    if (FALSE == This->locked) {
+    if (!This->locked) {
       ERR("trying to lock unlocked volume@%p\n", This);
       return WINED3DERR_INVALIDCALL;
     }
diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c
index f754f00..b88ab09 100644
--- a/dlls/wined3d/volumetexture.c
+++ b/dlls/wined3d/volumetexture.c
@@ -120,7 +120,7 @@ static void WINAPI IWineD3DVolumeTexture
 
     ENTER_GL();
     /* If were dirty then reload the volumes */
-    if(This->baseTexture.dirty != FALSE) {
+    if(This->baseTexture.dirty) {
         for (i = 0; i < This->baseTexture.levels; i++) {
             IWineD3DVolume_LoadTexture(This->volumes[i], i);
         }


More information about the wine-patches mailing list