aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/query.hxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-10-27 12:19:51 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-10-27 12:19:51 +0200
commit28b7e2b218d673665fa906d0d1be2d50c8ff2d70 (patch)
tree3f6b704bb75af1cf0a8c50f0fc52e6e54b22acc3 /odb/oracle/query.hxx
parentef1a2f93bec26617fb2c9287bd42c9179f76165c (diff)
Use sizeof consistently to specify image capacity
Diffstat (limited to 'odb/oracle/query.hxx')
-rw-r--r--odb/oracle/query.hxx34
1 files changed, 25 insertions, 9 deletions
diff --git a/odb/oracle/query.hxx b/odb/oracle/query.hxx
index ac5cfc6..c392704 100644
--- a/odb/oracle/query.hxx
+++ b/odb/oracle/query.hxx
@@ -1193,7 +1193,7 @@ namespace odb
{
b->type = bind_type::integer;
b->buffer = &image_;
- b->capacity = sizeof (int);
+ b->capacity = sizeof (image_);
b->size = 0;
}
@@ -1229,7 +1229,7 @@ namespace odb
{
b->type = bind_type::integer;
b->buffer = &image_;
- b->capacity = sizeof (long long);
+ b->capacity = sizeof (image_);
b->size = 0;
}
@@ -1304,7 +1304,7 @@ namespace odb
{
b->type = bind_type::binary_float;
b->buffer = &image_;
- b->capacity = sizeof (float);
+ b->capacity = sizeof (image_);
b->size = 0;
}
@@ -1340,7 +1340,7 @@ namespace odb
{
b->type = bind_type::binary_double;
b->buffer = &image_;
- b->capacity = sizeof (double);
+ b->capacity = sizeof (image_);
b->size = 0;
}
@@ -1460,8 +1460,12 @@ namespace odb
init (const T& v)
{
bool dummy;
- std::size_t size (0), cap (11);
- value_traits<T, id_timestamp>::set_image (image_, size, cap, dummy, v);
+ std::size_t size (0);
+ value_traits<T, id_timestamp>::set_image (image_,
+ size,
+ sizeof (image_),
+ dummy,
+ v);
size_ = static_cast<ub2> (size);
}
@@ -1500,7 +1504,11 @@ namespace odb
{
bool dummy;
std::size_t size (0);
- value_traits<T, id_string>::set_image (image_, 4000, size, dummy, v);
+ value_traits<T, id_string>::set_image (image_,
+ sizeof (image_),
+ size,
+ dummy,
+ v);
size_ = static_cast<ub2> (size);
}
@@ -1539,7 +1547,11 @@ namespace odb
{
bool dummy;
std::size_t size (0);
- value_traits<T, id_nstring>::set_image (image_, 4000, size, dummy, v);
+ value_traits<T, id_nstring>::set_image (image_,
+ sizeof (image_),
+ size,
+ dummy,
+ v);
size_ = static_cast<ub2> (size);
}
@@ -1578,7 +1590,11 @@ namespace odb
{
bool dummy;
std::size_t size (0);
- value_traits<T, id_raw>::set_image (image_, 4000, size, dummy, v);
+ value_traits<T, id_raw>::set_image (image_,
+ sizeof (image_),
+ size,
+ dummy,
+ v);
size_ = static_cast<ub2> (size);
}