Changeset 55946 in vbox for trunk/include/iprt
- Timestamp:
- May 19, 2015 11:38:48 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asn1-generator-pass.h
r54706 r55946 889 889 PRTERRINFO pErrInfo, const char *pszErrorTag) \ 890 890 { \ 891 if (RT_UNLIKELY(!RT_CONCAT(RTASN1TMPL_EXT_NAME,_IsPresent)(pThis))) \ 891 if (RT_LIKELY(RT_CONCAT(RTASN1TMPL_EXT_NAME,_IsPresent)(pThis))) \ 892 { /* likely */ } \ 893 else \ 892 894 return RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, "%s: Missing (%s).", pszErrorTag, RT_XSTR(RTASN1TMPL_TYPE)); \ 893 895 int rc = VINF_SUCCESS … … 952 954 { a_Constraints } \ 953 955 } \ 954 else if (RT_UNLIKELY(RTASN1CORE_IS_PRESENT(&pThis->a_TnNm.a_CtxTagN.Asn1Core) != fInnerPresent)) \ 956 else if (RT_LIKELY(RTASN1CORE_IS_PRESENT(&pThis->a_TnNm.a_CtxTagN.Asn1Core) == fInnerPresent)) \ 957 { /* likely */ } \ 958 else \ 955 959 rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \ 956 960 "%s::" #a_TnNm "." #a_Name ": Explict tag precense mixup; " #a_CtxTagN "=%d " #a_Name "=%d.", \ … … 1021 1025 { \ 1022 1026 PCRTASN1CORE pCore = RT_CONCAT(a_Api,_GetAsn1Core)(&pThis->a_Name); \ 1023 if (RT_UNLIKELY(pCore->cb < (cbMin) || pCore->cb > (cbMax))) \ 1027 if (RT_LIKELY(pCore->cb >= (cbMin) && pCore->cb <= (cbMax))) \ 1028 { /* likely */ } \ 1029 else \ 1024 1030 rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \ 1025 1031 "%s::" #a_Name ": Content size is out of range: %#x not in {%#x..%#x}", \ … … 1031 1037 if (RT_SUCCESS(rc) && ((cMinBits) != 0 || (cMaxBits) != UINT32_MAX)) \ 1032 1038 { \ 1033 if (RT_UNLIKELY( ((cMinBits) == 0 ? false : pThis->a_Name.cBits + 1U < (cMinBits) + 1U /* warning avoiding */) \ 1034 || ((cMaxBits) == UINT32_MAX ? false : pThis->a_Name.cBits + 1U > (cMaxBits) + 1U /* ditto */) ) ) \ 1039 if (RT_LIKELY( ((cMinBits) == 0 ? true : pThis->a_Name.cBits + 1U >= (cMinBits) + 1U /* warning avoiding */) \ 1040 && ((cMaxBits) == UINT32_MAX ? true : pThis->a_Name.cBits + 1U <= (cMaxBits) + 1U /* ditto */) ) ) \ 1041 { /* likely */ } \ 1042 else \ 1035 1043 rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \ 1036 1044 "%s::" #a_Name ": Bit size is out of range: %#x not in {%#x..%#x}", \ … … 1042 1050 if (RT_SUCCESS(rc)) \ 1043 1051 { \ 1044 if (RT_UNLIKELY( RTAsn1Integer_UnsignedCompareWithU64(&pThis->a_Name, uMin) < 0 \ 1045 || RTAsn1Integer_UnsignedCompareWithU64(&pThis->a_Name, uMax) > 0) ) \ 1052 if (RT_LIKELY( RTAsn1Integer_UnsignedCompareWithU64(&pThis->a_Name, uMin) >= 0 \ 1053 && RTAsn1Integer_UnsignedCompareWithU64(&pThis->a_Name, uMax) <= 0) ) \ 1054 { /* likely */ } \ 1055 else \ 1046 1056 rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \ 1047 1057 "%s::" #a_Name ": Out of range: %#x not in {%#llx..%#llx}", \ … … 1052 1062 1053 1063 # define RTASN1TMPL_MEMBER_CONSTR_PRESENT(a_Name, a_Api, a_MoreConstraints) \ 1054 if (RT_SUCCESS(rc) && RT_UNLIKELY(!RT_CONCAT(a_Api,_IsPresent)(&pThis->a_Name))) \ 1055 rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, "%s::" #a_Name ": Missing.", pszErrorTag); \ 1064 if (RT_SUCCESS(rc)) \ 1065 { \ 1066 if (RT_LIKELY(RT_CONCAT(a_Api,_IsPresent)(&pThis->a_Name))) \ 1067 { /* likely */ } \ 1068 else \ 1069 rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, "%s::" #a_Name ": Missing.", pszErrorTag); \ 1070 } \ 1056 1071 { a_MoreConstraints } 1057 1072
Note:
See TracChangeset
for help on using the changeset viewer.