Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
cd9c5709
Commit
cd9c5709
authored
Jan 31, 2015
by
Davis King
Browse files
Added an implicit conversion to unsigned long for extracting the checksum
of crc32 objects.
parent
ff451abb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
dlib/crc32/crc32_kernel_1.h
dlib/crc32/crc32_kernel_1.h
+3
-0
dlib/crc32/crc32_kernel_abstract.h
dlib/crc32/crc32_kernel_abstract.h
+7
-0
dlib/test/crc32.cpp
dlib/test/crc32.cpp
+1
-1
No files found.
dlib/crc32/crc32_kernel_1.h
View file @
cd9c5709
...
...
@@ -55,6 +55,9 @@ namespace dlib
const
std
::
vector
<
char
>&
item
);
inline
operator
unsigned
long
(
)
const
{
return
get_checksum
();
}
inline
unsigned
long
get_checksum
(
)
const
;
...
...
dlib/crc32/crc32_kernel_abstract.h
View file @
cd9c5709
...
...
@@ -101,6 +101,13 @@ namespace dlib
- returns the current checksum
!*/
operator
unsigned
long
(
)
const
;
/*!
ensures
- returns get_checksum()
!*/
void
swap
(
crc32
&
item
);
...
...
dlib/test/crc32.cpp
View file @
cd9c5709
...
...
@@ -65,7 +65,7 @@ namespace
std
::
vector
<
char
>
buf
;
for
(
int
i
=
0
;
i
<
4000
;
++
i
)
buf
.
push_back
(
i
);
DLIB_TEST
(
crc32
(
buf
)
.
get_checksum
()
==
492662731
);
DLIB_TEST
(
crc32
(
buf
)
==
492662731
);
}
}
a
;
...
...
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