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.cxx | |
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.cxx')
-rw-r--r-- | odb/oracle/traits.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/odb/oracle/traits.cxx b/odb/oracle/traits.cxx index c934cc1..a37f440 100644 --- a/odb/oracle/traits.cxx +++ b/odb/oracle/traits.cxx @@ -85,7 +85,7 @@ namespace odb } bool string_lob_value_traits:: - param_callback (void* ctx, + param_callback (const void* ctx, ub4* pos_ctx, void** b, ub4* s, @@ -93,7 +93,7 @@ namespace odb void* temp_b, ub4 cap) { - const string& v (*reinterpret_cast<string*> (ctx)); + const string& v (*static_cast<const string*> (ctx)); // @@ We rely on *pos_ctx == 0 for the first call. Make sure that this is // set by the generated code, and update comment in oracle-types.hxx @@ -121,7 +121,7 @@ namespace odb // bool c_string_lob_value_traits:: - param_callback (void* ctx, + param_callback (const void* ctx, ub4* pos_ctx, void** b, ub4* s, @@ -129,7 +129,7 @@ namespace odb void* temp_b, ub4 cap) { - const char* v (reinterpret_cast<char*> (ctx)); + const char* v (static_cast<const char*> (ctx)); // @@ We rely on *pos_ctx == 0 for the first call. Make sure that this is // set by the generated code, and update comment in oracle-types.hxx @@ -183,7 +183,7 @@ namespace odb } bool default_value_traits<std::vector<char>, id_blob>:: - param_callback (void* ctx, + param_callback (const void* ctx, ub4* pos_ctx, void** b, ub4* s, @@ -191,7 +191,7 @@ namespace odb void* temp_b, ub4 cap) { - const value_type& v (*reinterpret_cast<value_type*> (ctx)); + const value_type& v (*static_cast<const value_type*> (ctx)); // @@ We rely on *position_context == 0 for the first call. Make sure // that this is set by the generated code and update the comment in |