Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
3af2603f
Commit
3af2603f
authored
May 06, 2013
by
Mukund Sivaraman
Browse files
[2850] Fix type of checksum
parent
03ce449e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/datasrc/memory/zone_table_segment_mapped.cc
View file @
3af2603f
...
...
@@ -58,12 +58,12 @@ ZoneTableSegmentMapped::processChecksum(MemorySegmentMapped& segment,
// The segment was already shrunk when it was last
// closed. Check that its checksum is consistent.
assert
(
result
.
second
);
uint32
_t
*
checksum
=
static_cast
<
uint32
_t
*>
(
result
.
second
);
const
uint32
_t
saved_checksum
=
*
checksum
;
size
_t
*
checksum
=
static_cast
<
size
_t
*>
(
result
.
second
);
const
size
_t
saved_checksum
=
*
checksum
;
// First, clear the checksum so that getCheckSum() returns a
// consistent value.
*
checksum
=
0
;
const
uint32
_t
new_checksum
=
segment
.
getCheckSum
();
const
size
_t
new_checksum
=
segment
.
getCheckSum
();
if
(
saved_checksum
!=
new_checksum
)
{
error_msg
=
"Saved checksum doesn't match segment data"
;
return
(
false
);
...
...
@@ -79,12 +79,12 @@ ZoneTableSegmentMapped::processChecksum(MemorySegmentMapped& segment,
void
*
checksum
=
NULL
;
while
(
!
checksum
)
{
try
{
checksum
=
segment
.
allocate
(
sizeof
(
uint32
_t
));
checksum
=
segment
.
allocate
(
sizeof
(
size
_t
));
}
catch
(
const
MemorySegmentGrown
&
)
{
// Do nothing and try again.
}
}
*
static_cast
<
uint32
_t
*>
(
checksum
)
=
0
;
*
static_cast
<
size
_t
*>
(
checksum
)
=
0
;
const
bool
grew
=
segment
.
setNamedAddress
(
ZONE_TABLE_CHECKSUM_NAME
,
checksum
);
if
(
grew
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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