Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hal Finkel
hpcrc64
Commits
0c452f28
Commit
0c452f28
authored
Oct 06, 2014
by
Hal Finkel
Browse files
Rename the pointer argument of crc64_invert for clarity
parent
96316bae
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/CRC64.h
View file @
0c452f28
...
@@ -84,7 +84,7 @@ uint64_t crc64_omp(const void *input, size_t nbytes);
...
@@ -84,7 +84,7 @@ uint64_t crc64_omp(const void *input, size_t nbytes);
* Calculate the 'check bytes' for the provided CRC64. If these bytes are
* Calculate the 'check bytes' for the provided CRC64. If these bytes are
* appended to the original buffer, then the new total CRC64 should be -1.
* appended to the original buffer, then the new total CRC64 should be -1.
*/
*/
void
crc64_invert
(
uint64_t
cs
,
void
*
buffer
);
void
crc64_invert
(
uint64_t
cs
,
void
*
check_bytes
);
/*
/*
* Given the CRC64 of the first part of a buffer, and the CRC64 and length of
* Given the CRC64 of the first part of a buffer, and the CRC64 and length of
...
...
src/CRC64.c
View file @
0c452f28
...
@@ -1319,8 +1319,8 @@ uint64_t crc64(const void *input, size_t nbytes) {
...
@@ -1319,8 +1319,8 @@ uint64_t crc64(const void *input, size_t nbytes) {
// Calculate the 'check bytes' for the provided checksum. If these bytes are
// Calculate the 'check bytes' for the provided checksum. If these bytes are
// appended to the original buffer, then the new total checksum should be -1.
// appended to the original buffer, then the new total checksum should be -1.
void
crc64_invert
(
uint64_t
cs
,
void
*
buffer
)
{
void
crc64_invert
(
uint64_t
cs
,
void
*
check_bytes
)
{
unsigned
char
*
bytes
=
(
unsigned
char
*
)
buffer
;
unsigned
char
*
bytes
=
(
unsigned
char
*
)
check_bytes
;
cs
^=
UINT64_C
(
0xffffffffffffffff
);
cs
^=
UINT64_C
(
0xffffffffffffffff
);
// The CRC is self-inverting (in big-endian, so the bit-reversed CRC is
// The CRC is self-inverting (in big-endian, so the bit-reversed CRC is
...
...
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