Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
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
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
nexedi
MariaDB
Commits
7b5aaaa5
Commit
7b5aaaa5
authored
Mar 17, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Fix the build on big-endian systems
parents
bd6afd8b
c6db115c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
storage/innobase/ut/ut0crc32.cc
storage/innobase/ut/ut0crc32.cc
+17
-15
No files found.
storage/innobase/ut/ut0crc32.cc
View file @
7b5aaaa5
...
...
@@ -215,21 +215,6 @@ ut_crc32_64_low_hw(
return
(
static_cast
<
uint32_t
>
(
crc_64bit
));
}
/** Swap the byte order of an 8 byte integer.
@param[in] i 8-byte integer
@return 8-byte integer */
inline
uint64_t
ut_crc32_swap_byteorder
(
uint64_t
i
)
{
return
i
<<
56
|
(
i
&
0x000000000000FF00ULL
)
<<
40
|
(
i
&
0x0000000000FF0000ULL
)
<<
24
|
(
i
&
0x00000000FF000000ULL
)
<<
8
|
(
i
&
0x000000FF00000000ULL
)
>>
8
|
(
i
&
0x0000FF0000000000ULL
)
>>
24
|
(
i
&
0x00FF000000000000ULL
)
>>
40
|
i
>>
56
;
}
/** Calculate CRC32 over 64-bit byte string using a hardware/CPU instruction.
@param[in,out] crc crc32 checksum so far when this function is called,
when the function ends it will contain the new checksum
...
...
@@ -405,6 +390,23 @@ ut_crc32_8_sw(
(
*
len
)
--
;
}
/** Swap the byte order of an 8 byte integer.
@param[in] i 8-byte integer
@return 8-byte integer */
# ifdef WORDS_BIGENDIAN
inline
uint64_t
ut_crc32_swap_byteorder
(
uint64_t
i
)
{
return
i
<<
56
|
(
i
&
0x000000000000FF00ULL
)
<<
40
|
(
i
&
0x0000000000FF0000ULL
)
<<
24
|
(
i
&
0x00000000FF000000ULL
)
<<
8
|
(
i
&
0x000000FF00000000ULL
)
>>
8
|
(
i
&
0x0000FF0000000000ULL
)
>>
24
|
(
i
&
0x00FF000000000000ULL
)
>>
40
|
i
>>
56
;
}
# endif
/* WORDS_BIGENDIAN */
/** Calculate CRC32 over a 64-bit integer using a software implementation.
@param[in] crc crc32 checksum so far
@param[in] data data to be checksummed
...
...
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