Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
1e1f9e91
Commit
1e1f9e91
authored
3 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Another attempt was made
parent
886fb9f3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llcommon/lluuid.cpp
+22
-6
22 additions, 6 deletions
indra/llcommon/lluuid.cpp
with
22 additions
and
6 deletions
indra/llcommon/lluuid.cpp
+
22
−
6
View file @
1e1f9e91
...
@@ -116,6 +116,18 @@ unsigned int decode( char const * fiveChars ) throw( bad_input_data )
...
@@ -116,6 +116,18 @@ unsigned int decode( char const * fiveChars ) throw( bad_input_data )
}
}
*/
*/
char
to_char
(
size_t
i
)
{
if
(
i
<=
9
)
{
return
static_cast
<
char
>
(
'0'
+
i
);
}
else
{
return
static_cast
<
char
>
(
'a'
+
(
i
-
10
));
}
}
// Common to all UUID implementations
// Common to all UUID implementations
void
LLUUID
::
to_chars
(
char
*
out
)
const
void
LLUUID
::
to_chars
(
char
*
out
)
const
{
{
...
@@ -171,23 +183,27 @@ void LLUUID::to_chars(char* out) const
...
@@ -171,23 +183,27 @@ void LLUUID::to_chars(char* out) const
memcpy
(
out
,
buffer
,
UUID_STR_SIZE
-
1
);
memcpy
(
out
,
buffer
,
UUID_STR_SIZE
-
1
);
#else
#else
alignas
(
16
)
char
result
[
UUID_STR_SIZE
-
1
]
=
{};
// Temporary aligned output buffer for simd op
for
(
size_t
i
=
0
,
cur_pos
=
0
;
i
<
UUID_BYTES
;
++
i
)
for
(
size_t
i
=
0
,
cur_pos
=
0
;
i
<
UUID_BYTES
;
++
i
)
{
{
const
U8
uuid_byte
=
mData
[
i
];
const
U8
uuid_byte
=
mData
[
i
];
const
size_t
hi
=
((
uuid_byte
)
>>
4
)
&
0x0F
;
const
size_t
hi
=
((
uuid_byte
)
>>
4
)
&
0x0F
;
ou
t
[
cur_pos
]
=
(
i
<=
9
)
?
static_cast
<
char
>
(
'0'
+
hi
)
:
static_cast
<
char
>
(
'a'
+
(
hi
-
10
)
);
resul
t
[
cur_pos
]
=
to_char
(
hi
);
++
cur_pos
;
cur_pos
++
;
const
size_t
lo
=
(
uuid_byte
)
&
0x0F
;
const
size_t
lo
=
(
uuid_byte
)
&
0x0F
;
ou
t
[
cur_pos
]
=
(
i
<=
9
)
?
static_cast
<
char
>
(
'0'
+
lo
)
:
static_cast
<
char
>
(
'a'
+
(
lo
-
10
)
);
resul
t
[
cur_pos
]
=
to_char
(
lo
);
++
cur_pos
;
cur_pos
++
;
if
(
i
==
3
||
i
==
5
||
i
==
7
||
i
==
9
)
if
(
i
==
3
||
i
==
5
||
i
==
7
||
i
==
9
)
{
{
ou
t
[
cur_pos
]
=
'-'
;
resul
t
[
cur_pos
]
=
'-'
;
++
cur_pos
;
cur_pos
++
;
}
}
}
}
memcpy
(
out
,
result
,
UUID_STR_SIZE
-
1
);
#endif
#endif
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment