8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 23:23:04 +01:00

Made XSQLDA parameter const in isc_dsql_fetch and a family of isc_dsql_exec functions as suggested by Dmitry Kovalenko.

Minor related cleanup in utld.
This commit is contained in:
alexpeshkoff 2008-09-10 12:31:54 +00:00
parent 537e23c87c
commit 121af76de7
8 changed files with 58 additions and 63 deletions

View File

@ -359,13 +359,14 @@ ISC_STATUS UTLD_parse_sqlda(
USHORT* msg_type,
USHORT* msg_length,
USHORT dialect,
XSQLDA* xsqlda,
const XSQLDA* xsqlda,
const USHORT clause)
{
USHORT n;
XSQLVAR *xvar, xsqlvar;
SQLDA* sqlda;
SQLVAR* qvar;
XSQLVAR xsqlvar;
const XSQLVAR* xvar = &xsqlvar;
const SQLVAR* qvar;
const SQLDA* sqlda = NULL;
if (!xsqlda)
n = 0;
@ -378,10 +379,9 @@ ISC_STATUS UTLD_parse_sqlda(
}
else
{
sqlda = (SQLDA *) xsqlda;
sqlda = reinterpret_cast<const SQLDA *>(xsqlda);
n = sqlda->sqld;
xsqlda = NULL;
xvar = &xsqlvar;
}
@ -427,11 +427,9 @@ ISC_STATUS UTLD_parse_sqlda(
for (i = 0; i < n; i++)
{
if (xsqlda)
xvar++;
else {
qvar++;
sqlvar_to_xsqlvar(qvar, xvar);
}
++xvar;
else
sqlvar_to_xsqlvar(++qvar, &xsqlvar);
const USHORT dtype = xvar->sqltype & ~1;
switch (dtype)
@ -519,12 +517,10 @@ ISC_STATUS UTLD_parse_sqlda(
for (i = 0; i < n; i++)
{
if (xsqlda)
xvar++;
++xvar;
else
{
qvar++;
sqlvar_to_xsqlvar(qvar, xvar);
}
sqlvar_to_xsqlvar(++qvar, &xsqlvar);
USHORT dtype = xvar->sqltype & ~1;
USHORT len = xvar->sqllen;
switch (dtype)
@ -655,12 +651,10 @@ ISC_STATUS UTLD_parse_sqlda(
for (i = 0; i < n; i++)
{
if (xsqlda)
xvar++;
++xvar;
else
{
qvar++;
sqlvar_to_xsqlvar(qvar, xvar);
}
sqlvar_to_xsqlvar(++qvar, &xsqlvar);
USHORT dtype = xvar->sqltype & ~1;
USHORT len = xvar->sqllen;
switch (dtype)

View File

@ -37,7 +37,7 @@ USHORT UTLD_char_length_to_byte_length(USHORT lengthInChars, USHORT maxBytesPer
ISC_STATUS UTLD_copy_status(const ISC_STATUS*, ISC_STATUS*);
ISC_STATUS UTLD_parse_sql_info(ISC_STATUS*, USHORT, const SCHAR*, XSQLDA*, USHORT*);
ISC_STATUS UTLD_parse_sqlda(ISC_STATUS*, sqlda_sup* const, USHORT*, USHORT*,
USHORT*, USHORT, XSQLDA*, const USHORT);
USHORT*, USHORT, const XSQLDA*, const USHORT);
void UTLD_save_status_strings(ISC_STATUS*);
SCHAR* UTLD_skip_sql_info(SCHAR*);

View File

@ -189,21 +189,21 @@ typedef ISC_STATUS ISC_EXPORT prototype_isc_dsql_exec_immed2(ISC_STATUS *,
unsigned short,
const char*,
unsigned short,
XSQLDA *,
XSQLDA *);
const XSQLDA *,
const XSQLDA *);
typedef ISC_STATUS ISC_EXPORT prototype_isc_dsql_execute(ISC_STATUS *,
isc_tr_handle *,
isc_stmt_handle *,
unsigned short,
XSQLDA *);
const XSQLDA *);
typedef ISC_STATUS ISC_EXPORT prototype_isc_dsql_execute2(ISC_STATUS *,
isc_tr_handle *,
isc_stmt_handle *,
unsigned short,
XSQLDA *,
XSQLDA *);
const XSQLDA *,
const XSQLDA *);
typedef ISC_STATUS ISC_EXPORT prototype_isc_dsql_execute_immediate(ISC_STATUS *,
isc_db_handle *,
@ -211,12 +211,12 @@ typedef ISC_STATUS ISC_EXPORT prototype_isc_dsql_execute_immediate(ISC_STATUS *,
unsigned short,
const char*,
unsigned short,
XSQLDA *);
const XSQLDA *);
typedef ISC_STATUS ISC_EXPORT prototype_isc_dsql_fetch(ISC_STATUS *,
isc_stmt_handle *,
unsigned short,
XSQLDA *);
const XSQLDA *);
typedef ISC_STATUS ISC_EXPORT prototype_isc_dsql_finish(isc_db_handle *);

View File

@ -925,15 +925,15 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_exec_immed2(ISC_STATUS *user_status,
unsigned short,
const char*,
unsigned short,
XSQLDA *,
XSQLDA *)
const XSQLDA *,
const XSQLDA *)
{
return notImplemented(user_status);
}
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute(ISC_STATUS *user_status,
isc_tr_handle *tra_handle, isc_stmt_handle *stmt_handle, unsigned short dialect,
XSQLDA *sqlda)
const XSQLDA *sqlda)
{
if (!m_api.isc_dsql_execute)
return notImplemented(user_status);
@ -943,7 +943,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute(ISC_STATUS *user_status,
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute2(ISC_STATUS *user_status,
isc_tr_handle *tra_handle, isc_stmt_handle *stmt_handle, unsigned short dialect,
XSQLDA *in_sqlda, XSQLDA *out_sqlda)
const XSQLDA *in_sqlda, const XSQLDA *out_sqlda)
{
if (!m_api.isc_dsql_execute2)
return notImplemented(user_status);
@ -958,13 +958,13 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute_immediate(ISC_STATUS *user_s
unsigned short,
const char*,
unsigned short,
XSQLDA *)
const XSQLDA *)
{
return notImplemented(user_status);
}
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_fetch(ISC_STATUS *user_status,
isc_stmt_handle *stmt_handle, unsigned short da_version, XSQLDA *sqlda)
isc_stmt_handle *stmt_handle, unsigned short da_version, const XSQLDA *sqlda)
{
if (!m_api.isc_dsql_fetch)
return notImplemented(user_status);

View File

@ -233,21 +233,21 @@ public:
unsigned short,
const char*,
unsigned short,
XSQLDA *,
XSQLDA *);
const XSQLDA *,
const XSQLDA *);
virtual ISC_STATUS ISC_EXPORT isc_dsql_execute(ISC_STATUS *,
isc_tr_handle *,
isc_stmt_handle *,
unsigned short,
XSQLDA *);
const XSQLDA *);
virtual ISC_STATUS ISC_EXPORT isc_dsql_execute2(ISC_STATUS *,
isc_tr_handle *,
isc_stmt_handle *,
unsigned short,
XSQLDA *,
XSQLDA *);
const XSQLDA *,
const XSQLDA *);
virtual ISC_STATUS ISC_EXPORT isc_dsql_execute_immediate(ISC_STATUS *,
isc_db_handle *,
@ -255,12 +255,12 @@ public:
unsigned short,
const char*,
unsigned short,
XSQLDA *);
const XSQLDA *);
virtual ISC_STATUS ISC_EXPORT isc_dsql_fetch(ISC_STATUS *,
isc_stmt_handle *,
unsigned short,
XSQLDA *);
const XSQLDA *);
virtual ISC_STATUS ISC_EXPORT isc_dsql_finish(isc_db_handle *);

View File

@ -415,21 +415,21 @@ ISC_STATUS ISC_EXPORT isc_dsql_exec_immed2(ISC_STATUS*,
unsigned short,
const ISC_SCHAR*,
unsigned short,
XSQLDA*,
XSQLDA*);
const XSQLDA*,
const XSQLDA*);
ISC_STATUS ISC_EXPORT isc_dsql_execute(ISC_STATUS*,
isc_tr_handle*,
isc_stmt_handle*,
unsigned short,
XSQLDA*);
const XSQLDA*);
ISC_STATUS ISC_EXPORT isc_dsql_execute2(ISC_STATUS*,
isc_tr_handle*,
isc_stmt_handle*,
unsigned short,
XSQLDA*,
XSQLDA*);
const XSQLDA*,
const XSQLDA*);
ISC_STATUS ISC_EXPORT isc_dsql_execute_immediate(ISC_STATUS*,
isc_db_handle*,
@ -437,12 +437,12 @@ ISC_STATUS ISC_EXPORT isc_dsql_execute_immediate(ISC_STATUS*,
unsigned short,
const ISC_SCHAR*,
unsigned short,
XSQLDA*);
const XSQLDA*);
ISC_STATUS ISC_EXPORT isc_dsql_fetch(ISC_STATUS *,
isc_stmt_handle *,
unsigned short,
XSQLDA *);
const XSQLDA *);
ISC_STATUS ISC_EXPORT isc_dsql_finish(isc_db_handle *);

View File

@ -2373,7 +2373,7 @@ ISC_STATUS API_ROUTINE GDS_DSQL_EXECUTE(ISC_STATUS* user_status,
FB_API_HANDLE* tra_handle,
FB_API_HANDLE* stmt_handle,
USHORT dialect,
XSQLDA* sqlda)
const XSQLDA* sqlda)
{
/**************************************
*
@ -2395,8 +2395,8 @@ ISC_STATUS API_ROUTINE GDS_DSQL_EXECUTE2(ISC_STATUS* user_status,
FB_API_HANDLE* tra_handle,
FB_API_HANDLE* stmt_handle,
USHORT dialect,
XSQLDA* in_sqlda,
XSQLDA* out_sqlda)
const XSQLDA* in_sqlda,
const XSQLDA* out_sqlda)
{
/**************************************
*
@ -2571,7 +2571,7 @@ ISC_STATUS API_ROUTINE GDS_DSQL_EXEC_IMMED(ISC_STATUS* user_status,
USHORT length,
const SCHAR* string,
USHORT dialect,
XSQLDA* sqlda)
const XSQLDA* sqlda)
{
/**************************************
*
@ -2594,7 +2594,8 @@ ISC_STATUS API_ROUTINE GDS_DSQL_EXECUTE_IMMED(ISC_STATUS* user_status,
FB_API_HANDLE* tra_handle,
USHORT length,
const SCHAR* string,
USHORT dialect, XSQLDA* sqlda)
USHORT dialect,
const XSQLDA* sqlda)
{
/**************************************
*
@ -2619,8 +2620,8 @@ ISC_STATUS API_ROUTINE GDS_DSQL_EXEC_IMMED2(ISC_STATUS* user_status,
USHORT length,
const SCHAR* string,
USHORT dialect,
XSQLDA* in_sqlda,
XSQLDA* out_sqlda)
const XSQLDA* in_sqlda,
const XSQLDA* out_sqlda)
{
/**************************************
*
@ -2943,7 +2944,7 @@ ISC_STATUS API_ROUTINE GDS_DSQL_EXEC_IMM3_M(ISC_STATUS* user_status,
ISC_STATUS API_ROUTINE GDS_DSQL_FETCH(ISC_STATUS* user_status,
FB_API_HANDLE* stmt_handle,
USHORT dialect,
XSQLDA* sqlda)
const XSQLDA* sqlda)
{
/**************************************
*

View File

@ -36,11 +36,11 @@ ISC_STATUS API_ROUTINE isc_dsql_describe(ISC_STATUS *, FB_API_HANDLE*, USHORT, X
ISC_STATUS API_ROUTINE isc_dsql_describe_bind(ISC_STATUS*, FB_API_HANDLE*,
USHORT, XSQLDA*);
ISC_STATUS API_ROUTINE isc_dsql_execute(ISC_STATUS*, FB_API_HANDLE*, FB_API_HANDLE*,
USHORT, XSQLDA*);
USHORT, const XSQLDA*);
ISC_STATUS API_ROUTINE isc_dsql_execute_m(ISC_STATUS*, FB_API_HANDLE*, FB_API_HANDLE*, USHORT,
const SCHAR*, USHORT, USHORT, SCHAR*);
ISC_STATUS API_ROUTINE isc_dsql_execute2(ISC_STATUS*, FB_API_HANDLE*, FB_API_HANDLE*, USHORT,
XSQLDA*, XSQLDA*);
const XSQLDA*, const XSQLDA*);
ISC_STATUS API_ROUTINE isc_dsql_execute2_m(ISC_STATUS*, FB_API_HANDLE*,
FB_API_HANDLE*, USHORT, const SCHAR*,
USHORT, USHORT, SCHAR*, USHORT,
@ -49,11 +49,11 @@ ISC_STATUS API_ROUTINE isc_dsql_execute2_m(ISC_STATUS*, FB_API_HANDLE*,
ISC_STATUS API_ROUTINE isc_dsql_execute_immediate(ISC_STATUS*, FB_API_HANDLE*,
FB_API_HANDLE*, USHORT,
const SCHAR*, USHORT,
XSQLDA*);
const XSQLDA*);
ISC_STATUS API_ROUTINE isc_dsql_exec_immed2(ISC_STATUS*, FB_API_HANDLE*,
FB_API_HANDLE*, USHORT,
const SCHAR*, USHORT, XSQLDA*,
XSQLDA*);
const SCHAR*, USHORT, const XSQLDA*,
const XSQLDA*);
ISC_STATUS API_ROUTINE isc_dsql_execute_immediate_m(ISC_STATUS*,
FB_API_HANDLE*,
FB_API_HANDLE*, USHORT,
@ -73,7 +73,7 @@ ISC_STATUS API_ROUTINE isc_dsql_exec_immed3_m(ISC_STATUS*, FB_API_HANDLE*,
SCHAR*, USHORT, USHORT,
const SCHAR*, USHORT, SCHAR*,
USHORT, USHORT, SCHAR*);
ISC_STATUS API_ROUTINE isc_dsql_fetch(ISC_STATUS*, FB_API_HANDLE*, USHORT, XSQLDA*);
ISC_STATUS API_ROUTINE isc_dsql_fetch(ISC_STATUS*, FB_API_HANDLE*, USHORT, const XSQLDA*);
#ifdef SCROLLABLE_CURSORS
ISC_STATUS API_ROUTINE isc_dsql_fetch2(ISC_STATUS*, FB_API_HANDLE*, USHORT,
XSQLDA*, USHORT, SLONG);