VirtualBox

Ignore:
Timestamp:
Apr 16, 2012 11:58:26 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77489
Message:

runtime: backed out r77481,r77482,r77483,r77484,r77485

Location:
trunk/src/VBox/Runtime/common/string
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/straprintf.cpp

    r40934 r40938  
    132132
    133133        /* failure */
    134         pArg->psz = (char *)NULL;
     134        pArg->psz = NULL;
    135135    }
    136136    return 0;
     
    153153    Arg.pszTag      = pszTag;
    154154    szBuf[0] = '\0';
    155     int cbRet = (int)RTStrFormatV(strallocoutput, &Arg, (PFNSTRFORMAT)NULL, NULL, pszFormat, args);
     155    int cbRet = (int)RTStrFormatV(strallocoutput, &Arg, NULL, NULL, pszFormat, args);
    156156    if (Arg.psz)
    157157    {
     
    175175    {
    176176        /* allocation error */
    177         *ppszBuffer = (char *)NULL;
     177        *ppszBuffer = NULL;
    178178        cbRet = -1;
    179179
  • trunk/src/VBox/Runtime/common/string/strformat.cpp

    r40934 r40938  
    782782
    783783    /* terminate the output */
    784     pfnOutput(pvArgOutput, (const char *)NULL, 0);
     784    pfnOutput(pvArgOutput, NULL, 0);
    785785
    786786    return cch;
  • trunk/src/VBox/Runtime/common/string/strformatrt.cpp

    r40934 r40938  
    346346                            return pfnOutput(pvArgOutput, s_szFalse, sizeof(s_szFalse) - 1);
    347347                        /* invalid boolean value */
    348                         return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "!%lld!", u.u64);
     348                        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "!%lld!", u.u64);
    349349                    }
    350350
     
    384384
    385385                    case RTSF_IPV4:
    386                         return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     386                        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    387387                                           "%u.%u.%u.%u",
    388388                                           u.Ipv4Addr.au8[0],
     
    394394                    {
    395395                        if (VALID_PTR(u.pIpv6Addr))
    396                             return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     396                            return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    397397                                               "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
    398398                                               u.pIpv6Addr->au8[0],
     
    418418                    {
    419419                        if (VALID_PTR(u.pMac))
    420                             return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     420                            return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    421421                                               "%02x:%02x:%02x:%02x:%02x:%02x",
    422422                                               u.pMac->au8[0],
     
    437437                                case RTNETADDRTYPE_IPV4:
    438438                                    if (u.pNetAddr->uPort == RTNETADDR_PORT_NA)
    439                                         return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     439                                        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    440440                                                           "%u.%u.%u.%u",
    441441                                                           u.pNetAddr->uAddr.IPv4.au8[0],
     
    443443                                                           u.pNetAddr->uAddr.IPv4.au8[2],
    444444                                                           u.pNetAddr->uAddr.IPv4.au8[3]);
    445                                     return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     445                                    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    446446                                                       "%u.%u.%u.%u:%u",
    447447                                                       u.pNetAddr->uAddr.IPv4.au8[0],
     
    453453                                case RTNETADDRTYPE_IPV6:
    454454                                    if (u.pNetAddr->uPort == RTNETADDR_PORT_NA)
    455                                         return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     455                                        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    456456                                                           "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
    457457                                                           u.pNetAddr->uAddr.IPv6.au8[0],
     
    471471                                                           u.pNetAddr->uAddr.IPv6.au8[14],
    472472                                                           u.pNetAddr->uAddr.IPv6.au8[15]);
    473                                     return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     473                                    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    474474                                                       "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x %u",
    475475                                                       u.pNetAddr->uAddr.IPv6.au8[0],
     
    492492
    493493                                case RTNETADDRTYPE_MAC:
    494                                     return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     494                                    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    495495                                                       "%02x:%02x:%02x:%02x:%02x:%02x",
    496496                                                       u.pNetAddr->uAddr.Mac.au8[0],
     
    502502
    503503                                default:
    504                                     return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     504                                    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    505505                                                       "unsupported-netaddr-type=%u", u.pNetAddr->enmType);
    506506
     
    515515                        {
    516516                            /* cannot call RTUuidToStr because of GC/R0. */
    517                             return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     517                            return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    518518                                               "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
    519519                                               u.pUuid->Gen.u32TimeLow,
     
    664664                                    {
    665665                                        int i;
    666                                         cch += RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%s%0*x %04x:", off ? "\n" : "", sizeof(pu8) * 2, (uintptr_t)pu8, off);
     666                                        cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s%0*x %04x:", off ? "\n" : "", sizeof(pu8) * 2, (uintptr_t)pu8, off);
    667667                                        for (i = 0; i < cchWidth && off + i < cchPrecision ; i++)
    668                                             cch += RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0,
     668                                            cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
    669669                                                               off + i < cchPrecision ? !(i & 7) && i ? "-%02x" : " %02x" : "   ", pu8[i]);
    670670                                        while (i++ < cchWidth)
     
    693693                                    if (cchPrecision-- > 0)
    694694                                    {
    695                                         cch = RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%02x", *pu8++);
     695                                        cch = RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%02x", *pu8++);
    696696                                        for (; cchPrecision > 0; cchPrecision--, pu8++)
    697                                             cch += RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, " %02x", *pu8);
     697                                            cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, " %02x", *pu8);
    698698                                        return cch;
    699699                                    }
     
    728728                                return pfnOutput(pvArgOutput, pMsg->pszMsgFull,strlen(pMsg->pszMsgFull));
    729729                            case 'a':
    730                                 return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%s (0x%08X) - %s", pMsg->pszDefine, hrc, pMsg->pszMsgFull);
     730                                return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s (0x%08X) - %s", pMsg->pszDefine, hrc, pMsg->pszMsgFull);
    731731                            default:
    732732                                AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg));
     
    762762                        return pfnOutput(pvArgOutput, pMsg->pszMsgFull,   strlen(pMsg->pszMsgFull));
    763763                    case 'a':
    764                         return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%s (%d) - %s", pMsg->pszDefine, rc, pMsg->pszMsgFull);
     764                        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s (%d) - %s", pMsg->pszDefine, rc, pMsg->pszMsgFull);
    765765                    default:
    766766                        AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg));
     
    774774                    case 'f':
    775775                    case 'a':
    776                         return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%d", rc);
     776                        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%d", rc);
    777777                    default:
    778778                        AssertMsgFailed(("Invalid status code format type '%.10s'!\n", pszFormatOrg));
     
    801801                        return pfnOutput(pvArgOutput, pMsg->pszMsgFull,strlen(pMsg->pszMsgFull));
    802802                    case 'a':
    803                         return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "%s (0x%08X) - %s", pMsg->pszDefine, rc, pMsg->pszMsgFull);
     803                        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s (0x%08X) - %s", pMsg->pszDefine, rc, pMsg->pszMsgFull);
    804804# else
    805805                    case 'c':
    806806                    case 'f':
    807807                    case 'a':
    808                         return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, 0, "0x%08X", rc);
     808                        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "0x%08X", rc);
    809809# endif
    810810                    default:
     
    911911                {
    912912                    case RTST_TIMESPEC:
    913                         return RTStrFormat(pfnOutput, pvArgOutput, (PFNSTRFORMAT)NULL, NULL, "%'lld ns", RTTimeSpecGetNano(u.pTimeSpec));
     913                        return RTStrFormat(pfnOutput, pvArgOutput, NULL, NULL, "%'lld ns", RTTimeSpecGetNano(u.pTimeSpec));
    914914
    915915                    default:
  • trunk/src/VBox/Runtime/common/string/stringalloc.cpp

    r40934 r40938  
    7171    {
    7272        RTMemFree(pszOld);
    73         *ppsz = (char *)NULL;
     73        *ppsz = NULL;
    7474    }
    7575    else if (pszOld)
  • trunk/src/VBox/Runtime/common/string/strpbrk.cpp

    r40934 r40938  
    6060
    6161    }
    62     return (char *)NULL;
     62    return NULL;
    6363}
    6464
  • trunk/src/VBox/Runtime/common/string/strprintf.cpp

    r40934 r40938  
    100100RTDECL(size_t) RTStrPrintfV(char *pszBuffer, size_t cchBuffer, const char *pszFormat, va_list args)
    101101{
    102     return RTStrPrintfExV((PFNSTRFORMAT)NULL, NULL, pszBuffer, cchBuffer, pszFormat, args);
     102    return RTStrPrintfExV(NULL, NULL, pszBuffer, cchBuffer, pszFormat, args);
    103103}
    104104RT_EXPORT_SYMBOL(RTStrPrintfV);
  • trunk/src/VBox/Runtime/common/string/strtonum.cpp

    r40934 r40938  
    261261{
    262262    uint64_t u64;
    263     int rc = RTStrToUInt64Ex(pszValue, (char **)NULL, 0, &u64);
     263    int rc = RTStrToUInt64Ex(pszValue, NULL, 0, &u64);
    264264    if (RT_SUCCESS(rc))
    265265        return u64;
     
    348348{
    349349    uint32_t u32;
    350     int rc = RTStrToUInt32Ex(pszValue, (char **)NULL, 0, &u32);
     350    int rc = RTStrToUInt32Ex(pszValue, NULL, 0, &u32);
    351351    if (RT_SUCCESS(rc))
    352352        return u32;
     
    435435{
    436436    uint16_t u16;
    437     int rc = RTStrToUInt16Ex(pszValue, (char **)NULL, 0, &u16);
     437    int rc = RTStrToUInt16Ex(pszValue, NULL, 0, &u16);
    438438    if (RT_SUCCESS(rc))
    439439        return u16;
     
    522522{
    523523    uint8_t u8;
    524     int rc = RTStrToUInt8Ex(pszValue, (char **)NULL, 0, &u8);
     524    int rc = RTStrToUInt8Ex(pszValue, NULL, 0, &u8);
    525525    if (RT_SUCCESS(rc))
    526526        return u8;
     
    701701{
    702702    int64_t i64;
    703     int rc = RTStrToInt64Ex(pszValue, (char **)NULL, 0, &i64);
     703    int rc = RTStrToInt64Ex(pszValue, NULL, 0, &i64);
    704704    if (RT_SUCCESS(rc))
    705705        return i64;
     
    788788{
    789789    int32_t i32;
    790     int rc = RTStrToInt32Ex(pszValue, (char **)NULL, 0, &i32);
     790    int rc = RTStrToInt32Ex(pszValue, NULL, 0, &i32);
    791791    if (RT_SUCCESS(rc))
    792792        return i32;
     
    875875{
    876876    int16_t i16;
    877     int rc = RTStrToInt16Ex(pszValue, (char **)NULL, 0, &i16);
     877    int rc = RTStrToInt16Ex(pszValue, NULL, 0, &i16);
    878878    if (RT_SUCCESS(rc))
    879879        return i16;
     
    962962{
    963963    int8_t i8;
    964     int rc = RTStrToInt8Ex(pszValue, (char **)NULL, 0, &i8);
     964    int rc = RTStrToInt8Ex(pszValue, NULL, 0, &i8);
    965965    if (RT_SUCCESS(rc))
    966966        return i8;
  • trunk/src/VBox/Runtime/common/string/utf-16.cpp

    r40934 r40938  
    464464    Assert(VALID_PTR(ppszString));
    465465    Assert(VALID_PTR(pwszString));
    466     *ppszString = (char *)NULL;
     466    *ppszString = NULL;
    467467
    468468    /*
     
    529529        else
    530530        {
    531             *ppsz = (char *)NULL;
     531            *ppsz = NULL;
    532532            fShouldFree = true;
    533533            cch = RT_MAX(cch, cchResult + 1);
     
    824824    Assert(VALID_PTR(ppszString));
    825825    Assert(VALID_PTR(pwszString));
    826     *ppszString = (char *)NULL;
     826    *ppszString = NULL;
    827827
    828828    /*
     
    889889        else
    890890        {
    891             *ppsz = (char *)NULL;
     891            *ppsz = NULL;
    892892            fShouldFree = true;
    893893            cch = RT_MAX(cch, cchResult + 1);
     
    10031003    Assert(VALID_PTR(ppwszString));
    10041004    Assert(VALID_PTR(pszString));
    1005     *ppwszString = (PRTUTF16)NULL;
     1005    *ppwszString = NULL;
    10061006
    10071007    /*
     
    10711071        else
    10721072        {
    1073             *ppwsz = (PRTUTF16)NULL;
     1073            *ppwsz = NULL;
    10741074            fShouldFree = true;
    10751075            cwc = RT_MAX(cwcResult + 1, cwc);
  • trunk/src/VBox/Runtime/common/string/utf-8.cpp

    r40934 r40938  
    275275{
    276276    size_t cCodePoints;
    277     int rc = rtUtf8Length(psz, RTSTR_MAX, &cCodePoints, (size_t *)NULL);
     277    int rc = rtUtf8Length(psz, RTSTR_MAX, &cCodePoints, NULL);
    278278    return RT_SUCCESS(rc) ? cCodePoints : 0;
    279279}
     
    284284{
    285285    size_t cCodePoints;
    286     int rc = rtUtf8Length(psz, cch, &cCodePoints, (size_t *)NULL);
     286    int rc = rtUtf8Length(psz, cch, &cCodePoints, NULL);
    287287    if (pcCps)
    288288        *pcCps = RT_SUCCESS(rc) ? cCodePoints : 0;
     
    390390    Assert(VALID_PTR(pszString));
    391391    Assert(VALID_PTR(ppaCps));
    392     *ppaCps = (PRTUNICP)NULL;
     392    *ppaCps = NULL;
    393393
    394394    /*
     
    396396     */
    397397    size_t cCps;
    398     int rc = rtUtf8Length(pszString, RTSTR_MAX, &cCps, (size_t *)NULL);
     398    int rc = rtUtf8Length(pszString, RTSTR_MAX, &cCps, NULL);
    399399    if (RT_SUCCESS(rc))
    400400    {
     
    437437     */
    438438    size_t cCpsResult;
    439     int rc = rtUtf8Length(pszString, cchString, &cCpsResult, (size_t *)NULL);
     439    int rc = rtUtf8Length(pszString, cchString, &cCpsResult, NULL);
    440440    if (RT_SUCCESS(rc))
    441441    {
     
    457457        else
    458458        {
    459             *ppaCps = (PRTUNICP)NULL;
     459            *ppaCps = NULL;
    460460            fShouldFree = true;
    461461            cCps = RT_MAX(cCpsResult + 1, cCps);
     
    711711    Assert(VALID_PTR(ppwszString));
    712712    Assert(VALID_PTR(pszString));
    713     *ppwszString = (PRTUTF16)NULL;
     713    *ppwszString = NULL;
    714714
    715715    /*
     
    779779        else
    780780        {
    781             *ppwsz = (PRTUTF16)NULL;
     781            *ppwsz = NULL;
    782782            fShouldFree = true;
    783783            cwc = RT_MAX(cwcResult + 1, cwc);
     
    901901    Assert(VALID_PTR(ppszString));
    902902    Assert(VALID_PTR(pszString));
    903     *ppszString = (char *)NULL;
     903    *ppszString = NULL;
    904904
    905905    /*
     
    966966        else
    967967        {
    968             *ppsz = (char *)NULL;
     968            *ppsz = NULL;
    969969            fShouldFree = true;
    970970            cch = RT_MAX(cch, cchResult + 1);
     
    10941094    Assert(VALID_PTR(ppszString));
    10951095    Assert(VALID_PTR(pszString));
    1096     *ppszString = (char *)NULL;
     1096    *ppszString = NULL;
    10971097
    10981098    /*
     
    11621162        else
    11631163        {
    1164             *ppsz = (char *)NULL;
     1164            *ppsz = NULL;
    11651165            fShouldFree = true;
    11661166            cch = RT_MAX(cchResult + 1, cch);
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