- Timestamp:
- Nov 7, 2008 8:14:23 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39016
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/generic/uuid-generic.cpp ¶
r11413 r13977 105 105 RTDECL(int) RTUuidCompareStr(PCRTUUID pUuid1, const char *pszString) 106 106 { 107 RTUUID Uuid2; 108 int rc; 109 107 110 /* check params */ 108 111 AssertPtrReturn(pUuid1, -1); … … 112 115 * Try convert the string to a UUID and then compare the two. 113 116 */ 114 RTUUID Uuid2; 115 int rc = RTUuidFromStr(&Uuid2, pszString); 117 rc = RTUuidFromStr(&Uuid2, pszString); 116 118 AssertRCReturn(rc, 1); 117 119 … … 122 124 RTDECL(int) RTUuidToStr(PCRTUUID pUuid, char *pszString, size_t cchString) 123 125 { 126 static const char s_achDigits[17] = "0123456789abcdef"; 127 uint32_t u32TimeLow; 128 unsigned u; 129 124 130 /* validate parameters */ 125 131 AssertPtrReturn(pUuid, VERR_INVALID_PARAMETER); … … 141 147 * pUuid->Gen.au8Node[5]); 142 148 */ 143 static const char s_achDigits[17] = "0123456789abcdef"; 144 uint32_t u32TimeLow = pUuid->Gen.u32TimeLow; 149 u32TimeLow = pUuid->Gen.u32TimeLow; 145 150 pszString[ 0] = s_achDigits[(u32TimeLow >> 28)/*& 0xf*/]; 146 151 pszString[ 1] = s_achDigits[(u32TimeLow >> 24) & 0xf]; … … 152 157 pszString[ 7] = s_achDigits[(u32TimeLow/*>>0*/)& 0xf]; 153 158 pszString[ 8] = '-'; 154 u nsigned u= pUuid->Gen.u16TimeMid;159 u = pUuid->Gen.u16TimeMid; 155 160 pszString[ 9] = s_achDigits[(u >> 12)/*& 0xf*/]; 156 161 pszString[10] = s_achDigits[(u >> 8) & 0xf];
Note:
See TracChangeset
for help on using the changeset viewer.