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
1f05fe21
Commit
1f05fe21
authored
Jul 28, 2008
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
port to 32 bit linux
git-svn-id:
file:///svn/tokudb@5381
c7de825b-a66e-492c-adef-691d508d4ae1
parent
3aafa0d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
newbrt/tests/x1764-test.c
newbrt/tests/x1764-test.c
+1
-1
newbrt/x1764.c
newbrt/x1764.c
+7
-6
No files found.
newbrt/tests/x1764-test.c
View file @
1f05fe21
...
...
@@ -14,7 +14,7 @@ void test0 (void) {
}
void
test1
(
void
)
{
u_int64_t
v
=
0x123456789abcdef0
;
u_int64_t
v
=
0x123456789abcdef0
ULL
;
u_int32_t
c
;
int
i
;
for
(
i
=
0
;
i
<=
8
;
i
++
)
{
...
...
newbrt/x1764.c
View file @
1f05fe21
...
...
@@ -2,6 +2,7 @@
#include "toku_assert.h"
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#define PRINT 0
...
...
@@ -11,7 +12,7 @@ u_int32_t x1764_memory (const void *buf, int len)
u_int64_t
c
=
0
;
while
(
len
>=
8
)
{
c
=
c
*
17
+
*
lbuf
;
if
(
PRINT
)
printf
(
"%d: c=%016
lx sum=%016lx
\n
"
,
__LINE__
,
*
lbuf
,
c
);
if
(
PRINT
)
printf
(
"%d: c=%016
"
PRIx64
" sum=%016"
PRIx64
"
\n
"
,
__LINE__
,
*
lbuf
,
c
);
lbuf
++
;
len
-=
8
;
}
...
...
@@ -77,9 +78,9 @@ inline void x1764_add (struct x1764 *l, const void *vbuf, int len) {
u_int64_t
thisv
=
*
(
u_int64_t
*
)
cbuf
;
input
|=
thisv
<<
(
8
*
n_input_bytes
);
sum
=
sum
*
17
+
input
;
if
(
PRINT
)
printf
(
"%d: input=%016
lx sum=%016lx
\n
"
,
__LINE__
,
input
,
sum
);
if
(
PRINT
)
printf
(
"%d: input=%016
"
PRIx64
" sum=%016"
PRIx64
"
\n
"
,
__LINE__
,
input
,
sum
);
input
=
thisv
>>
(
8
*
(
8
-
n_input_bytes
));
if
(
PRINT
)
printf
(
"%d: input=%016
lx
\n
"
,
__LINE__
,
input
);
if
(
PRINT
)
printf
(
"%d: input=%016
"
PRIx64
"
\n
"
,
__LINE__
,
input
);
len
-=
8
;
cbuf
+=
8
;
// n_input_bytes remains unchanged
...
...
@@ -91,15 +92,15 @@ inline void x1764_add (struct x1764 *l, const void *vbuf, int len) {
u_int64_t
thisv
=
*
(
u_int32_t
*
)
cbuf
;
if
(
n_input_bytes
<
4
)
{
input
|=
thisv
<<
(
8
*
n_input_bytes
);
if
(
PRINT
)
printf
(
"%d: input=%016
lx
\n
"
,
__LINE__
,
input
);
if
(
PRINT
)
printf
(
"%d: input=%016
"
PRIx64
"
\n
"
,
__LINE__
,
input
);
n_input_bytes
+=
4
;
}
else
{
input
|=
thisv
<<
(
8
*
n_input_bytes
);
l
->
sum
=
l
->
sum
*
17
+
input
;
if
(
PRINT
)
printf
(
"%d: input=%016
lx sum=%016lx
\n
"
,
__LINE__
,
input
,
l
->
sum
);
if
(
PRINT
)
printf
(
"%d: input=%016
"
PRIx64
" sum=%016"
PRIx64
"
\n
"
,
__LINE__
,
input
,
l
->
sum
);
input
=
thisv
>>
(
8
*
(
8
-
n_input_bytes
));
n_input_bytes
-=
4
;
if
(
PRINT
)
printf
(
"%d: input=%016
lx
n_input_bytes=%d
\n
"
,
__LINE__
,
input
,
n_input_bytes
);
if
(
PRINT
)
printf
(
"%d: input=%016
"
PRIx64
"
n_input_bytes=%d
\n
"
,
__LINE__
,
input
,
n_input_bytes
);
}
len
-=
4
;
cbuf
+=
4
;
...
...
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