mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 782252 - Cast some nsresult to bool where the function really returns bool; r=ehsan
This commit is contained in:
parent
0a8f6b4783
commit
105b55a935
@ -723,7 +723,8 @@ AppendRequestsToISupportsArray(PLDHashTable *table, PLDHashEntryHdr *hdr,
|
||||
RequestMapEntry *e = static_cast<RequestMapEntry *>(hdr);
|
||||
nsISupportsArray *array = static_cast<nsISupportsArray *>(arg);
|
||||
|
||||
bool ok = array->AppendElement(e->mKey);
|
||||
// nsISupportsArray::AppendElement returns a bool disguised as nsresult
|
||||
bool ok = static_cast<bool>(array->AppendElement(e->mKey));
|
||||
|
||||
if (!ok) {
|
||||
return PL_DHASH_STOP;
|
||||
|
@ -280,7 +280,9 @@ nsDirectoryService::RealInit()
|
||||
if (!defaultProvider)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
// AppendElement returns true for success.
|
||||
rv = ((nsDirectoryService*) self)->mProviders->AppendElement(defaultProvider) ? NS_OK : NS_ERROR_FAILURE;
|
||||
rv = static_cast<bool>(((nsDirectoryService*) self)
|
||||
->mProviders->AppendElement(defaultProvider))
|
||||
? NS_OK : NS_ERROR_FAILURE;
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
@ -488,7 +490,8 @@ nsDirectoryService::RegisterProvider(nsIDirectoryServiceProvider *prov)
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// AppendElement returns true for success.
|
||||
return mProviders->AppendElement(supports) ? NS_OK : NS_ERROR_FAILURE;
|
||||
return static_cast<bool>(mProviders->AppendElement(supports))
|
||||
? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
void
|
||||
@ -536,7 +539,8 @@ nsDirectoryService::UnregisterProvider(nsIDirectoryServiceProvider *prov)
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// RemoveElement returns true for success.
|
||||
return mProviders->RemoveElement(supports) ? NS_OK : NS_ERROR_FAILURE;
|
||||
return static_cast<bool>(mProviders->RemoveElement(supports))
|
||||
? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// DO NOT ADD ANY LOCATIONS TO THIS FUNCTION UNTIL YOU TALK TO: dougt@netscape.com.
|
||||
|
Loading…
Reference in New Issue
Block a user