VirtualBox

Changeset 84207 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 8, 2020 11:54:10 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137815
Message:

IPRT: Added two flags to the %Rhxs formatter type to control the separator. Default is space, the ' flag changes it to ':' and the # flag removes the separator. bugref:9699

Location:
trunk/src/VBox/Runtime/common
Files:
2 edited

Legend:

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

    r84063 r84207  
    988988                                /*
    989989                                 * Hex string.
     990                                 * The default separator is ' ', RTSTR_F_THOUSAND_SEP changes it to ':',
     991                                 * and RTSTR_F_SPECIAL removes it.
    990992                                 */
    991993                                case 's':
     
    9981000                                            cch = RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%0*llx: %02x",
    9991001                                                              cchMemAddrWidth, uMemAddr, *pu8++);
    1000                                         for (; cchPrecision > 0; cchPrecision--, pu8++)
    1001                                             cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, " %02x", *pu8);
     1002                                        if (!(fFlags & (RTSTR_F_SPECIAL | RTSTR_F_THOUSAND_SEP)))
     1003                                            for (; cchPrecision > 0; cchPrecision--, pu8++)
     1004                                                cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, " %02x", *pu8);
     1005                                        else if (fFlags & RTSTR_F_SPECIAL)
     1006                                            for (; cchPrecision > 0; cchPrecision--, pu8++)
     1007                                                cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%02x", *pu8);
     1008                                        else
     1009                                            for (; cchPrecision > 0; cchPrecision--, pu8++)
     1010                                                cch += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, ":%02x", *pu8);
    10021011                                        return cch;
    10031012                                    }
  • trunk/src/VBox/Runtime/common/zip/tarvfswriter.cpp

    r84192 r84207  
    21342134    AssertPtrReturn(phVfsFss, VERR_INVALID_HANDLE);
    21352135    *phVfsFss = NIL_RTVFSFSSTREAM;
    2136     AssertPtrReturn(hVfsFile != NIL_RTVFSFILE, VERR_INVALID_HANDLE);
     2136    AssertReturn(hVfsFile != NIL_RTVFSFILE, VERR_INVALID_HANDLE);
    21372137    AssertReturn(enmFormat > RTZIPTARFORMAT_INVALID && enmFormat < RTZIPTARFORMAT_END, VERR_INVALID_PARAMETER);
    21382138    AssertReturn(!(fFlags & ~RTZIPTAR_C_VALID_MASK), VERR_INVALID_FLAGS);
     
    21592159    size_t const            cbThis = sizeof(*pThis) + (fFlags & RTZIPTAR_C_UPDATE ? sizeof(*pThis->pRead) : 0);
    21602160    RTVFSFSSTREAM           hVfsFss;
    2161     int rc = RTVfsNewFsStream(&g_rtZipTarFssOps, cbThis, NIL_RTVFS, NIL_RTVFSLOCK, RTFILE_O_WRITE,
     2161    int rc = RTVfsNewFsStream(&g_rtZipTarFssOps, cbThis, NIL_RTVFS, NIL_RTVFSLOCK,
     2162                              fFlags & RTZIPTAR_C_UPDATE ? RTFILE_O_READWRITE : RTFILE_O_WRITE,
    21622163                              &hVfsFss, (void **)&pThis);
    21632164    if (RT_SUCCESS(rc))
Note: See TracChangeset for help on using the changeset viewer.

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