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
721cf711
Commit
721cf711
authored
Sep 12, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unused-const-variable warning
parent
b52c9432
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
libcaf_core/src/fnv_hash.cpp
libcaf_core/src/fnv_hash.cpp
+16
-15
No files found.
libcaf_core/src/fnv_hash.cpp
View file @
721cf711
...
@@ -18,41 +18,42 @@
...
@@ -18,41 +18,42 @@
#include "caf/detail/fnv_hash.hpp"
#include "caf/detail/fnv_hash.hpp"
#include <cstdint>
namespace
caf
{
namespace
caf
{
namespace
detail
{
namespace
detail
{
namespace
{
namespace
{
template
<
size_t
IntegerSize
>
#if SIZE_MAX == 0xFFFFFFFF
struct
hash_conf_helper
;
constexpr
size_t
basis
=
2166136261u
;
constexpr
size_t
prime
=
16777619u
;
#elif SIZE_MAX == 0xFFFFFFFFFFFFFFFF
template
<
>
constexpr
size_t
basis
=
14695981039346656037u
;
struct
hash_conf_helper
<
4
>
{
static
constexpr
size_t
basis
=
2166136261u
;
static
constexpr
size_t
prime
=
16777619u
;
constexpr
size_t
prime
=
1099511628211u
;
};
template
<
>
#else
struct
hash_conf_helper
<
8
>
{
static
constexpr
size_t
basis
=
14695981039346656037u
;
static
constexpr
size_t
prime
=
1099511628211u
;
# error Platform and/or compiler not supported
};
struct
hash_conf
:
hash_conf_helper
<
sizeof
(
size_t
)
>
{};
#endif
}
// namespace
}
// namespace
size_t
fnv_hash
(
const
unsigned
char
*
first
,
const
unsigned
char
*
last
)
{
size_t
fnv_hash
(
const
unsigned
char
*
first
,
const
unsigned
char
*
last
)
{
return
fnv_hash_append
(
hash_conf
::
basis
,
first
,
last
);
return
fnv_hash_append
(
basis
,
first
,
last
);
}
}
size_t
fnv_hash_append
(
size_t
intermediate
,
const
unsigned
char
*
first
,
size_t
fnv_hash_append
(
size_t
intermediate
,
const
unsigned
char
*
first
,
const
unsigned
char
*
last
)
{
const
unsigned
char
*
last
)
{
auto
result
=
intermediate
;
auto
result
=
intermediate
;
for
(;
first
!=
last
;
++
first
)
{
for
(;
first
!=
last
;
++
first
)
{
result
*=
hash_conf
::
prime
;
result
*=
prime
;
result
^=
*
first
;
result
^=
*
first
;
}
}
return
result
;
return
result
;
...
...
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