Michael Stefaniuc : comctl32: Avoid TRUE:FALSE conditional expressions.

Alexandre Julliard julliard at winehq.org
Mon Aug 13 13:21:20 CDT 2012


Module: wine
Branch: master
Commit: 175eaf10748f424374ca41fa1c4468100148148d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=175eaf10748f424374ca41fa1c4468100148148d

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Wed Aug  8 21:00:22 2012 +0200

comctl32: Avoid TRUE:FALSE conditional expressions.

---

 dlls/comctl32/comboex.c         |    2 +-
 dlls/comctl32/datetime.c        |    2 +-
 dlls/comctl32/monthcal.c        |    4 ++--
 dlls/comctl32/tests/imagelist.c |    2 +-
 dlls/comctl32/toolbar.c         |    2 +-
 dlls/comctl32/treeview.c        |    2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c
index 710ef79..a72f897 100644
--- a/dlls/comctl32/comboex.c
+++ b/dlls/comctl32/comboex.c
@@ -720,7 +720,7 @@ COMBOEX_SetExtendedStyle (COMBOEX_INFO *infoPtr, DWORD mask, DWORD style)
     /* see if we need to change the word break proc on the edit */
     if ((infoPtr->dwExtStyle ^ dwTemp) & CBES_EX_PATHWORDBREAKPROC)
         SetPathWordBreakProc(infoPtr->hwndEdit, 
-            (infoPtr->dwExtStyle & CBES_EX_PATHWORDBREAKPROC) ? TRUE : FALSE);
+            (infoPtr->dwExtStyle & CBES_EX_PATHWORDBREAKPROC) != 0);
 
     /* test if the control's appearance has changed */
     mask = CBES_EX_NOEDITIMAGE | CBES_EX_NOEDITIMAGEINDENT;
diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index bfd5d5e..d36032f 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -586,7 +586,7 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
 
     /* Ensure time is within bounds */
     limits = SendMessageW (infoPtr->hMonthCal, MCM_GETRANGE, 0, (LPARAM) &range);
-    min = ((delta < 0) ? TRUE : FALSE);
+    min = delta < 0;
 
     if (limits & (min ? GDTR_MIN : GDTR_MAX))
     {
diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index a7722ee..c5b6d91 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -372,7 +372,7 @@ static BOOL MONTHCAL_IsDateInValidRange(const MONTHCAL_INFO *infoPtr,
     date->wMonth = fix_st->wMonth;
   }
 
-  return fix_st ? FALSE : TRUE;
+  return !fix_st;
 }
 
 /* Checks passed range width with configured maximum selection count
@@ -1276,7 +1276,7 @@ MONTHCAL_SetColor(MONTHCAL_INFO *infoPtr, UINT index, COLORREF color)
     infoPtr->pens[PenText] = CreatePen(PS_SOLID, 1, infoPtr->colors[index]);
   }
 
-  InvalidateRect(infoPtr->hwndSelf, NULL, index == MCSC_BACKGROUND ? TRUE : FALSE);
+  InvalidateRect(infoPtr->hwndSelf, NULL, index == MCSC_BACKGROUND);
   return prev;
 }
 
diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c
index b920b9a..2e316f7 100644
--- a/dlls/comctl32/tests/imagelist.c
+++ b/dlls/comctl32/tests/imagelist.c
@@ -619,7 +619,7 @@ static BOOL allocate_storage(struct my_IStream *my_is, ULONG add)
     else
         my_is->iml_data = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, my_is->iml_data, my_is->iml_data_size);
 
-    return my_is->iml_data ? TRUE : FALSE;
+    return my_is->iml_data != NULL;
 }
 
 static HRESULT STDMETHODCALLTYPE Test_Stream_Write(IStream *iface, const void *pv, ULONG cb,
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 382161c..c26d70e 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -3140,7 +3140,7 @@ TOOLBAR_CheckButton (TOOLBAR_INFO *infoPtr, INT Id, LPARAM lParam)
 
     btnPtr = &infoPtr->buttons[nIndex];
 
-    bChecked = (btnPtr->fsState & TBSTATE_CHECKED) ? TRUE : FALSE;
+    bChecked = (btnPtr->fsState & TBSTATE_CHECKED) != 0;
 
     if (LOWORD(lParam) == FALSE)
 	btnPtr->fsState &= ~TBSTATE_CHECKED;
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 79de8aa..d8fe635 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -1612,7 +1612,7 @@ TREEVIEW_DeleteItem(TREEVIEW_INFO *infoPtr, HTREEITEM item)
 static LRESULT
 TREEVIEW_SetRedraw(TREEVIEW_INFO* infoPtr, WPARAM wParam)
 {
-    infoPtr->bRedraw = wParam ? TRUE : FALSE;
+    infoPtr->bRedraw = wParam != 0;
 
     if (infoPtr->bRedraw)
     {




More information about the wine-cvs mailing list