From 175eaf10748f424374ca41fa1c4468100148148d Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Wed, 8 Aug 2012 21:00:22 +0200 Subject: [PATCH] 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 710ef791119..a72f897a4bf 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 bfd5d5ef4c0..d36032f089c 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 a7722ee0efd..c5b6d918229 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 b920b9aaf5b..2e316f77209 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 382161ceae7..c26d70e6063 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 79de8aaaf78..d8fe6358bf3 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) { -- 2.11.4.GIT