crypt32: Don't open code CONTAINING_RECORD().
Michael Stefaniuc
mstefani at redhat.de
Tue Dec 28 19:39:42 CST 2010
---
dlls/crypt32/decode.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c
index 62231cd..a1431fb 100644
--- a/dlls/crypt32/decode.c
+++ b/dlls/crypt32/decode.c
@@ -3731,9 +3731,8 @@ static BOOL CRYPT_AsnDecodeRequireExplicit(const BYTE *pbEncoded,
}
else
{
- CERT_POLICY_CONSTRAINTS_INFO *info =
- (CERT_POLICY_CONSTRAINTS_INFO *)((BYTE *)pvStructInfo -
- offsetof(CERT_POLICY_CONSTRAINTS_INFO, fRequireExplicitPolicy));
+ CERT_POLICY_CONSTRAINTS_INFO *info = CONTAINING_RECORD(pvStructInfo,
+ CERT_POLICY_CONSTRAINTS_INFO, fRequireExplicitPolicy);
*pcbStructInfo = bytesNeeded;
/* The BOOL is implicit: if the integer is present, then it's
@@ -3779,9 +3778,8 @@ static BOOL CRYPT_AsnDecodeInhibitMapping(const BYTE *pbEncoded,
}
else
{
- CERT_POLICY_CONSTRAINTS_INFO *info =
- (CERT_POLICY_CONSTRAINTS_INFO *)((BYTE *)pvStructInfo -
- offsetof(CERT_POLICY_CONSTRAINTS_INFO, fInhibitPolicyMapping));
+ CERT_POLICY_CONSTRAINTS_INFO *info = CONTAINING_RECORD(pvStructInfo,
+ CERT_POLICY_CONSTRAINTS_INFO, fInhibitPolicyMapping);
*pcbStructInfo = bytesNeeded;
/* The BOOL is implicit: if the integer is present, then it's
@@ -5107,8 +5105,8 @@ static BOOL CRYPT_AsnDecodeMaximum(const BYTE *pbEncoded,
}
else
{
- CERT_GENERAL_SUBTREE *subtree = (CERT_GENERAL_SUBTREE *)
- ((BYTE *)pvStructInfo - offsetof(CERT_GENERAL_SUBTREE, fMaximum));
+ CERT_GENERAL_SUBTREE *subtree = CONTAINING_RECORD(pvStructInfo,
+ CERT_GENERAL_SUBTREE, fMaximum);
*pcbStructInfo = bytesNeeded;
/* The BOOL is implicit: if the integer is present, then it's
--
1.7.3.4
More information about the wine-patches
mailing list