diff options
-rw-r--r-- | odb/oracle/oracle-types.hxx | 2 | ||||
-rw-r--r-- | odb/oracle/traits.cxx | 12 | ||||
-rw-r--r-- | odb/oracle/traits.hxx | 18 |
3 files changed, 16 insertions, 16 deletions
diff --git a/odb/oracle/oracle-types.hxx b/odb/oracle/oracle-types.hxx index a3b45c6..c027e5d 100644 --- a/odb/oracle/oracle-types.hxx +++ b/odb/oracle/oracle-types.hxx @@ -28,7 +28,7 @@ namespace odb // statement execution is aborted. // typedef bool (*param_callback_type) ( - void* context, // [in] The user context. + const void* context, // [in] The user context. ub4* position_context, // [in] A position context. A callback is free to // use this to track position information. void** buffer, // [out] On return, a pointer to a buffer 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 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, |