shell32: Avoid TRUE:FALSE conditional expressions.

This commit is contained in:
Michael Stefaniuc 2012-08-13 11:42:29 +02:00 committed by Alexandre Julliard
parent 4d28aedaf8
commit 563d229b5f
5 changed files with 10 additions and 21 deletions

View File

@ -1024,7 +1024,7 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
case BFFM_ENABLEOK:
TRACE("Enable %ld\n", lParam);
EnableWindow(GetDlgItem(hWnd, 1), (lParam)?TRUE:FALSE);
EnableWindow(GetDlgItem(hWnd, 1), lParam != 0);
break;
case BFFM_SETOKTEXT: /* unicode only */

View File

@ -1814,7 +1814,7 @@ BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
{
TRACE("(%p)\n",pidl);
return pidl && pidl->mkid.cb ? FALSE : TRUE;
return !pidl || !pidl->mkid.cb;
}
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)

View File

@ -2855,12 +2855,8 @@ BOOL WINAPI SHGetSpecialFolderPathA (
int nFolder,
BOOL bCreate)
{
return (SHGetFolderPathA(
hwndOwner,
nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0),
NULL,
0,
szPath)) == S_OK ? TRUE : FALSE;
return SHGetFolderPathA(hwndOwner, nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0), NULL, 0,
szPath) == S_OK;
}
/*************************************************************************
@ -2872,12 +2868,8 @@ BOOL WINAPI SHGetSpecialFolderPathW (
int nFolder,
BOOL bCreate)
{
return (SHGetFolderPathW(
hwndOwner,
nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0),
NULL,
0,
szPath)) == S_OK ? TRUE : FALSE;
return SHGetFolderPathW(hwndOwner, nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0), NULL, 0,
szPath) == S_OK;
}
/*************************************************************************

View File

@ -1705,10 +1705,7 @@ ISFDropTarget_DragEnter (IDropTarget * iface, IDataObject * pDataObject,
TRACE ("(%p)->(DataObject=%p)\n", This, pDataObject);
InitFormatEtc (fmt, This->cfShellIDList, TYMED_HGLOBAL);
This->fAcceptFmt = (S_OK == IDataObject_QueryGetData (pDataObject, &fmt)) ?
TRUE : FALSE;
This->fAcceptFmt = IDataObject_QueryGetData (pDataObject, &fmt) == S_OK;
ISFDropTarget_QueryDrop (iface, dwKeyState, pdwEffect);
return S_OK;

View File

@ -290,9 +290,9 @@ static void CheckToolbar(IShellViewImpl * This)
if (IsInCommDlg(This))
{
IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON,
FCIDM_TB_SMALLICON, (This->FolderSettings.ViewMode==FVM_LIST)? TRUE : FALSE, &result);
FCIDM_TB_SMALLICON, This->FolderSettings.ViewMode == FVM_LIST, &result);
IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON,
FCIDM_TB_REPORTVIEW, (This->FolderSettings.ViewMode==FVM_DETAILS)? TRUE : FALSE, &result);
FCIDM_TB_REPORTVIEW, This->FolderSettings.ViewMode == FVM_DETAILS, &result);
IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON,
FCIDM_TB_SMALLICON, TRUE, &result);
IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON,
@ -606,7 +606,7 @@ static BOOLEAN LV_AddItem(IShellViewImpl * This, LPCITEMIDLIST pidl)
lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidl)); /*set the item's data*/
lvItem.pszText = LPSTR_TEXTCALLBACKW; /*get text on a callback basis*/
lvItem.iImage = I_IMAGECALLBACK; /*get the image on a callback basis*/
return (-1==ListView_InsertItemW(This->hWndList, &lvItem))? FALSE: TRUE;
return ListView_InsertItemW(This->hWndList, &lvItem) != -1;
}
/**********************************************************