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

-Code format

This commit is contained in:
brodsom 2003-09-12 01:58:51 +00:00
parent ef4a97ed9f
commit 4a15406cd0
5 changed files with 74 additions and 63 deletions

View File

@ -492,10 +492,11 @@ void AIL_enable(
/* check if journal is already enabled */
if (PAG_get_clump
(HEADER_PAGE, HDR_journal_server, &jd_len,
reinterpret_cast <
UCHAR * >(journal_dir))) ERR_post(gds_jrn_present, 0);
if (PAG_get_clump(HEADER_PAGE, HDR_journal_server, &jd_len,
reinterpret_cast <UCHAR *>(journal_dir)))
{
ERR_post(gds_jrn_present, 0);
}
/*
* check if we are trying to enable long term journaling without

View File

@ -33,7 +33,7 @@
*
*/
/*
$Id: blb.cpp,v 1.35 2003-09-01 07:58:04 brodsom Exp $
$Id: blb.cpp,v 1.36 2003-09-12 01:58:51 brodsom Exp $
*/
#include "firebird.h"
@ -852,9 +852,10 @@ void BLB_move(TDBB tdbb, DSC * from_desc, DSC * to_desc, JRD_NOD field)
BUGCHECK(199); /* msg 199 expected field node */
if (from_desc->dsc_dtype != dtype_quad
&& from_desc->dsc_dtype != dtype_blob) ERR_post(gds_convert_error,
gds_arg_string,
"BLOB", 0);
&& from_desc->dsc_dtype != dtype_blob)
{
ERR_post(gds_convert_error, gds_arg_string, "BLOB", 0);
}
request = tdbb->tdbb_request;
source = (BID) from_desc->dsc_address;
@ -920,12 +921,13 @@ void BLB_move(TDBB tdbb, DSC * from_desc, DSC * to_desc, JRD_NOD field)
break;
}
if (!blob ||
MemoryPool::blk_type(blob) != type_blb ||
if (!blob || MemoryPool::blk_type(blob) != type_blb ||
blob->blb_attachment != tdbb->tdbb_attachment ||
!(blob->blb_flags & BLB_closed) ||
(blob->blb_request && blob->blb_request != request))
{
ERR_post(gds_bad_segstr_id, 0);
}
if (materialized_blob && !(blob->blb_flags & BLB_temporary)) {
refetch_flag = TRUE;

View File

@ -4364,57 +4364,57 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, JRD_NOD node, JRD_NOD parent)
case nod_find:
stream = base_stream(csb, &node->nod_arg[e_find_stream], TRUE);
if (!
(node->nod_arg[e_find_rsb] =
(JRD_NOD) csb->
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined,
0);
if (!(node->nod_arg[e_find_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(gds__stream_not_defined, 0);
}
break;
case nod_find_dbkey:
case nod_find_dbkey_version:
stream = base_stream(csb, &node->nod_arg[e_find_dbkey_stream], TRUE);
if (!
(node->nod_arg[e_find_dbkey_rsb] =
(JRD_NOD) csb->
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined,
0);
if (!(node->nod_arg[e_find_dbkey_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(gds__stream_not_defined, 0);
}
break;
case nod_set_index:
stream = base_stream(csb, &node->nod_arg[e_index_stream], TRUE);
if (!
(node->nod_arg[e_index_rsb] =
(JRD_NOD) csb->
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined,
0);
if (!(node->nod_arg[e_index_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(gds__stream_not_defined, 0);
}
break;
case nod_get_bookmark:
stream = base_stream(csb, &node->nod_arg[e_getmark_stream], TRUE);
if (!
(node->nod_arg[e_getmark_rsb] =
(JRD_NOD) csb->
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined,
0);
if (!(node->nod_arg[e_getmark_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(gds__stream_not_defined, 0);
}
break;
case nod_set_bookmark:
stream = base_stream(csb, &node->nod_arg[e_setmark_stream], TRUE);
if (!
(node->nod_arg[e_setmark_rsb] =
(JRD_NOD) csb->
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined,
0);
if (!(node->nod_arg[e_setmark_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(gds__stream_not_defined, 0);
}
break;
case nod_lock_record:
stream = base_stream(csb, &node->nod_arg[e_lockrec_stream], TRUE);
if (!
(node->nod_arg[e_lockrec_rsb] =
(JRD_NOD) csb->
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined,
0);
if (!(node->nod_arg[e_lockrec_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(gds__stream_not_defined, 0);
}
break;
case nod_crack:
@ -4426,20 +4426,20 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, JRD_NOD node, JRD_NOD parent)
case nod_reset_stream:
stream = base_stream(csb, &node->nod_arg[e_reset_from_stream], TRUE);
if (!
(node->nod_arg[e_reset_from_rsb] =
(JRD_NOD) csb->
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined,
0);
if (!(node->nod_arg[e_reset_from_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(gds__stream_not_defined, 0);
}
break;
case nod_cardinality:
stream = base_stream(csb, &node->nod_arg[e_card_stream], TRUE);
if (!
(node->nod_arg[e_card_rsb] =
(JRD_NOD) csb->
csb_rpt[stream].csb_rsb_ptr)) ERR_post(gds__stream_not_defined,
0);
if (!(node->nod_arg[e_card_rsb] =
(JRD_NOD) csb->csb_rpt[stream].csb_rsb_ptr))
{
ERR_post(gds__stream_not_defined, 0);
}
break;
/* the following DML nodes need to have their rsb's stored when

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: evl.cpp,v 1.38 2003-08-30 16:45:05 dimitr Exp $
* $Id: evl.cpp,v 1.39 2003-09-12 01:58:51 brodsom Exp $
*/
/*
@ -982,7 +982,9 @@ DSC* DLL_EXPORT EVL_expr(TDBB tdbb, JRD_NOD node)
if (extract_part != blr_extract_hour &&
extract_part != blr_extract_minute &&
extract_part != blr_extract_second)
ERR_post(gds_expression_eval_err, 0);
{
ERR_post(gds_expression_eval_err, 0);
}
break;
case dtype_sql_date:
timestamp.timestamp_date = *(GDS_DATE *) value->dsc_address;
@ -991,7 +993,9 @@ DSC* DLL_EXPORT EVL_expr(TDBB tdbb, JRD_NOD node)
if (extract_part == blr_extract_hour ||
extract_part == blr_extract_minute ||
extract_part == blr_extract_second)
ERR_post(gds_expression_eval_err, 0);
{
ERR_post(gds_expression_eval_err, 0);
}
break;
case dtype_timestamp:
timestamp = *((GDS_TIMESTAMP *) value->dsc_address);
@ -2655,9 +2659,11 @@ static DSC *add_sql_date(DSC * desc, JRD_NOD node, VLU value)
isc_decode_timestamp(&new_date, &times);
if ((times.tm_year + 1900) < MIN_YEAR
|| (times.tm_year) + 1900 >
MAX_YEAR) ERR_post(gds_expression_eval_err, gds_arg_gds,
|| (times.tm_year) + 1900 > MAX_YEAR)
{
ERR_post(gds_expression_eval_err, gds_arg_gds,
isc_date_range_exceeded, 0);
}
value->vlu_misc.vlu_sql_date = d2;
@ -2857,7 +2863,9 @@ static DSC *add_timestamp(DSC * desc, JRD_NOD node, VLU value)
if (!((value->vlu_desc.dsc_dtype == dtype_timestamp) ||
DTYPE_IS_TEXT(value->vlu_desc.dsc_dtype)))
ERR_post(gds_expression_eval_err, 0);
{
ERR_post(gds_expression_eval_err, 0);
}
d1 = get_timestamp_to_isc_ticks(&value->vlu_desc);
d2 = get_timestamp_to_isc_ticks(desc);
@ -2970,10 +2978,8 @@ static DSC *add_timestamp(DSC * desc, JRD_NOD node, VLU value)
new_date.timestamp_date = value->vlu_misc.vlu_timestamp.timestamp_date;
isc_decode_timestamp(&new_date, &times);
if ((times.tm_year + 1900) < MIN_YEAR
|| (times.tm_year) + 1900 >
MAX_YEAR) ERR_post(gds_expression_eval_err, gds_arg_gds,
isc_date_range_exceeded, 0);
if ((times.tm_year + 1900) < MIN_YEAR || (times.tm_year) + 1900 > MAX_YEAR)
ERR_post(gds_expression_eval_err, gds_arg_gds, isc_date_range_exceeded, 0);
/* Make sure the TIME portion is non-negative */

View File

@ -205,9 +205,11 @@ BOOLEAN NAV_find_record(RSB rsb,
idx =
(IDX *) ((SCHAR *) impure + (SLONG) rsb->rsb_arg[RSB_NAV_idx_offset]);
if ((idx == NULL) ||
(find_key->nod_count == 0) ||
(find_key->nod_count > idx->idx_count)) ERR_post(gds__invalid_key, 0);
if ((idx == NULL) || (find_key->nod_count == 0) ||
(find_key->nod_count > idx->idx_count))
{
ERR_post(gds__invalid_key, 0);
}
if (find_key->nod_count < idx->idx_count)
search_flags |= irb_partial;