diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-09-27 17:15:48 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-09-27 17:20:06 +0200 |
commit | 7b9c412736f51965473649cac8caf5e933ae6b9e (patch) | |
tree | c4b2d89becc49fa7e5a56cea8b6352a4153d9885 /odb/oracle/traits.hxx | |
parent | afd8e6dd307288b68c4ce6163f918198d92bf363 (diff) |
Pass parameter callback user context as a const void*
This avoids usage of const_cast when manipulating the const qualified values
in set_image functions within the traits implementations.
Diffstat (limited to 'odb/oracle/traits.hxx')
-rw-r--r-- | odb/oracle/traits.hxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/odb/oracle/traits.hxx b/odb/oracle/traits.hxx index 687d28a..cedf064 100644 --- a/odb/oracle/traits.hxx +++ b/odb/oracle/traits.hxx @@ -516,20 +516,20 @@ namespace odb static void set_image (param_callback_type& cb, - void*& context, + const void*& context, bool& is_null, const std::string& v) { is_null = false; cb = ¶m_callback; - context = const_cast<std::string*> (&v); + context = &v; } static bool result_callback (void* context, void* buffer, ub4 size, chunk_position); static bool - param_callback (void* context, + param_callback (const void* context, ub4* position_context, void** buffer, ub4* size, @@ -565,17 +565,17 @@ namespace odb static void set_image (param_callback_type& cb, - void*& context, + const void*& context, bool& is_null, const char* v) { is_null = false; cb = ¶m_callback; - context = const_cast<char*> (v); + context = v; } static bool - param_callback (void* context, + param_callback (const void* context, ub4* position_context, void** buffer, ub4* size, @@ -646,20 +646,20 @@ namespace odb static void set_image (param_callback_type& cb, - void*& context, + const void*& context, bool& is_null, const value_type& v) { is_null = false; cb = ¶m_callback; - context = const_cast<value_type*> (&v); + context = &v; } static bool result_callback (void* context, void* buffer, ub4 size, chunk_position); static bool - param_callback (void* context, + param_callback (const void* context, ub4* position_context, void** buffer, ub4* size, |