[PATCH 3/4] wined3d: Get rid of redundant comparisons against FALSE.

Henri Verbeet hverbeet at codeweavers.com
Tue Sep 14 06:38:40 CDT 2010


---
 dlls/wined3d/arb_program_shader.c |    2 +-
 dlls/wined3d/swapchain.c          |    3 ++-
 dlls/wined3d/swapchain_gdi.c      |    3 ++-
 dlls/wined3d/utils.c              |    3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index c1927b0..05ff012 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5313,7 +5313,7 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio
 
         bool_const = get_bool_const(ins, This, ins->src[0].reg.idx);
         if(ins->src[0].modifiers == WINED3DSPSM_NOT) bool_const = !bool_const;
-        if(!priv->muted && bool_const == FALSE)
+        if (!priv->muted && !bool_const)
         {
             shader_addline(buffer, "#if(FALSE){\n");
             priv->muted = TRUE;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index c9ec815..35558ad 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -81,7 +81,8 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface)
      * this will be the original desktop resolution. In case of d3d7 this will be a NOP because ddraw sets the resolution
      * before starting up Direct3D, thus orig_width and orig_height will be equal to the modes in the presentation params
      */
-    if(This->presentParms.Windowed == FALSE && This->presentParms.AutoRestoreDisplayMode) {
+    if (!This->presentParms.Windowed && This->presentParms.AutoRestoreDisplayMode)
+    {
         mode.Width = This->orig_width;
         mode.Height = This->orig_height;
         mode.RefreshRate = 0;
diff --git a/dlls/wined3d/swapchain_gdi.c b/dlls/wined3d/swapchain_gdi.c
index 250485b..8920cae 100644
--- a/dlls/wined3d/swapchain_gdi.c
+++ b/dlls/wined3d/swapchain_gdi.c
@@ -65,7 +65,8 @@ static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface)
      * this will be the original desktop resolution. In case of d3d7 this will be a NOP because ddraw sets the resolution
      * before starting up Direct3D, thus orig_width and orig_height will be equal to the modes in the presentation params
      */
-    if(This->presentParms.Windowed == FALSE && This->presentParms.AutoRestoreDisplayMode) {
+    if (!This->presentParms.Windowed && This->presentParms.AutoRestoreDisplayMode)
+    {
         mode.Width = This->orig_width;
         mode.Height = This->orig_height;
         mode.RefreshRate = 0;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 6cc154e..8760ce6 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -2880,7 +2880,8 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting
         memset(&settings->op[i], 0xff, sizeof(settings->op[i]));
     }
 
-    if(stateblock->renderState[WINED3DRS_FOGENABLE] == FALSE) {
+    if (!stateblock->renderState[WINED3DRS_FOGENABLE])
+    {
         settings->fog = FOG_OFF;
     } else if(stateblock->renderState[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE) {
         if(use_vs(stateblock) || ((IWineD3DVertexDeclarationImpl *) stateblock->vertexDecl)->position_transformed) {
-- 
1.7.1




More information about the wine-patches mailing list