Changeset 40988 in vbox
- Timestamp:
- Apr 19, 2012 1:25:45 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77546
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/strformatrt.cpp
r40938 r40988 49 49 #include <iprt/net.h> 50 50 #include <iprt/path.h> 51 #include <iprt/asm.h> 51 52 #define STRFORMAT_WITH_X86 52 53 #ifdef STRFORMAT_WITH_X86 … … 517 518 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 518 519 "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", 519 u.pUuid->Gen.u32TimeLow,520 u.pUuid->Gen.u16TimeMid,521 u.pUuid->Gen.u16TimeHiAndVersion,520 RT_H2LE_U32(u.pUuid->Gen.u32TimeLow), 521 RT_H2LE_U16(u.pUuid->Gen.u16TimeMid), 522 RT_H2LE_U16(u.pUuid->Gen.u16TimeHiAndVersion), 522 523 u.pUuid->Gen.u8ClockSeqHiAndReserved, 523 524 u.pUuid->Gen.u8ClockSeqLow, -
trunk/src/VBox/Runtime/generic/uuid-generic.cpp
r32995 r40988 34 34 #include <iprt/assert.h> 35 35 #include <iprt/err.h> 36 #include <iprt/asm.h> 36 37 37 38 … … 201 202 * pUuid->Gen.au8Node[5]); 202 203 */ 203 u32TimeLow = pUuid->Gen.u32TimeLow;204 u32TimeLow = RT_H2LE_U32(pUuid->Gen.u32TimeLow); 204 205 pszString[ 0] = g_achDigits[(u32TimeLow >> 28)/*& 0xf*/]; 205 206 pszString[ 1] = g_achDigits[(u32TimeLow >> 24) & 0xf]; … … 211 212 pszString[ 7] = g_achDigits[(u32TimeLow/*>>0*/)& 0xf]; 212 213 pszString[ 8] = '-'; 213 u = pUuid->Gen.u16TimeMid;214 u = RT_H2LE_U16(pUuid->Gen.u16TimeMid); 214 215 pszString[ 9] = g_achDigits[(u >> 12)/*& 0xf*/]; 215 216 pszString[10] = g_achDigits[(u >> 8) & 0xf]; … … 217 218 pszString[12] = g_achDigits[(u/*>>0*/)& 0xf]; 218 219 pszString[13] = '-'; 219 u = pUuid->Gen.u16TimeHiAndVersion;220 u = RT_H2LE_U16(pUuid->Gen.u16TimeHiAndVersion); 220 221 pszString[14] = g_achDigits[(u >> 12)/*& 0xf*/]; 221 222 pszString[15] = g_achDigits[(u >> 8) & 0xf]; … … 308 309 */ 309 310 #define MY_TONUM(ch) (g_au8Digits[(ch) & 0xff]) 310 pUuid->Gen.u32TimeLow = (uint32_t)MY_TONUM(pszString[ 0]) << 28311 pUuid->Gen.u32TimeLow = RT_LE2H_U32((uint32_t)MY_TONUM(pszString[ 0]) << 28 311 312 | (uint32_t)MY_TONUM(pszString[ 1]) << 24 312 313 | (uint32_t)MY_TONUM(pszString[ 2]) << 20 … … 315 316 | (uint32_t)MY_TONUM(pszString[ 5]) << 8 316 317 | (uint32_t)MY_TONUM(pszString[ 6]) << 4 317 | (uint32_t)MY_TONUM(pszString[ 7]) ;318 pUuid->Gen.u16TimeMid = (uint16_t)MY_TONUM(pszString[ 9]) << 12318 | (uint32_t)MY_TONUM(pszString[ 7])); 319 pUuid->Gen.u16TimeMid = RT_LE2H_U16((uint16_t)MY_TONUM(pszString[ 9]) << 12 319 320 | (uint16_t)MY_TONUM(pszString[10]) << 8 320 321 | (uint16_t)MY_TONUM(pszString[11]) << 4 321 | (uint16_t)MY_TONUM(pszString[12]) ;322 pUuid->Gen.u16TimeHiAndVersion = 322 | (uint16_t)MY_TONUM(pszString[12])); 323 pUuid->Gen.u16TimeHiAndVersion = RT_LE2H_U16( 323 324 (uint16_t)MY_TONUM(pszString[14]) << 12 324 325 | (uint16_t)MY_TONUM(pszString[15]) << 8 325 326 | (uint16_t)MY_TONUM(pszString[16]) << 4 326 | (uint16_t)MY_TONUM(pszString[17]) ;327 | (uint16_t)MY_TONUM(pszString[17])); 327 328 pUuid->Gen.u8ClockSeqHiAndReserved = 328 329 (uint16_t)MY_TONUM(pszString[19]) << 4 … … 373 374 * pUuid->Gen.au8Node[5]); 374 375 */ 375 u32TimeLow = pUuid->Gen.u32TimeLow;376 u32TimeLow = RT_H2LE_U32(pUuid->Gen.u32TimeLow); 376 377 pwszString[ 0] = g_achDigits[(u32TimeLow >> 28)/*& 0xf*/]; 377 378 pwszString[ 1] = g_achDigits[(u32TimeLow >> 24) & 0xf]; … … 383 384 pwszString[ 7] = g_achDigits[(u32TimeLow/*>>0*/)& 0xf]; 384 385 pwszString[ 8] = '-'; 385 u = pUuid->Gen.u16TimeMid;386 u = RT_H2LE_U16(pUuid->Gen.u16TimeMid); 386 387 pwszString[ 9] = g_achDigits[(u >> 12)/*& 0xf*/]; 387 388 pwszString[10] = g_achDigits[(u >> 8) & 0xf]; … … 389 390 pwszString[12] = g_achDigits[(u/*>>0*/)& 0xf]; 390 391 pwszString[13] = '-'; 391 u = pUuid->Gen.u16TimeHiAndVersion;392 u = RT_H2LE_U16(pUuid->Gen.u16TimeHiAndVersion); 392 393 pwszString[14] = g_achDigits[(u >> 12)/*& 0xf*/]; 393 394 pwszString[15] = g_achDigits[(u >> 8) & 0xf]; … … 480 481 */ 481 482 #define MY_TONUM(ch) (g_au8Digits[(ch) & 0xff]) 482 pUuid->Gen.u32TimeLow = (uint32_t)MY_TONUM(pwszString[ 0]) << 28483 pUuid->Gen.u32TimeLow = RT_LE2H_U32((uint32_t)MY_TONUM(pwszString[ 0]) << 28 483 484 | (uint32_t)MY_TONUM(pwszString[ 1]) << 24 484 485 | (uint32_t)MY_TONUM(pwszString[ 2]) << 20 … … 487 488 | (uint32_t)MY_TONUM(pwszString[ 5]) << 8 488 489 | (uint32_t)MY_TONUM(pwszString[ 6]) << 4 489 | (uint32_t)MY_TONUM(pwszString[ 7]) ;490 pUuid->Gen.u16TimeMid = (uint16_t)MY_TONUM(pwszString[ 9]) << 12490 | (uint32_t)MY_TONUM(pwszString[ 7])); 491 pUuid->Gen.u16TimeMid = RT_LE2H_U16((uint16_t)MY_TONUM(pwszString[ 9]) << 12 491 492 | (uint16_t)MY_TONUM(pwszString[10]) << 8 492 493 | (uint16_t)MY_TONUM(pwszString[11]) << 4 493 | (uint16_t)MY_TONUM(pwszString[12]) ;494 pUuid->Gen.u16TimeHiAndVersion = 494 | (uint16_t)MY_TONUM(pwszString[12])); 495 pUuid->Gen.u16TimeHiAndVersion = RT_LE2H_U16( 495 496 (uint16_t)MY_TONUM(pwszString[14]) << 12 496 497 | (uint16_t)MY_TONUM(pwszString[15]) << 8 497 498 | (uint16_t)MY_TONUM(pwszString[16]) << 4 498 | (uint16_t)MY_TONUM(pwszString[17]) ;499 | (uint16_t)MY_TONUM(pwszString[17])); 499 500 pUuid->Gen.u8ClockSeqHiAndReserved = 500 501 (uint16_t)MY_TONUM(pwszString[19]) << 4
Note:
See TracChangeset
for help on using the changeset viewer.