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
Родитель be9a414c79
Коммит 88e2b537b5
3 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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