Bug 777292 - Add casts and annoyed comments where we make up nsresult codes on the fly; r=ehsan

This commit is contained in:
Aryeh Gregor 2012-07-27 17:03:25 +03:00
parent 7644f69a87
commit 417223dce7
3 changed files with 9 additions and 4 deletions

View File

@ -130,7 +130,9 @@ IsNSSErrorCode(PRErrorCode code)
static nsresult
GetXPCOMFromNSSError(PRErrorCode code)
{
return NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, -1 * code);
// XXX Don't make up nsresults, it's supposed to be an enum (bug 778113)
return (nsresult)NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY,
-1 * code);
}
static nsresult

View File

@ -71,10 +71,11 @@ NSSErrorsService::GetXPCOMFromNSSError(PRInt32 aNSPRCode, nsresult *aXPCOMErrorC
// The error codes within each module may be a 16 bit value.
// For simplicity let's use the positive value of the NSS code.
// XXX Don't make up nsresults, it's supposed to be an enum (bug 778113)
*aXPCOMErrorCode =
NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY,
-1 * aNSPRCode);
(nsresult)NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY,
-1 * aNSPRCode);
return NS_OK;
}

View File

@ -70,7 +70,9 @@ PRErrorCode_to_nsresult(PRErrorCode error)
}
// From NSSErrorsService::GetXPCOMFromNSSError
return NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY, -1 * error);
// XXX Don't make up nsresults, it's supposed to be an enum (bug 778113)
return (nsresult)NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_SECURITY,
-1 * error);
}
// IMPORTANT: This must be called immediately after the function returning the