From 3e6b1708626940635d39a08cedc331cf41f64e70 Mon Sep 17 00:00:00 2001 From: skidder Date: Sun, 3 Oct 2004 20:18:13 +0000 Subject: [PATCH] Roll back implementation of Claudio suggestion for consturctor of BID structure. It forced addition of constructors for message structures generated by GPRE which is not correct --- src/gpre/int_cxx.cpp | 8 ++------ src/jrd/blb.cpp | 7 ++++--- src/jrd/blb.h | 4 ---- src/jrd/dfw.epp | 5 +++++ src/jrd/tra.h | 2 +- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/gpre/int_cxx.cpp b/src/gpre/int_cxx.cpp index 3774dc6c7a..9ac3154f64 100644 --- a/src/gpre/int_cxx.cpp +++ b/src/gpre/int_cxx.cpp @@ -25,7 +25,7 @@ // //____________________________________________________________ // -// $Id: int_cxx.cpp,v 1.37 2004-10-03 04:43:43 robocop Exp $ +// $Id: int_cxx.cpp,v 1.38 2004-10-03 20:18:09 skidder Exp $ // #include "firebird.h" @@ -650,11 +650,7 @@ static void gen_variable( const act* action, int column) static void make_port( gpre_port* port, int column) { - // CVC: C++ compliance with constructors. - if (isLangCpp(gpreGlob.sw_language)) - printa(column, "struct isc_%d_t {", port->por_ident); - else - printa(column, "struct {"); + printa(column, "struct {"); for (REF reference = port->por_references; reference; reference = reference->ref_next) diff --git a/src/jrd/blb.cpp b/src/jrd/blb.cpp index 5c741ac401..a2e3ac5950 100644 --- a/src/jrd/blb.cpp +++ b/src/jrd/blb.cpp @@ -33,7 +33,7 @@ * */ /* -$Id: blb.cpp,v 1.90 2004-10-01 21:12:46 skidder Exp $ +$Id: blb.cpp,v 1.91 2004-10-03 20:18:11 skidder Exp $ */ #include "firebird.h" @@ -930,7 +930,7 @@ void BLB_move(thread_db* tdbb, dsc* from_desc, dsc* to_desc, jrd_nod* field) ERR_post(isc_bad_segstr_id, 0); } } - source = reinterpret_cast(&blobIndex->bli_blob_id); + source = &blobIndex->bli_blob_id; continue; } else { @@ -963,7 +963,7 @@ void BLB_move(thread_db* tdbb, dsc* from_desc, dsc* to_desc, jrd_nod* field) // If we didn't find materialized blob in transaction blob index it // means memory structures are inconsistent and crash is appropriate blobIndex->bli_materialized = true; - blobIndex->bli_blob_id = *reinterpret_cast(destination); + blobIndex->bli_blob_id = *destination; // Assign temporary BLOB ownership to top-level request if it is not assigned yet jrd_req* own_request; if (blobIndex->bli_request) { @@ -1010,6 +1010,7 @@ void BLB_move_from_string(thread_db* tdbb, const dsc* from_desc, dsc* to_desc, j UCHAR *fromstr = 0; bid temp_bid; DSC blob_desc; + temp_bid.clear(); MOVE_CLEAR(&blob_desc, sizeof(blob_desc)); blob = BLB_create(tdbb, tdbb->tdbb_request->req_transaction, &temp_bid); blob_desc.dsc_length = MOV_get_string_ptr(from_desc, &ttype, &fromstr, 0, 0); diff --git a/src/jrd/blb.h b/src/jrd/blb.h index 9b18340f35..321b0c2fe7 100644 --- a/src/jrd/blb.h +++ b/src/jrd/blb.h @@ -62,10 +62,6 @@ struct bid { } bid_quad; }; - bid() { - clear(); - } - ULONG& bid_temp_id() { // Make sure that compiler packed structure like we wanted fb_assert(sizeof(*this) == 8); diff --git a/src/jrd/dfw.epp b/src/jrd/dfw.epp index 9068371d0c..f9859dadcc 100644 --- a/src/jrd/dfw.epp +++ b/src/jrd/dfw.epp @@ -1852,6 +1852,8 @@ static bool create_relation(thread_db* tdbb, jrd_req* handle; Lock* lock; + blob_id.clear(); + SET_TDBB(tdbb); Database* dbb = tdbb->tdbb_database; const USHORT major_version = dbb->dbb_ods_version; @@ -3211,6 +3213,7 @@ static void get_procedure_dependencies(DeferredWork* work) jrd_prc* procedure = NULL; bid blob_id; + blob_id.clear(); jrd_req* handle = CMP_find_request(tdbb, irq_c_prc_dpd, IRQ_REQUESTS); @@ -3284,6 +3287,7 @@ static void get_trigger_dependencies( DeferredWork* work) jrd_req* handle = CMP_find_request(tdbb, irq_c_trigger, IRQ_REQUESTS); bid blob_id; + blob_id.clear(); FOR(REQUEST_HANDLE handle) X IN RDB$TRIGGERS WITH @@ -3526,6 +3530,7 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, TemporaryField* external; jrd_rel* relation; bid blob_id; + blob_id.clear(); USHORT n, external_flag = 0; bool computed_field; diff --git a/src/jrd/tra.h b/src/jrd/tra.h index 07f3948dea..723dd106b5 100644 --- a/src/jrd/tra.h +++ b/src/jrd/tra.h @@ -59,7 +59,7 @@ struct BlobIndex { bool bli_materialized; jrd_req* bli_request; union { - ISC_QUAD bli_blob_id; // ID of materialized blob + bid bli_blob_id; // ID of materialized blob blb* bli_blob_object; // Blob object }; static const ULONG& generate(const void *sender, const BlobIndex& item) {