Changeset 66884 in vbox for trunk/src/VBox/Runtime/common/string
- Timestamp:
- May 12, 2017 6:21:24 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/strformatnum.cpp
r66882 r66884 161 161 fFlags &= ~RTSTR_F_BIT_MASK; 162 162 163 char szTmp[64+32]; 164 size_t cchFirst = RTStrFormatNumber(szTmp, pu128->s.Hi, 16, 0, 0, fFlags | RTSTR_F_64BIT); 165 size_t cchSecond = RTStrFormatNumber(&szTmp[cchFirst], pu128->s.Lo, 16, 8, 0, 166 (fFlags | RTSTR_F_64BIT | RTSTR_F_ZEROPAD) & ~RTSTR_F_SPECIAL); 167 int rc = RTStrCopy(pszBuf, cbBuf, szTmp); 168 if (RT_FAILURE(rc)) 169 return rc; 170 return cchFirst + cchSecond; 163 char szTmp[64+32+32+32]; 164 char *pszTmp = cbBuf >= sizeof(szTmp) ? pszBuf : szTmp; 165 size_t cchResult = RTStrFormatNumber(pszTmp, pu128->QWords.qw1, 16, 0, 0, fFlags | RTSTR_F_64BIT); 166 cchResult += RTStrFormatNumber(&pszTmp[cchResult], pu128->QWords.qw0, 16, 8, 0, 167 (fFlags | RTSTR_F_64BIT | RTSTR_F_ZEROPAD) & ~RTSTR_F_SPECIAL); 168 if (pszTmp == pszBuf) 169 return cchResult; 170 int rc = RTStrCopy(pszBuf, cbBuf, pszTmp); 171 if (RT_SUCCESS(rc)) 172 return cchResult; 173 return rc; 171 174 } 172 175 … … 182 185 char szTmp[64+32+32+32]; 183 186 char *pszTmp = cbBuf >= sizeof(szTmp) ? pszBuf : szTmp; 184 size_t cchResult = RTStrFormatNumber( szTmp, pu256->QWords.qw3, 16, 0, 0, fFlags | RTSTR_F_64BIT);187 size_t cchResult = RTStrFormatNumber(pszTmp, pu256->QWords.qw3, 16, 0, 0, fFlags | RTSTR_F_64BIT); 185 188 cchResult += RTStrFormatNumber(&pszTmp[cchResult], pu256->QWords.qw2, 16, 8, 0, 186 189 (fFlags | RTSTR_F_64BIT | RTSTR_F_ZEROPAD) & ~RTSTR_F_SPECIAL); … … 208 211 char szTmp[64+32+32+32 + 32+32+32+32]; 209 212 char *pszTmp = cbBuf >= sizeof(szTmp) ? pszBuf : szTmp; 210 size_t cchResult = RTStrFormatNumber( szTmp, pu512->QWords.qw7, 16, 0, 0, fFlags | RTSTR_F_64BIT);213 size_t cchResult = RTStrFormatNumber(pszTmp, pu512->QWords.qw7, 16, 0, 0, fFlags | RTSTR_F_64BIT); 211 214 cchResult += RTStrFormatNumber(&pszTmp[cchResult], pu512->QWords.qw6, 16, 8, 0, 212 215 (fFlags | RTSTR_F_64BIT | RTSTR_F_ZEROPAD) & ~RTSTR_F_SPECIAL);
Note:
See TracChangeset
for help on using the changeset viewer.