From c8d341a4c9cdbc51054f7d144265f58d332a8c20 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Thu, 12 Jul 2018 22:40:37 +0800 Subject: [PATCH] nss: follow up of pervious commit: don't try to cast function pointers into data pointers, which cause C4054 error on VC7.1. --- .../nss/lib/libpkix/pkix/crlsel/pkix_crlselector.c | 2 +- security/nss/lib/libpkix/pkix/store/pkix_store.c | 10 +++++----- security/nss/lib/libpkix/pkix/util/pkix_logger.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/security/nss/lib/libpkix/pkix/crlsel/pkix_crlselector.c b/security/nss/lib/libpkix/pkix/crlsel/pkix_crlselector.c index e9a9c03d..9967af9b 100644 --- a/security/nss/lib/libpkix/pkix/crlsel/pkix_crlselector.c +++ b/security/nss/lib/libpkix/pkix/crlsel/pkix_crlselector.c @@ -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; diff --git a/security/nss/lib/libpkix/pkix/store/pkix_store.c b/security/nss/lib/libpkix/pkix/store/pkix_store.c index af8be2bb..31c21ea1 100644 --- a/security/nss/lib/libpkix/pkix/store/pkix_store.c +++ b/security/nss/lib/libpkix/pkix/store/pkix_store.c @@ -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: diff --git a/security/nss/lib/libpkix/pkix/util/pkix_logger.c b/security/nss/lib/libpkix/pkix/util/pkix_logger.c index a916e6e4..cfd870de 100644 --- a/security/nss/lib/libpkix/pkix/util/pkix_logger.c +++ b/security/nss/lib/libpkix/pkix/util/pkix_logger.c @@ -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;