Bug 782252 - Cast some nsresult to PRUint32; r=ehsan

This commit is contained in:
Aryeh Gregor 2012-08-09 11:36:40 +03:00
parent 0af5675bda
commit 0a8f6b4783
4 changed files with 8 additions and 6 deletions

View File

@ -760,7 +760,8 @@ nsStringBundleService::FormatWithBundle(nsIStringBundle* bundle, nsresult aStatu
// If the int key fails, try looking up the default error message. E.g. print:
// An unknown error has occurred (0x804B0003).
if (NS_FAILED(rv)) {
nsAutoString statusStr; statusStr.AppendInt(aStatus, 16);
nsAutoString statusStr;
statusStr.AppendInt(static_cast<PRUint32>(aStatus), 16);
const PRUnichar* otherArgArray[1];
otherArgArray[0] = statusStr.get();
PRUint16 code = NS_ERROR_GET_CODE(NS_ERROR_FAILURE);

View File

@ -745,7 +745,7 @@ nsUserFontSet::LogMessage(gfxProxyFontEntry *aProxy,
break;
default:
msg.Append("status=");
msg.AppendInt(aStatus);
msg.AppendInt(static_cast<PRUint32>(aStatus));
break;
}
}

View File

@ -347,7 +347,7 @@ nsUrlClassifierStreamUpdater::UpdateError(nsresult result)
DownloadDone();
nsCAutoString strResult;
strResult.AppendInt(result);
strResult.AppendInt(static_cast<PRUint32>(result));
if (errorCallback) {
errorCallback->HandleEvent(strResult);
}

View File

@ -99,19 +99,20 @@ nsErrorService::GetErrorStringBundle(PRInt16 errorModule, char **result)
NS_IMETHODIMP
nsErrorService::RegisterErrorStringBundleKey(nsresult error, const char *stringBundleKey)
{
return mErrorStringBundleKeyMap.Put(error, stringBundleKey);
return mErrorStringBundleKeyMap.Put(static_cast<PRUint32>(error),
stringBundleKey);
}
NS_IMETHODIMP
nsErrorService::UnregisterErrorStringBundleKey(nsresult error)
{
return mErrorStringBundleKeyMap.Remove(error);
return mErrorStringBundleKeyMap.Remove(static_cast<PRUint32>(error));
}
NS_IMETHODIMP
nsErrorService::GetErrorStringBundleKey(nsresult error, char **result)
{
char* value = mErrorStringBundleKeyMap.Get(error);
char* value = mErrorStringBundleKeyMap.Get(static_cast<PRUint32>(error));
if (value == nullptr)
return NS_ERROR_OUT_OF_MEMORY;
*result = value;