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
eab9604d
Commit
eab9604d
authored
Jan 31, 2015
by
Davis King
Browse files
Made bind() and get_column() correctly handle large unsigned 32bit integer
values.
parent
cd9c5709
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
dlib/sqlite/sqlite.h
dlib/sqlite/sqlite.h
+4
-2
No files found.
dlib/sqlite/sqlite.h
View file @
eab9604d
...
@@ -230,7 +230,8 @@ namespace dlib
...
@@ -230,7 +230,8 @@ namespace dlib
T
&
item
T
&
item
)
const
)
const
{
{
if
(
sizeof
(
T
)
<=
4
)
// unsigned ints won't fit into int all the time so put those into 64bit ints.
if
(
sizeof
(
T
)
<
sizeof
(
int
)
||
(
sizeof
(
T
)
==
sizeof
(
int
)
&&
is_signed_type
<
T
>::
value
))
item
=
get_column_as_int
(
idx
);
item
=
get_column_as_int
(
idx
);
else
else
item
=
get_column_as_int64
(
idx
);
item
=
get_column_as_int64
(
idx
);
...
@@ -386,7 +387,8 @@ namespace dlib
...
@@ -386,7 +387,8 @@ namespace dlib
const
T
&
item
const
T
&
item
)
)
{
{
if
(
sizeof
(
T
)
<=
4
)
// unsigned ints won't fit into int all the time so put those into 64bit ints.
if
(
sizeof
(
T
)
<
sizeof
(
int
)
||
(
sizeof
(
T
)
==
sizeof
(
int
)
&&
is_signed_type
<
T
>::
value
))
bind_int
(
idx
,
item
);
bind_int
(
idx
,
item
);
else
else
bind_int64
(
idx
,
item
);
bind_int64
(
idx
,
item
);
...
...
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