From d009be834fef6877848ad0e01c89f1682536c01c Mon Sep 17 00:00:00 2001 From: robocop Date: Fri, 9 Feb 2007 08:34:16 +0000 Subject: [PATCH] Misc. --- src/burp/mvol.cpp | 9 ++------- src/jrd/blb.cpp | 4 ++-- src/jrd/gds.cpp | 21 +++++++++------------ src/jrd/vio.cpp | 7 +------ 4 files changed, 14 insertions(+), 27 deletions(-) diff --git a/src/burp/mvol.cpp b/src/burp/mvol.cpp index 8ef3d20826..b6bef507f7 100644 --- a/src/burp/mvol.cpp +++ b/src/burp/mvol.cpp @@ -757,13 +757,8 @@ static void bad_attribute(int attribute, USHORT type) gds__msg_format(0, 12, type, sizeof(name), name, 0, 0, 0, 0, 0); BURP_print(80, name, (void*) (IPTR) attribute, NULL, NULL, NULL); // msg 80 don't recognize %s attribute %ld -- continuing - int l = get(tdgbl); - if (l) - { - do { - get(tdgbl); - } while (--l); - } + for (int l = get(tdgbl); l; --l) + get(tdgbl); } diff --git a/src/jrd/blb.cpp b/src/jrd/blb.cpp index b4de9cd572..8a27c00b80 100644 --- a/src/jrd/blb.cpp +++ b/src/jrd/blb.cpp @@ -940,7 +940,7 @@ void BLB_move(thread_db* tdbb, dsc* from_desc, dsc* to_desc, jrd_nod* field) { case nod_field: // We should not materialize the blob if the destination field - // stream (nod_union, for example) don't have a relation. + // stream (nod_union, for example) doesn't have a relation. simpleMove = tdbb->tdbb_request-> req_rpb[(IPTR)field->nod_arg[e_fld_stream]].rpb_relation == NULL; break; @@ -964,7 +964,7 @@ void BLB_move(thread_db* tdbb, dsc* from_desc, dsc* to_desc, jrd_nod* field) // and return. if (simpleMove) { - // But if the sub_type or charset is diferrent, create a new blob. + // But if the sub_type or charset is different, create a new blob. if (DTYPE_IS_BLOB_OR_QUAD(from_desc->dsc_dtype) && DTYPE_IS_BLOB_OR_QUAD(to_desc->dsc_dtype) && to_desc->dsc_sub_type != isc_blob_untyped && diff --git a/src/jrd/gds.cpp b/src/jrd/gds.cpp index 8d595a0f66..7db368dd35 100644 --- a/src/jrd/gds.cpp +++ b/src/jrd/gds.cpp @@ -420,14 +420,11 @@ ISC_STATUS API_ROUTINE gds__decode(ISC_STATUS code, USHORT* fac, USHORT* **************************************/ if (!code) - { return FB_SUCCESS; - } - else if ((code & ISC_MASK) != ISC_MASK) - { - /* not an ISC error message */ + + // not an ISC error message + if ((code & ISC_MASK) != ISC_MASK) return code; - } *fac = GET_FACILITY(code); *code_class = GET_CLASS(code); @@ -1104,7 +1101,9 @@ void API_ROUTINE gds__trace_raw(const char* text, unsigned int length) // Note: signal-safe code gds__prefix(name, LOGFILE); int file = open(name, O_CREAT | O_APPEND | O_WRONLY, 0660); - if (file == -1) return; + if (file == -1) + return; + write(file, text, length); close(file); #endif @@ -2688,12 +2687,10 @@ int unlink(const SCHAR* file) break; } - if (!status) - return 0; - else if (status != RMS$_FNF) - return -1; - else + if (!status || status == RMS$_FNF) return 0; + + return -1; } #endif diff --git a/src/jrd/vio.cpp b/src/jrd/vio.cpp index d6d9e30e04..b4247c10a5 100644 --- a/src/jrd/vio.cpp +++ b/src/jrd/vio.cpp @@ -5070,12 +5070,7 @@ static void verb_post( if (same_tx) { data->rec_flags |= REC_same_tx; } - UCHAR* p = data->rec_data; - const UCHAR* q = old_data->rec_data; - for (const UCHAR* const end = q + old_data->rec_length; q < end; q++) - { - *p++ = *q; - } + memcpy(data->rec_data, old_data->rec_data, old_data->rec_length); if (!action->vct_undo) { action->vct_undo = new UndoItemTree(tdbb->getDefaultPool()); }