From 2b289fe713cd0ece2ce0b5cf6309707ce8a23e1f Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 14 Oct 2011 13:54:04 +0200 Subject: Const qualify buffer argument in parameter callback function signature --- odb/oracle/oracle-types.hxx | 6 ++++-- odb/oracle/statement.cxx | 2 +- odb/oracle/traits.hxx | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/odb/oracle/oracle-types.hxx b/odb/oracle/oracle-types.hxx index e340071..5864d0a 100644 --- a/odb/oracle/oracle-types.hxx +++ b/odb/oracle/oracle-types.hxx @@ -31,8 +31,10 @@ namespace odb typedef bool (*param_callback_type) ( 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 + // use this to track position information. This is + // initialized to zero before the callback is + // invoked for the first time. + const void** buffer, // [out] On return, a pointer to a buffer // containing parameter data. ub4* size, // [out] The parameter data size in bytes. chunk_position*, // [out] The position of the chunk of data in diff --git a/odb/oracle/statement.cxx b/odb/oracle/statement.cxx index 0e7d387..26d2836 100644 --- a/odb/oracle/statement.cxx +++ b/odb/oracle/statement.cxx @@ -82,7 +82,7 @@ namespace odb chunk_position pos; if (!(*b.callback.param) (&b.callback_context, reinterpret_cast (b.size), - buffer, + const_cast (buffer), size, &pos, b.buffer, diff --git a/odb/oracle/traits.hxx b/odb/oracle/traits.hxx index b5dfc80..a8ada63 100644 --- a/odb/oracle/traits.hxx +++ b/odb/oracle/traits.hxx @@ -623,7 +623,7 @@ namespace odb static bool param_callback (const void* context, ub4* position_context, - void** buffer, + const void** buffer, ub4* size, chunk_position*, void* temp_buffer, @@ -669,7 +669,7 @@ namespace odb static bool param_callback (const void* context, ub4* position_context, - void** buffer, + const void** buffer, ub4* size, chunk_position*, void* temp_buffer, @@ -753,7 +753,7 @@ namespace odb static bool param_callback (const void* context, ub4* position_context, - void** buffer, + const void** buffer, ub4* size, chunk_position*, void* temp_buffer, -- cgit v1.1