nss: follow up of pervious commit: don't try to cast function pointers into data pointers, which cause C4054 error on VC7.1.

This commit is contained in:
roytam1 2018-07-12 22:40:37 +08:00
parent 44b7f056d9
commit c8d341a4c9
3 changed files with 7 additions and 7 deletions

View File

@ -190,7 +190,7 @@ pkix_CRLSelector_Hashcode(
PKIX_HASHCODE(crlSelector->context, &contextHash, plContext,
PKIX_OBJECTHASHCODEFAILED);
hash = 31 * ((PKIX_UInt32)((char *)crlSelector->matchCallback - (char *)NULL) +
hash = 31 * ((PKIX_UInt32)crlSelector->matchCallback +
(contextHash << 3)) + paramsHash;
*pHashcode = hash;

View File

@ -74,11 +74,11 @@ pkix_CertStore_Hashcode(
PKIX_CERTSTOREHASHCODEFAILED);
}
*pHashcode = (PKIX_UInt32)((char *)certStore->certCallback - (char *)NULL) +
(PKIX_UInt32)((char *)certStore->crlCallback - (char *)NULL) +
(PKIX_UInt32)((char *)certStore->certContinue - (char *)NULL) +
(PKIX_UInt32)((char *)certStore->crlContinue - (char *)NULL) +
(PKIX_UInt32)((char *)certStore->trustCallback - (char *)NULL) +
*pHashcode = (PKIX_UInt32) certStore->certCallback +
(PKIX_UInt32) certStore->crlCallback +
(PKIX_UInt32) certStore->certContinue +
(PKIX_UInt32) certStore->crlContinue +
(PKIX_UInt32) certStore->trustCallback +
(tempHash << 7);
cleanup:

View File

@ -492,7 +492,7 @@ pkix_Logger_Hashcode(
PKIX_HASHCODE(logger->context, &tempHash, plContext,
PKIX_OBJECTHASHCODEFAILED);
hash = (((((PKIX_UInt32)((char *)logger->callback - (char *)NULL) + tempHash) << 7) +
hash = (((((PKIX_UInt32) logger->callback + tempHash) << 7) +
logger->maxLevel) << 7) + (PKIX_UInt32)logger->logComponent;
*pHashcode = hash;