VirtualBox

Changeset 94479 in vbox


Ignore:
Timestamp:
Apr 5, 2022 8:32:26 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
150812
Message:

VMM/CFGM: Use %Rhcb to do human readable size formatting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CFGM.cpp

    r94477 r94479  
    33573357            case CFGMVALUETYPE_INTEGER:
    33583358            {
    3359                 pHlp->pfnPrintf(pHlp, "  %-*s <integer> = %#018llx (%'lld", (int)cchMax, pLeaf->szName, pLeaf->Value.Integer.u64, pLeaf->Value.Integer.u64);
     3359                pHlp->pfnPrintf(pHlp, "  %-*s <integer> = %#018llx (%'lld",
     3360                                (int)cchMax, pLeaf->szName, pLeaf->Value.Integer.u64, pLeaf->Value.Integer.u64);
    33603361                if (   (   pLeaf->cchName >= 4
    33613362                        && !RTStrCmp(&pLeaf->szName[pLeaf->cchName - 4], "Size"))
    33623363                    || (   pLeaf->cchName >= 2
    33633364                        && !RTStrNCmp(pLeaf->szName, "cb", 2)) )
    3364                 {
    3365                     if (pLeaf->Value.Integer.u64 > _2M)
    3366                         pHlp->pfnPrintf(pHlp, ", %'lld MB", pLeaf->Value.Integer.u64 / _1M);
    3367                     else if (pLeaf->Value.Integer.u64 > _2K)
    3368                         pHlp->pfnPrintf(pHlp, ", %'lld KB", pLeaf->Value.Integer.u64 / _1K);
    3369                     if (pLeaf->Value.Integer.u64 > _2G)
    3370                         pHlp->pfnPrintf(pHlp, ", %'lld.%lld GB",
    3371                                               pLeaf->Value.Integer.u64 / _1G,
    3372                                               (pLeaf->Value.Integer.u64 % _1G) / _1K * 10 / _1M);
    3373                 }
    3374                 pHlp->pfnPrintf(pHlp, ")\n");
     3365                    pHlp->pfnPrintf(pHlp, ", %' Rhcb)", pLeaf->Value.Integer.u64);
     3366                else
     3367                    pHlp->pfnPrintf(pHlp, ")\n");
    33753368                break;
    33763369            }
    33773370
    33783371            case CFGMVALUETYPE_STRING:
    3379                 pHlp->pfnPrintf(pHlp, "  %-*s <string>  = \"%s\" (cb=%zu)\n", (int)cchMax, pLeaf->szName, pLeaf->Value.String.psz, pLeaf->Value.String.cb);
     3372                pHlp->pfnPrintf(pHlp, "  %-*s <string>  = \"%s\" (cb=%zu)\n",
     3373                                (int)cchMax, pLeaf->szName, pLeaf->Value.String.psz, pLeaf->Value.String.cb);
    33803374                break;
    33813375
    33823376            case CFGMVALUETYPE_BYTES:
    3383                 pHlp->pfnPrintf(pHlp, "  %-*s <bytes>   = \"%.*Rhxs\" (cb=%zu)\n", (int)cchMax, pLeaf->szName, pLeaf->Value.Bytes.cb, pLeaf->Value.Bytes.pau8, pLeaf->Value.Bytes.cb);
     3377                pHlp->pfnPrintf(pHlp, "  %-*s <bytes>   = \"%.*Rhxs\" (cb=%zu)\n",
     3378                                (int)cchMax, pLeaf->szName, pLeaf->Value.Bytes.cb, pLeaf->Value.Bytes.pau8, pLeaf->Value.Bytes.cb);
    33843379                break;
    33853380
    33863381            case CFGMVALUETYPE_PASSWORD:
    3387                 pHlp->pfnPrintf(pHlp, "  %-*s <password>= \"***REDACTED***\" (cb=%zu)\n", (int)cchMax, pLeaf->szName, pLeaf->Value.String.cb);
     3382                pHlp->pfnPrintf(pHlp, "  %-*s <password>= \"***REDACTED***\" (cb=%zu)\n",
     3383                                (int)cchMax, pLeaf->szName, pLeaf->Value.String.cb);
    33883384                break;
    33893385
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