Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
67bd88cf
Commit
67bd88cf
authored
Jan 01, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
overflow bugfix
parent
a5ad33b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
cppa/detail/atom_val.hpp
cppa/detail/atom_val.hpp
+13
-11
No files found.
cppa/detail/atom_val.hpp
View file @
67bd88cf
...
...
@@ -40,27 +40,29 @@ constexpr char encoding_table[] =
/* 0.. */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 1.. */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 2.. */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 3.. */
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
0
,
0
,
0
,
0
,
0
,
/* 4.. */
0
,
1
2
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
/* 5.. */
2
7
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
,
0
,
0
,
0
,
0
,
38
,
/* 6.. */
0
,
3
9
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
53
,
/* 7.. */
5
4
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
62
,
63
,
64
,
0
,
0
,
0
,
0
,
0
/* 3.. */
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
0
,
0
,
0
,
0
,
0
,
0
,
/* 4.. */
0
,
1
1
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
/* 5.. */
2
6
,
27
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
0
,
0
,
0
,
0
,
37
,
/* 6.. */
0
,
3
8
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
/* 7.. */
5
3
,
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
62
,
63
,
0
,
0
,
0
,
0
,
0
};
// decodes 6bit characters to ASCII
constexpr
char
decoding_table
[]
=
" 0123456789
:
"
constexpr
char
decoding_table
[]
=
" 0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ_"
"abcdefghijklmnopqrstuvwxyz"
;
inline
constexpr
std
::
uint64_t
next_interim
(
std
::
uint64_t
tmp
,
size_t
char_code
)
constexpr
std
::
uint64_t
next_interim
(
std
::
uint64_t
current
,
size_t
char_code
)
{
return
(
tmp
<<
6
)
|
encoding_table
[
char_code
];
return
(
current
<<
6
)
|
encoding_table
[(
char_code
<=
0x7F
)
?
char_code
:
0
];
}
constexpr
std
::
uint64_t
atom_val
(
char
const
*
str
,
std
::
uint64_t
interim
=
0
)
constexpr
std
::
uint64_t
atom_val
(
char
const
*
c
str
,
std
::
uint64_t
interim
=
0
)
{
return
(
*
str
<=
0
)
?
interim
:
atom_val
(
str
+
1
,
next_interim
(
interim
,
*
str
));
return
(
*
cstr
==
'\0'
)
?
interim
:
atom_val
(
cstr
+
1
,
next_interim
(
interim
,
static_cast
<
size_t
>
(
*
cstr
)));
}
}
}
}
// namespace cppa::detail::<anonymous>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment