VirtualBox

Changeset 55946 in vbox for trunk/include/iprt


Ignore:
Timestamp:
May 19, 2015 11:38:48 PM (10 years ago)
Author:
vboxsync
Message:

iprt/asn1-generator-pass.h: Got rid of RT_UNLIKELY.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asn1-generator-pass.h

    r54706 r55946  
    889889                                                                 PRTERRINFO pErrInfo, const char *pszErrorTag) \
    890890{ \
    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 \
    892894        return RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, "%s: Missing (%s).", pszErrorTag, RT_XSTR(RTASN1TMPL_TYPE)); \
    893895    int rc = VINF_SUCCESS
     
    952954            { a_Constraints } \
    953955        } \
    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 \
    955959            rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \
    956960                               "%s::" #a_TnNm "." #a_Name ": Explict tag precense mixup; " #a_CtxTagN "=%d " #a_Name "=%d.", \
     
    10211025    { \
    10221026        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 \
    10241030            rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \
    10251031                               "%s::" #a_Name ": Content size is out of range: %#x not in {%#x..%#x}", \
     
    10311037    if (RT_SUCCESS(rc) && ((cMinBits) != 0 || (cMaxBits) != UINT32_MAX)) \
    10321038    { \
    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 \
    10351043            rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \
    10361044                               "%s::" #a_Name ": Bit size is out of range: %#x not in {%#x..%#x}", \
     
    10421050    if (RT_SUCCESS(rc)) \
    10431051    { \
    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 \
    10461056            rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \
    10471057                               "%s::" #a_Name ": Out of range: %#x not in {%#llx..%#llx}", \
     
    10521062
    10531063# 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    } \
    10561071    { a_MoreConstraints }
    10571072
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette