Changeset 11413 in vbox for trunk/src/VBox
- Timestamp:
- Aug 14, 2008 8:03:03 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 34729
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/VBox/strformat-vbox.cpp
r9224 r11413 464 464 pUuid->Gen.u16TimeMid, 465 465 pUuid->Gen.u16TimeHiAndVersion, 466 pUuid->Gen.u 16ClockSeq & 0xff,467 pUuid->Gen.u 16ClockSeq >> 8,466 pUuid->Gen.u8ClockSeqHiAndReserved, 467 pUuid->Gen.u8ClockSeqLow, 468 468 pUuid->Gen.au8Node[0], 469 469 pUuid->Gen.au8Node[1], -
trunk/src/VBox/Runtime/common/string/strformatrt.cpp
r9226 r11413 458 458 u.pUuid->Gen.u16TimeMid, 459 459 u.pUuid->Gen.u16TimeHiAndVersion, 460 u.pUuid->Gen.u 16ClockSeq & 0xff,461 u.pUuid->Gen.u 16ClockSeq >> 8,460 u.pUuid->Gen.u8ClockSeqHiAndReserved, 461 u.pUuid->Gen.u8ClockSeqLow, 462 462 u.pUuid->Gen.au8Node[0], 463 463 u.pUuid->Gen.au8Node[1], -
trunk/src/VBox/Runtime/generic/RTUuidCreate-generic.cpp
r9744 r11413 39 39 40 40 41 /* WARNING: This implementation ASSUMES little endian. Needs testing on big endian! */ 41 /* WARNING: This implementation ASSUMES little endian. Does not work on big endian! */ 42 43 /* Remember, the time fields in the UUID must be little endian. */ 42 44 43 45 … … 48 50 49 51 RTRandBytes(pUuid, sizeof(*pUuid)); 50 pUuid->Gen.u 16ClockSeq = (pUuid->Gen.u16ClockSeq & 0x3fff) | 0x8000;52 pUuid->Gen.u8ClockSeqHiAndReserved = (pUuid->Gen.u8ClockSeqHiAndReserved & 0x3f) | 0x80; 51 53 pUuid->Gen.u16TimeHiAndVersion = (pUuid->Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000; 52 54 -
trunk/src/VBox/Runtime/generic/uuid-generic.cpp
r9743 r11413 38 38 39 39 40 /* WARNING: This implementation ASSUMES little endian. Needs testing on big endian! */ 40 /* WARNING: This implementation ASSUMES little endian. Does not work on big endian! */ 41 42 /* Remember, the time fields in the UUID must be little endian. */ 41 43 42 44 … … 81 83 if (pUuid1->Gen.u16TimeHiAndVersion != pUuid2->Gen.u16TimeHiAndVersion) 82 84 return pUuid1->Gen.u16TimeHiAndVersion < pUuid2->Gen.u16TimeHiAndVersion ? -1 : 1; 83 if (pUuid1->Gen.u16ClockSeq != pUuid2->Gen.u16ClockSeq) 84 return pUuid1->Gen.u16ClockSeq < pUuid2->Gen.u16ClockSeq ? -1 : 1; 85 if (pUuid1->Gen.u8ClockSeqHiAndReserved != pUuid2->Gen.u8ClockSeqHiAndReserved) 86 return pUuid1->Gen.u8ClockSeqHiAndReserved < pUuid2->Gen.u8ClockSeqHiAndReserved ? -1 : 1; 87 if (pUuid1->Gen.u8ClockSeqLow != pUuid2->Gen.u8ClockSeqLow) 88 return pUuid1->Gen.u8ClockSeqLow < pUuid2->Gen.u8ClockSeqLow ? -1 : 1; 85 89 if (pUuid1->Gen.au8Node[0] != pUuid2->Gen.au8Node[0]) 86 90 return pUuid1->Gen.au8Node[0] < pUuid2->Gen.au8Node[0] ? -1 : 1; … … 160 164 pszString[17] = s_achDigits[(u/*>>0*/)& 0xf]; 161 165 pszString[18] = '-'; 162 u = pUuid->Gen.u16ClockSeq; 163 pszString[19] = s_achDigits[(u >> 4) & 0xf]; 164 pszString[20] = s_achDigits[(u/*>>0*/)& 0xf]; 165 pszString[21] = s_achDigits[(u >> 12)/*& 0xf*/]; 166 pszString[22] = s_achDigits[(u >> 8) & 0xf]; 166 pszString[19] = s_achDigits[pUuid->Gen.u8ClockSeqHiAndReserved >> 4]; 167 pszString[20] = s_achDigits[pUuid->Gen.u8ClockSeqHiAndReserved & 0xf]; 168 pszString[21] = s_achDigits[pUuid->Gen.u8ClockSeqLow >> 4]; 169 pszString[22] = s_achDigits[pUuid->Gen.u8ClockSeqLow & 0xf]; 167 170 pszString[23] = '-'; 168 171 pszString[24] = s_achDigits[pUuid->Gen.au8Node[0] >> 4]; … … 276 279 | (uint16_t)MY_TONUM(pszString[16]) << 4 277 280 | (uint16_t)MY_TONUM(pszString[17]); 278 pUuid->Gen.u16ClockSeq =(uint16_t)MY_TONUM(pszString[19]) << 4 279 | (uint16_t)MY_TONUM(pszString[20]) 280 | (uint16_t)MY_TONUM(pszString[21]) << 12 281 | (uint16_t)MY_TONUM(pszString[22]) << 8; 281 pUuid->Gen.u8ClockSeqHiAndReserved = 282 (uint16_t)MY_TONUM(pszString[19]) << 4 283 | (uint16_t)MY_TONUM(pszString[20]); 284 pUuid->Gen.u8ClockSeqLow = 285 (uint16_t)MY_TONUM(pszString[21]) << 4 286 | (uint16_t)MY_TONUM(pszString[22]); 282 287 pUuid->Gen.au8Node[0] = (uint8_t)MY_TONUM(pszString[24]) << 4 283 288 | (uint8_t)MY_TONUM(pszString[25]); -
trunk/src/VBox/Runtime/testcase/tstUuid.cpp
r11393 r11413 97 97 Uuid3.au8[14] = 0xdc; 98 98 Uuid3.au8[15] = 0xfe; 99 Uuid3.Gen.u 16ClockSeq = (Uuid3.Gen.u16ClockSeq & 0x3fff) | 0x8000;99 Uuid3.Gen.u8ClockSeqHiAndReserved = (Uuid3.Gen.u8ClockSeqHiAndReserved & 0x3f) | 0x80; 100 100 Uuid3.Gen.u16TimeHiAndVersion = (Uuid3.Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000; 101 const char *pszUuid3 = "67452301-ab89-4fcd- 10b2-547698badcfe";101 const char *pszUuid3 = "67452301-ab89-4fcd-90b2-547698badcfe"; 102 102 rc = RTUuidToStr(&Uuid3, sz, sizeof(sz)); CHECK_RC(); 103 103 CHECK_EXPR(strcmp(sz, pszUuid3) == 0);
Note:
See TracChangeset
for help on using the changeset viewer.