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

Simplification.

This commit is contained in:
dimitr 2012-01-25 07:32:35 +00:00
parent 88336dfde3
commit e265d5e6a3
4 changed files with 6 additions and 9 deletions

View File

@ -5777,7 +5777,7 @@ static void mov_dsql_message(const UCHAR* from_msg,
*
**************************************/
if (!from_fmt || !to_fmt || from_fmt->fmt_count != to_fmt->fmt_count)
if (!from_fmt || !to_fmt || from_fmt->fmt_desc.getCount() != to_fmt->fmt_desc.getCount())
{
move_error(Arg::Gds(isc_dsql_sqlda_err));
// Msg 263 SQLDA missing or wrong number of variables
@ -5785,8 +5785,8 @@ static void mov_dsql_message(const UCHAR* from_msg,
const dsc* from_desc = from_fmt->fmt_desc.begin();
const dsc* to_desc = to_fmt->fmt_desc.begin();
const dsc* const end_desc = to_desc + to_fmt->fmt_count;
for (; to_desc < end_desc; from_desc++, to_desc++)
for (const dsc* const end_desc = to_fmt->fmt_desc.end();
to_desc < end_desc; from_desc++, to_desc++)
{
dsc from = *from_desc;
dsc to = *to_desc;

View File

@ -81,7 +81,6 @@ RMessage* PARSE_messages(const UCHAR* blr, USHORT blr_length)
#ifdef DEBUG_REMOTE_MEMORY
printf("PARSE_messages allocate format %x\n", format);
#endif
format->fmt_count = count;
USHORT offset = 0;
for (dsc* desc = format->fmt_desc.begin(); count; --count, ++desc)
{

View File

@ -1149,7 +1149,7 @@ static bool_t xdr_message( XDR* xdrs, RMessage* message, const rem_fmt* format)
}
const dsc* desc = format->fmt_desc.begin();
for (const dsc* const end = desc + format->fmt_count; desc < end; ++desc)
for (const dsc* const end = format->fmt_desc.end(); desc < end; ++desc)
{
if (!xdr_datum(xdrs, desc, message->msg_address))
return FALSE;

View File

@ -289,14 +289,12 @@ struct rem_fmt : public Firebird::GlobalStorage
{
USHORT fmt_length;
USHORT fmt_net_length;
USHORT fmt_count;
USHORT fmt_version;
Firebird::Array<dsc> fmt_desc;
public:
explicit rem_fmt(size_t rpt) :
fmt_length(0), fmt_net_length(0), fmt_count(0),
fmt_version(0), fmt_desc(getPool(), rpt)
fmt_length(0), fmt_net_length(0),
fmt_desc(getPool(), rpt)
{
fmt_desc.grow(rpt);
}