mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 10:03:03 +01:00
Replacing assert with fb_assert
This commit is contained in:
parent
5c86bc23d5
commit
ff070a16a8
@ -24,7 +24,7 @@
|
||||
//
|
||||
//____________________________________________________________
|
||||
//
|
||||
// $Id: all.cpp,v 1.13 2003-09-25 11:48:57 robocop Exp $
|
||||
// $Id: all.cpp,v 1.14 2003-11-03 23:49:24 brodsom Exp $
|
||||
//
|
||||
|
||||
#include "../alice/all.h"
|
||||
@ -167,7 +167,7 @@ AliceMemoryPool* AliceMemoryPool::create_new_pool(MemoryPool* parent)
|
||||
}
|
||||
}
|
||||
|
||||
//assert(0);
|
||||
//fb_assert(0);
|
||||
//BUGCHECK ("ALLA_fini - finishing before starting");
|
||||
return 0;//pool; // Never reached, but makes the compiler happy.
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
//
|
||||
//____________________________________________________________
|
||||
//
|
||||
// $Id: exe.cpp,v 1.22 2003-11-01 10:26:32 robocop Exp $
|
||||
// $Id: exe.cpp,v 1.23 2003-11-03 23:49:24 brodsom Exp $
|
||||
//
|
||||
// 2001.07.06 Sean Leyne - Code Cleanup, removed "#ifdef READONLY_DATABASE"
|
||||
// conditionals, as the engine now fully supports
|
||||
@ -220,7 +220,7 @@ static USHORT build_dpb(UCHAR* dpb, const ULONG switches)
|
||||
for (int i = 0; i < 4; i++, (tdgbl->ALICE_data.ua_sweep_interval >>= 8))
|
||||
{
|
||||
// TMN: Here we should really have the following assert
|
||||
// assert(tdgbl->ALICE_data.ua_sweep_interval <= MAX_UCHAR);
|
||||
// fb_assert(tdgbl->ALICE_data.ua_sweep_interval <= MAX_UCHAR);
|
||||
*dpb2++ = (UCHAR) tdgbl->ALICE_data.ua_sweep_interval;
|
||||
}
|
||||
}
|
||||
@ -236,7 +236,7 @@ static USHORT build_dpb(UCHAR* dpb, const ULONG switches)
|
||||
for (int i = 0; i < 4; i++, (tdgbl->ALICE_data.ua_page_buffers >>= 8))
|
||||
{
|
||||
// TMN: Here we should really have the following assert
|
||||
// assert(tdgbl->ALICE_data.ua_page_buffers <= MAX_UCHAR);
|
||||
// fb_assert(tdgbl->ALICE_data.ua_page_buffers <= MAX_UCHAR);
|
||||
*dpb2++ = (UCHAR) tdgbl->ALICE_data.ua_page_buffers;
|
||||
}
|
||||
}
|
||||
@ -280,7 +280,7 @@ static USHORT build_dpb(UCHAR* dpb, const ULONG switches)
|
||||
*dpb2++ = gds_dpb_shutdown_delay;
|
||||
*dpb2++ = 2; // Build room for shutdown delay
|
||||
// TMN: Here we should really have the following assert
|
||||
// assert(tdgbl->ALICE_data.ua_page_buffers <= MAX_USHORT);
|
||||
// fb_assert(tdgbl->ALICE_data.ua_page_buffers <= MAX_USHORT);
|
||||
// or maybe even compare with MAX_SSHORT
|
||||
*dpb2++ = (UCHAR) tdgbl->ALICE_data.ua_shutdown_delay;
|
||||
*dpb2++ = (UCHAR) (tdgbl->ALICE_data.ua_shutdown_delay >> 8);
|
||||
@ -345,7 +345,7 @@ static void extract_db_info(const UCHAR* db_info_buffer)
|
||||
p += 2;
|
||||
|
||||
// TMN: Here we should really have the following assert
|
||||
// assert(length <= MAX_SSHORT);
|
||||
// fb_assert(length <= MAX_SSHORT);
|
||||
// for all cases that use 'length' as input to 'gds__vax_integer'
|
||||
switch (item) {
|
||||
case isc_info_page_errors:
|
||||
|
@ -1526,8 +1526,8 @@ void BURP_print_warning(const ISC_STATUS* status_vector)
|
||||
**************************************/
|
||||
if (status_vector) {
|
||||
// skip the error, assert that one does not exist
|
||||
assert(status_vector[0] == gds_arg_gds);
|
||||
assert(status_vector[1] == 0);
|
||||
fb_assert(status_vector[0] == gds_arg_gds);
|
||||
fb_assert(status_vector[1] == 0);
|
||||
// print the warning message
|
||||
const ISC_STATUS* vector = &status_vector[2];
|
||||
SCHAR s[1024];
|
||||
@ -1710,7 +1710,7 @@ static gbak_action open_files(const TEXT* file1,
|
||||
// Now it is safe to skip a db file
|
||||
tdgbl->gbl_sw_backup_files = tdgbl->gbl_sw_files->fil_next;
|
||||
tdgbl->gbl_sw_files = tdgbl->gbl_sw_files->fil_next;
|
||||
assert(strcmp(tdgbl->gbl_sw_files->fil_name, *file2) == 0);
|
||||
fb_assert(strcmp(tdgbl->gbl_sw_files->fil_name, *file2) == 0);
|
||||
|
||||
gbak_action flag = BACKUP;
|
||||
tdgbl->action->act_action = ACT_backup;
|
||||
@ -1735,7 +1735,7 @@ static gbak_action open_files(const TEXT* file1,
|
||||
// msg 262 size specification either missing or incorrect for file %s
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
$Id: canonical.cpp,v 1.30 2003-10-29 10:53:03 robocop Exp $
|
||||
$Id: canonical.cpp,v 1.31 2003-11-03 23:49:47 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -199,7 +199,7 @@ ULONG CAN_encode_decode(BURP_REL relation,
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -571,7 +571,7 @@ static bool_t xdr_datum( XDR * xdrs, DSC * desc, UCHAR * buffer)
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -608,7 +608,7 @@ static bool_t xdr_quad(XDR* xdrs, SLONG* ip)
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -691,7 +691,7 @@ static bool_t xdr_slice(XDR* xdrs,
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1225,7 +1225,7 @@ static bool read_header(DESC handle,
|
||||
|
||||
default:
|
||||
// TMN: Here we should really have the following assert
|
||||
// assert(attribute <= MAX_USHORT);
|
||||
// fb_assert(attribute <= MAX_USHORT);
|
||||
bad_attribute((USHORT) attribute, 59); // msg 59 backup
|
||||
}
|
||||
}
|
||||
@ -1325,8 +1325,8 @@ bool MVOL_split_hdr_write(void)
|
||||
|
||||
TGBL tdgbl = GET_THREAD_DATA;
|
||||
|
||||
assert(tdgbl->action->act_action == ACT_backup_split);
|
||||
assert(tdgbl->action->act_file->fil_fd != INVALID_HANDLE_VALUE);
|
||||
fb_assert(tdgbl->action->act_action == ACT_backup_split);
|
||||
fb_assert(tdgbl->action->act_file->fil_fd != INVALID_HANDLE_VALUE);
|
||||
|
||||
if (tdgbl->action->act_file->fil_length < HDR_SPLIT_SIZE) {
|
||||
return false;
|
||||
@ -1364,7 +1364,7 @@ bool MVOL_split_hdr_read(void)
|
||||
{
|
||||
TGBL tdgbl = GET_THREAD_DATA;
|
||||
|
||||
assert(tdgbl->action->act_file->fil_fd != INVALID_HANDLE_VALUE);
|
||||
fb_assert(tdgbl->action->act_file->fil_fd != INVALID_HANDLE_VALUE);
|
||||
|
||||
if (tdgbl->action && tdgbl->action->act_file &&
|
||||
(tdgbl->action->act_file->fil_fd != INVALID_HANDLE_VALUE))
|
||||
|
@ -24,7 +24,7 @@
|
||||
* 2003.08.17 Claudio Valderrama: Fix SF Bug #750659.
|
||||
*/
|
||||
/*
|
||||
$Id: restore.epp,v 1.50 2003-11-03 01:12:14 brodsom Exp $
|
||||
$Id: restore.epp,v 1.51 2003-11-03 23:49:47 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -1270,7 +1270,7 @@ bool get_acl (const TEXT *owner_nm,
|
||||
*/
|
||||
if (num_segments > 1) {
|
||||
// CVC: I can't see the effect of assert(true)
|
||||
assert (num_segments > 1);
|
||||
fb_assert (num_segments > 1);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -4504,7 +4504,7 @@ SLONG get_numeric (void)
|
||||
|
||||
// get_text needs additional space for the terminator,
|
||||
// because it treats everything as strings.
|
||||
assert(sizeof(value) > sizeof(SLONG));
|
||||
fb_assert(sizeof(value) > sizeof(SLONG));
|
||||
|
||||
SSHORT length = get_text((TEXT*) value, sizeof(value));
|
||||
|
||||
@ -4527,7 +4527,7 @@ SINT64 get_int64 (void)
|
||||
|
||||
// get_text needs additional space for the terminator,
|
||||
// because it treats everything as strings.
|
||||
assert (sizeof(value) > sizeof(SINT64));
|
||||
fb_assert (sizeof(value) > sizeof(SINT64));
|
||||
|
||||
SSHORT length = get_text ((TEXT *) value, sizeof(value));
|
||||
|
||||
|
@ -30,9 +30,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include "../jrd/common.h"
|
||||
#include "../jrd/gdsassert.h"
|
||||
#include "../jrd/common.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
|
@ -32,7 +32,7 @@
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* $Id: alloc.cpp,v 1.34 2003-11-03 02:05:14 brodsom Exp $
|
||||
* $Id: alloc.cpp,v 1.35 2003-11-03 23:50:05 brodsom Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -149,7 +149,7 @@ void* MemoryPool::tree_alloc(size_t size) {
|
||||
needSpare = true;
|
||||
return temp;
|
||||
}
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ void* MemoryPool::allocate(size_t size, SSHORT type
|
||||
bool MemoryPool::verify_pool() {
|
||||
#ifdef TESTING_ONLY
|
||||
lock.enter();
|
||||
assert (!pendingFree || needSpare); // needSpare flag should be set if we are in
|
||||
fb_assert (!pendingFree || needSpare); // needSpare flag should be set if we are in
|
||||
// a critically low memory condition
|
||||
// check each block in each segment for consistency with free blocks structure
|
||||
for (MemoryExtent *extent = extents; extent; extent=extent->next) {
|
||||
@ -193,22 +193,22 @@ bool MemoryPool::verify_pool() {
|
||||
blk = (MemoryBlock *)((char*)blk+MEM_ALIGN(sizeof(MemoryBlock))+blk->length))
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
assert(blk->pool == this); // Pool is correct ?
|
||||
assert(blk->prev == prev); // Prev is correct ?
|
||||
fb_assert(blk->pool == this); // Pool is correct ?
|
||||
fb_assert(blk->prev == prev); // Prev is correct ?
|
||||
BlockInfo temp = {blk, blk->length};
|
||||
bool foundTree = freeBlocks.locate(temp), foundPending = false;
|
||||
for (PendingFreeBlock *tmp = pendingFree; tmp; tmp = tmp->next)
|
||||
if (tmp == (PendingFreeBlock *)((char*)blk+MEM_ALIGN(sizeof(MemoryBlock)))) {
|
||||
assert(!foundPending); // Block may be in pending list only one time
|
||||
fb_assert(!foundPending); // Block may be in pending list only one time
|
||||
foundPending = true;
|
||||
}
|
||||
assert(! (foundTree && foundPending)); // Block shouldn't be present both in
|
||||
fb_assert(! (foundTree && foundPending)); // Block shouldn't be present both in
|
||||
// pending list and in tree list
|
||||
|
||||
if (!blk->used) {
|
||||
assert(foundTree || foundPending); // Block is free. Should be somewhere
|
||||
fb_assert(foundTree || foundPending); // Block is free. Should be somewhere
|
||||
} else
|
||||
assert(!foundTree && !foundPending); // Block is not free. Should not be in free lists
|
||||
fb_assert(!foundTree && !foundPending); // Block is not free. Should not be in free lists
|
||||
#endif
|
||||
prev = blk;
|
||||
if (blk->last) break;
|
||||
@ -398,8 +398,8 @@ void* MemoryPool::internal_alloc(size_t size, SSHORT type
|
||||
freeBlocks.getNext();
|
||||
#else
|
||||
bool res = freeBlocks.getNext();
|
||||
assert(res);
|
||||
assert(&freeBlocks.current()==current);
|
||||
fb_assert(res);
|
||||
fb_assert(&freeBlocks.current()==current);
|
||||
#endif
|
||||
MemoryBlock *block = current->block;
|
||||
freeBlocks.fastRemove();
|
||||
@ -552,7 +552,7 @@ void MemoryPool::removeFreeBlock(MemoryBlock *blk) {
|
||||
}
|
||||
itr = next;
|
||||
}
|
||||
assert(itr); // We had to find it somewhere
|
||||
fb_assert(itr); // We had to find it somewhere
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -572,7 +572,7 @@ void MemoryPool::free_blk_extent(MemoryBlock *blk) {
|
||||
}
|
||||
itr = next;
|
||||
}
|
||||
assert(itr); // We had to find it somewhere
|
||||
fb_assert(itr); // We had to find it somewhere
|
||||
}
|
||||
extents_memory -= blk->length + MEM_ALIGN(sizeof(MemoryBlock));
|
||||
external_free(extent);
|
||||
@ -582,8 +582,8 @@ void MemoryPool::deallocate(void *block) {
|
||||
if (!block) return;
|
||||
lock.enter();
|
||||
MemoryBlock *blk = (MemoryBlock *)((char*)block - MEM_ALIGN(sizeof(MemoryBlock))), *prev;
|
||||
assert(blk->used);
|
||||
assert(blk->pool==this);
|
||||
fb_assert(blk->used);
|
||||
fb_assert(blk->pool==this);
|
||||
used_memory -= blk->length + MEM_ALIGN(sizeof(MemoryBlock));
|
||||
if (cur_memory) *cur_memory -= blk->length + MEM_ALIGN(sizeof(MemoryBlock));
|
||||
// Try to merge block with preceding free block
|
||||
|
@ -26,7 +26,7 @@
|
||||
#ifndef ARRAY_H
|
||||
#define ARRAY_H
|
||||
|
||||
#include <assert.h>
|
||||
#include "../jrd/gdsassert.h"
|
||||
#include <string.h>
|
||||
#include "../common/classes/vector.h"
|
||||
#include "../common/classes/alloc.h"
|
||||
@ -69,13 +69,13 @@ public:
|
||||
~Array() { if (data != getStorage()) pool->deallocate(data); }
|
||||
void clear() { count = 0; };
|
||||
T& operator[](int index) {
|
||||
assert(index >= 0 && index < count);
|
||||
fb_assert(index >= 0 && index < count);
|
||||
return data[index];
|
||||
}
|
||||
T* begin() { return data; }
|
||||
T* end() { return data + count; }
|
||||
void insert(int index, const T& item) {
|
||||
assert(index >= 0 && index <= count);
|
||||
fb_assert(index >= 0 && index <= count);
|
||||
ensureCapacity(count + 1);
|
||||
memmove(data + index + 1, data + index, sizeof(T) * (count++ - index));
|
||||
data[index] = item;
|
||||
@ -86,16 +86,16 @@ public:
|
||||
return count;
|
||||
};
|
||||
void remove(int index) {
|
||||
assert(index >= 0 && index < count);
|
||||
fb_assert(index >= 0 && index < count);
|
||||
memmove(data + index, data + index + 1, sizeof(T) * (--count - index));
|
||||
}
|
||||
void shrink(int newCount) {
|
||||
assert(newCount <= count);
|
||||
fb_assert(newCount <= count);
|
||||
count = newCount;
|
||||
};
|
||||
// Grow size of our array and zero-initialize new items
|
||||
void grow(int newCount) {
|
||||
assert(newCount >= count);
|
||||
fb_assert(newCount >= count);
|
||||
ensureCapacity(newCount);
|
||||
memset(data + count, 0, sizeof(T) * (newCount - count));
|
||||
count = newCount;
|
||||
|
@ -32,7 +32,7 @@
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* $Id: class_test.cpp,v 1.10 2003-09-08 20:23:32 skidder Exp $
|
||||
* $Id: class_test.cpp,v 1.11 2003-11-03 23:50:05 brodsom Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -110,7 +110,7 @@ void testBePlusTree() {
|
||||
t.value = v[i];
|
||||
t.count = 1;
|
||||
if (!tree1.add(t))
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
cnt1++;
|
||||
}
|
||||
if (tree2.locate(locEqual, v[i]))
|
||||
@ -120,7 +120,7 @@ void testBePlusTree() {
|
||||
t.value = v[i];
|
||||
t.count = 1;
|
||||
if (!tree2.add(t))
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
cnt2++;
|
||||
}
|
||||
}
|
||||
@ -170,7 +170,7 @@ void testBePlusTree() {
|
||||
printf("Remove half of data from the trees: ");
|
||||
while (v.getCount() > TEST_ITEMS/2) {
|
||||
if (!tree1.locate(locEqual, v[v.getCount()-1]))
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
if (tree1.current().count > 1)
|
||||
tree1.current().count--;
|
||||
else {
|
||||
@ -178,7 +178,7 @@ void testBePlusTree() {
|
||||
cnt1--;
|
||||
}
|
||||
if (!tree2.locate(locEqual, v[v.getCount()-1]))
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
if (tree2.current().count > 1)
|
||||
tree2.current().count--;
|
||||
else {
|
||||
@ -234,7 +234,7 @@ void testBePlusTree() {
|
||||
printf("Remove the rest of data from the trees: ");
|
||||
for (i=0;i < v.getCount(); i++) {
|
||||
if (!tree1.locate(locEqual, v[i]))
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
if (tree1.current().count > 1)
|
||||
tree1.current().count--;
|
||||
else {
|
||||
@ -242,7 +242,7 @@ void testBePlusTree() {
|
||||
cnt1--;
|
||||
}
|
||||
if (!tree2.locate(locEqual, v[i]))
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
if (tree2.current().count > 1)
|
||||
tree2.current().count--;
|
||||
else {
|
||||
|
@ -32,7 +32,7 @@
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* $Id: semaphore.h,v 1.4 2003-11-01 10:26:35 robocop Exp $
|
||||
* $Id: semaphore.h,v 1.5 2003-11-03 23:50:05 brodsom Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -89,22 +89,22 @@ private:
|
||||
public:
|
||||
Semaphore() : init(false) {
|
||||
if (sem_init(&sem, 0, 0) == -1) {
|
||||
gds__log("Error on semaphore.h constructor error");
|
||||
gds__log("Error on semaphore.h: constructor");
|
||||
system_call_failed::raise();
|
||||
}
|
||||
init = true;
|
||||
}
|
||||
~Semaphore() {
|
||||
assert(init == true);
|
||||
fb_assert(init == true);
|
||||
if (sem_destroy(&sem) == -1) {
|
||||
gds__log("Error on semaphore.h destructor error");
|
||||
gds__log("Error on semaphore.h: destructor");
|
||||
system_call_failed::raise();
|
||||
}
|
||||
init = false;
|
||||
|
||||
}
|
||||
bool tryEnter(int seconds = 0) {
|
||||
assert(init == true);
|
||||
fb_assert(init == true);
|
||||
if (seconds == 0) {
|
||||
if (sem_trywait(&sem) != -1)
|
||||
return true;
|
||||
@ -123,22 +123,22 @@ public:
|
||||
return false;
|
||||
}
|
||||
char message[128];
|
||||
sprintf(message, "Error on semaphore.h tryEnter errno=%d\n", errno);
|
||||
sprintf(message, "Error on semaphore.h: tryEnter errno=%d\n", errno);
|
||||
gds__log(message);
|
||||
system_call_failed::raise();
|
||||
}
|
||||
void enter() {
|
||||
assert(init == true);
|
||||
fb_assert(init == true);
|
||||
if (sem_wait(&sem) == -1) {
|
||||
gds__log("Error on semaphore.h enter error");
|
||||
gds__log("Error on semaphore.h: enter");
|
||||
system_call_failed::raise();
|
||||
}
|
||||
}
|
||||
void release(SLONG count = 1) {
|
||||
assert(init == true);
|
||||
fb_assert(init == true);
|
||||
for (int i = 0; i < count; i++)
|
||||
if (sem_post(&sem) == -1) {
|
||||
gds__log("Error on semaphore.h release error");
|
||||
gds__log("Error on semaphore.h: release");
|
||||
system_call_failed::raise();
|
||||
}
|
||||
}
|
||||
|
@ -32,14 +32,14 @@
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* $Id: tree.h,v 1.21 2003-11-03 02:05:13 brodsom Exp $
|
||||
* $Id: tree.h,v 1.22 2003-11-03 23:50:05 brodsom Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TREE_H
|
||||
#define TREE_H
|
||||
|
||||
#include <assert.h>
|
||||
#include "../jrd/gdsassert.h"
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h> /* XPG: prototypes for malloc/free have to be in
|
||||
@ -417,7 +417,7 @@ public:
|
||||
if ( curr->getCount() == 1 ) {
|
||||
// Only one node left in the current page. We cannot remove it directly
|
||||
// because is would invalidate our tree structure
|
||||
assert(curPos == 0);
|
||||
fb_assert(curPos == 0);
|
||||
ItemList *temp;
|
||||
if ( (temp = curr->prev) && NEED_MERGE(temp->getCount(), LeafCount) ) {
|
||||
tree->_removePage(0, curr);
|
||||
@ -439,7 +439,7 @@ public:
|
||||
else
|
||||
{
|
||||
// It means the tree is broken
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -609,7 +609,7 @@ void BePlusTree<Value, Key, Allocator, KeyOfValue, Cmp, LeafCount, NodeCount>::_
|
||||
else
|
||||
{
|
||||
// It means the tree is broken
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -619,7 +619,7 @@ void BePlusTree<Value, Key, Allocator, KeyOfValue, Cmp, LeafCount, NodeCount>::_
|
||||
list->find(NodeList::generate(list,node),pos);
|
||||
#else
|
||||
bool found = list->find(NodeList::generate(list,node),pos);
|
||||
assert(found);
|
||||
fb_assert(found);
|
||||
#endif
|
||||
list->remove(pos);
|
||||
|
||||
|
@ -32,14 +32,14 @@
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* $Id: vector.h,v 1.3 2003-09-08 20:23:32 skidder Exp $
|
||||
* $Id: vector.h,v 1.4 2003-11-03 23:50:05 brodsom Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef VECTOR_H
|
||||
#define VECTOR_H
|
||||
|
||||
#include <assert.h>
|
||||
#include "../jrd/gdsassert.h"
|
||||
#include <string.h>
|
||||
|
||||
namespace Firebird {
|
||||
@ -51,33 +51,33 @@ public:
|
||||
Vector() : count(0) {}
|
||||
void clear() { count = 0; };
|
||||
T& operator[](int index) {
|
||||
assert(index >= 0 && index < count);
|
||||
fb_assert(index >= 0 && index < count);
|
||||
return data[index];
|
||||
}
|
||||
T* begin() { return data; }
|
||||
T* end() { return data+count; }
|
||||
void insert(int index, const T& item) {
|
||||
assert(index >= 0 && index <= count);
|
||||
assert(count < Capacity);
|
||||
fb_assert(index >= 0 && index <= count);
|
||||
fb_assert(count < Capacity);
|
||||
memmove(data+index+1, data+index, sizeof(T)*(count++-index));
|
||||
data[index] = item;
|
||||
}
|
||||
|
||||
int add(const T& item) {
|
||||
assert(count < Capacity);
|
||||
fb_assert(count < Capacity);
|
||||
data[count++] = item;
|
||||
return count;
|
||||
};
|
||||
void remove(int index) {
|
||||
assert(index >= 0 && index < count);
|
||||
fb_assert(index >= 0 && index < count);
|
||||
memmove(data+index, data+index+1, sizeof(T)*(--count-index));
|
||||
}
|
||||
void shrink(int newCount) {
|
||||
assert(newCount <= count);
|
||||
fb_assert(newCount <= count);
|
||||
count = newCount;
|
||||
};
|
||||
void join(Vector<T,Capacity>& L) {
|
||||
assert(count + L.count <= Capacity);
|
||||
fb_assert(count + L.count <= Capacity);
|
||||
memcpy(data + count, L.data, sizeof(T)*L.count);
|
||||
count += L.count;
|
||||
}
|
||||
|
108
src/dsql/ddl.cpp
108
src/dsql/ddl.cpp
@ -20,7 +20,7 @@
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*
|
||||
* $Id: ddl.cpp,v 1.74 2003-11-02 12:28:20 dimitr Exp $
|
||||
* $Id: ddl.cpp,v 1.75 2003-11-03 23:51:11 brodsom Exp $
|
||||
* 2001.5.20 Claudio Valderrama: Stop null pointer that leads to a crash,
|
||||
* caused by incomplete yacc syntax that allows ALTER DOMAIN dom SET;
|
||||
*
|
||||
@ -531,7 +531,7 @@ void DDL_resolve_intl_type2(dsql_req* request,
|
||||
if (afield != field && afield->fld_relation
|
||||
&& !strcmp (afield->fld_name, field->fld_name))
|
||||
{
|
||||
assert (afield->fld_relation == relation || !relation);
|
||||
fb_assert(afield->fld_relation == relation || !relation);
|
||||
break;
|
||||
}
|
||||
afield = afield->fld_next;
|
||||
@ -818,7 +818,7 @@ static bool check_array_or_blob(const dsql_nod* node)
|
||||
return false;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1009,10 +1009,10 @@ static void define_computed(dsql_req* request,
|
||||
|
||||
if (field && field->fld_dtype)
|
||||
{
|
||||
assert(field->fld_dtype <= MAX_UCHAR);
|
||||
fb_assert(field->fld_dtype <= MAX_UCHAR);
|
||||
save_desc.dsc_dtype = (UCHAR) field->fld_dtype;
|
||||
save_desc.dsc_length = field->fld_length;
|
||||
assert(field->fld_scale <= MAX_SCHAR);
|
||||
fb_assert(field->fld_scale <= MAX_SCHAR);
|
||||
save_desc.dsc_scale = (SCHAR) field->fld_scale;
|
||||
|
||||
field->fld_dtype = 0;
|
||||
@ -1064,7 +1064,7 @@ static void define_computed(dsql_req* request,
|
||||
|
||||
// generate the source text
|
||||
const str* source = (str*) node->nod_arg[e_cmp_text];
|
||||
assert(source->str_length <= MAX_USHORT);
|
||||
fb_assert(source->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_fld_computed_source,
|
||||
source->str_data,
|
||||
(USHORT) source->str_length);
|
||||
@ -1099,7 +1099,7 @@ static void define_constraint_trigger(dsql_req* request, dsql_nod* node)
|
||||
|
||||
const str* trigger_name = (str*) node->nod_arg[e_cnstr_name];
|
||||
|
||||
assert(trigger_name->str_length <= MAX_USHORT);
|
||||
fb_assert(trigger_name->str_length <= MAX_USHORT);
|
||||
|
||||
request->append_string( gds_dyn_def_trigger,
|
||||
trigger_name->str_data,
|
||||
@ -1108,7 +1108,7 @@ static void define_constraint_trigger(dsql_req* request, dsql_nod* node)
|
||||
dsql_nod* relation_node = node->nod_arg[e_cnstr_table];
|
||||
const str* relation_name = (str*) relation_node->nod_arg[e_rln_name];
|
||||
|
||||
assert(trigger_name->str_length <= MAX_USHORT);
|
||||
fb_assert(trigger_name->str_length <= MAX_USHORT);
|
||||
|
||||
request->append_string( gds_dyn_rel_name,
|
||||
relation_name->str_data,
|
||||
@ -1117,7 +1117,7 @@ static void define_constraint_trigger(dsql_req* request, dsql_nod* node)
|
||||
const str* source = (str*) node->nod_arg[e_cnstr_source];
|
||||
if (source)
|
||||
{
|
||||
assert(source->str_length <= MAX_USHORT);
|
||||
fb_assert(source->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_trg_source,
|
||||
source->str_data,
|
||||
(USHORT) source->str_length);
|
||||
@ -1142,7 +1142,7 @@ static void define_constraint_trigger(dsql_req* request, dsql_nod* node)
|
||||
if (message)
|
||||
{
|
||||
request->append_number(gds_dyn_def_trigger_msg, 0);
|
||||
assert(message->str_length <= MAX_USHORT);
|
||||
fb_assert(message->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_trg_msg,
|
||||
message->str_data,
|
||||
(USHORT) message->str_length);
|
||||
@ -1700,7 +1700,7 @@ static void define_domain(dsql_req* request)
|
||||
const str* string = (str*) element->nod_arg[e_dom_default_source];
|
||||
if (string)
|
||||
{
|
||||
assert(string->str_length <= MAX_USHORT);
|
||||
fb_assert(string->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_fld_default_source,
|
||||
string->str_data,
|
||||
string->str_length);
|
||||
@ -1751,7 +1751,7 @@ static void define_domain(dsql_req* request)
|
||||
const str* string = (str*) node1->nod_arg[e_cnstr_source];
|
||||
if (string)
|
||||
{
|
||||
assert(string->str_length <= MAX_USHORT);
|
||||
fb_assert(string->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_fld_validation_source,
|
||||
string->str_data,
|
||||
string->str_length);
|
||||
@ -1816,7 +1816,7 @@ static void define_exception( dsql_req* request, NOD_TYPE op)
|
||||
request->append_cstring(gds_dyn_del_exception, name->str_data);
|
||||
|
||||
if (op != nod_del_exception) {
|
||||
assert(text->str_length <= MAX_USHORT);
|
||||
fb_assert(text->str_length <= MAX_USHORT);
|
||||
request->append_string(gds_dyn_xcp_msg, text->str_data, text->str_length);
|
||||
request->append_uchar(gds_dyn_end);
|
||||
}
|
||||
@ -1917,7 +1917,7 @@ static void define_field(
|
||||
string = (str*) element->nod_arg[e_dfl_default_source];
|
||||
if (string)
|
||||
{
|
||||
assert(string->str_length <= MAX_USHORT);
|
||||
fb_assert(string->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_fld_default_source,
|
||||
string->str_data,
|
||||
string->str_length);
|
||||
@ -1972,7 +1972,7 @@ static void define_field(
|
||||
request->append_cstring(gds_dyn_rel_constraint, constraint_name);
|
||||
|
||||
dsql_nod* index = node1->nod_arg[e_pri_index];
|
||||
assert(index);
|
||||
fb_assert(index);
|
||||
|
||||
const char* index_name = constraint_name;
|
||||
string = (str*) index->nod_arg[e_idx_name];
|
||||
@ -2313,7 +2313,7 @@ static void define_procedure( dsql_req* request, NOD_TYPE op)
|
||||
const str* source = (str*) procedure_node->nod_arg[e_prc_source];
|
||||
if (source)
|
||||
{
|
||||
assert(source->str_length <= MAX_USHORT);
|
||||
fb_assert(source->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_prc_source,
|
||||
source->str_data,
|
||||
source->str_length);
|
||||
@ -2608,8 +2608,8 @@ static void define_set_null_trg(dsql_req* request,
|
||||
}
|
||||
|
||||
// count of foreign key columns
|
||||
assert(prim_columns->nod_count == for_columns->nod_count);
|
||||
assert(prim_columns->nod_count != 0);
|
||||
fb_assert(prim_columns->nod_count == for_columns->nod_count);
|
||||
fb_assert(prim_columns->nod_count != 0);
|
||||
|
||||
request->generate_unnamed_trigger_beginning(on_upd_trg,
|
||||
prim_rel_name,
|
||||
@ -2746,13 +2746,13 @@ static void define_trigger( dsql_req* request, dsql_nod* node)
|
||||
}
|
||||
else if (node->nod_type == nod_def_trigger)
|
||||
{
|
||||
assert(trigger_name->str_length <= MAX_USHORT);
|
||||
fb_assert(trigger_name->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_def_trigger,
|
||||
trigger_name->str_data,
|
||||
trigger_name->str_length);
|
||||
relation_node = node->nod_arg[e_trg_table];
|
||||
relation_name = (str*) relation_node->nod_arg[e_rln_name];
|
||||
assert(relation_name->str_length <= MAX_USHORT);
|
||||
fb_assert(relation_name->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_rel_name,
|
||||
relation_name->str_data,
|
||||
relation_name->str_length);
|
||||
@ -2760,8 +2760,8 @@ static void define_trigger( dsql_req* request, dsql_nod* node)
|
||||
}
|
||||
else // nod_mod_trigger
|
||||
{
|
||||
assert(node->nod_type == nod_mod_trigger);
|
||||
assert(trigger_name->str_length <= MAX_USHORT);
|
||||
fb_assert(node->nod_type == nod_mod_trigger);
|
||||
fb_assert(trigger_name->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_mod_trigger,
|
||||
trigger_name->str_data,
|
||||
trigger_name->str_length);
|
||||
@ -2794,7 +2794,7 @@ static void define_trigger( dsql_req* request, dsql_nod* node)
|
||||
node->nod_arg[e_trg_actions]->nod_arg[e_trg_act_body] : NULL;
|
||||
|
||||
if (source && actions) {
|
||||
assert(source->str_length <= MAX_USHORT);
|
||||
fb_assert(source->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_trg_source,
|
||||
source->str_data,
|
||||
source->str_length);
|
||||
@ -2813,7 +2813,7 @@ static void define_trigger( dsql_req* request, dsql_nod* node)
|
||||
trig_type = (USHORT)(ULONG) constant->nod_arg[0];
|
||||
}
|
||||
else {
|
||||
assert(node->nod_type == nod_mod_trigger);
|
||||
fb_assert(node->nod_type == nod_mod_trigger);
|
||||
}
|
||||
|
||||
if (actions)
|
||||
@ -2904,7 +2904,7 @@ static void define_trigger( dsql_req* request, dsql_nod* node)
|
||||
} else {
|
||||
request->append_number(gds_dyn_mod_trigger_msg, number);
|
||||
}
|
||||
assert(message_text->str_length <= MAX_USHORT);
|
||||
fb_assert(message_text->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_trg_msg,
|
||||
message_text->str_data,
|
||||
message_text->str_length);
|
||||
@ -3041,7 +3041,7 @@ static void define_udf( dsql_req* request)
|
||||
position = 1;
|
||||
}
|
||||
|
||||
assert(position == 1);
|
||||
fb_assert(position == 1);
|
||||
|
||||
/* CVC: This for all params, including the case of "returns parameter <N>" */
|
||||
|
||||
@ -3257,8 +3257,8 @@ static void define_upd_cascade_trg( dsql_req* request,
|
||||
}
|
||||
|
||||
// count of foreign key columns
|
||||
assert(prim_columns->nod_count == for_columns->nod_count);
|
||||
assert(prim_columns->nod_count != 0);
|
||||
fb_assert(prim_columns->nod_count == for_columns->nod_count);
|
||||
fb_assert(prim_columns->nod_count != 0);
|
||||
|
||||
request->generate_unnamed_trigger_beginning(true,
|
||||
prim_rel_name,
|
||||
@ -3385,7 +3385,7 @@ static void define_view( dsql_req* request, NOD_TYPE op)
|
||||
Source will be for documentation purposes. */
|
||||
|
||||
const str* source = (str*) node->nod_arg[e_view_source];
|
||||
assert(source->str_length <= MAX_USHORT);
|
||||
fb_assert(source->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_view_source,
|
||||
source->str_data,
|
||||
source->str_length);
|
||||
@ -3643,13 +3643,13 @@ static void define_view_trigger( dsql_req* request, dsql_nod* node, dsql_nod* rs
|
||||
|
||||
if (node->nod_type == nod_def_constraint)
|
||||
{
|
||||
assert(trigger_name->str_length <= MAX_USHORT);
|
||||
fb_assert(trigger_name->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_def_trigger,
|
||||
trigger_name->str_data,
|
||||
trigger_name->str_length);
|
||||
relation_node = node->nod_arg[e_cnstr_table];
|
||||
relation_name = (str*) relation_node->nod_arg[e_rln_name];
|
||||
assert(relation_name->str_length <= MAX_USHORT);
|
||||
fb_assert(relation_name->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_rel_name,
|
||||
relation_name->str_data,
|
||||
relation_name->str_length);
|
||||
@ -3687,7 +3687,7 @@ static void define_view_trigger( dsql_req* request, dsql_nod* node, dsql_nod* rs
|
||||
if (message)
|
||||
{
|
||||
request->append_number(gds_dyn_def_trigger_msg, 0);
|
||||
assert(message->str_length <= MAX_USHORT);
|
||||
fb_assert(message->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_trg_msg,
|
||||
message->str_data,
|
||||
message->str_length);
|
||||
@ -3828,7 +3828,7 @@ static void delete_procedure (dsql_req* request,
|
||||
*
|
||||
**************************************/
|
||||
const str* string = (str*) node->nod_arg[e_prc_name];
|
||||
assert (string);
|
||||
fb_assert (string);
|
||||
if (node->nod_type == nod_redef_procedure || silent_deletion) {
|
||||
dsql_prc* procedure = METD_get_procedure (request, string);
|
||||
if (!procedure) {
|
||||
@ -3864,14 +3864,14 @@ static void delete_relation_view (
|
||||
|
||||
if (node->nod_type == nod_redef_relation) {
|
||||
dsql_nod* relation_node = node->nod_arg[e_alt_name];
|
||||
assert (relation_node);
|
||||
fb_assert (relation_node);
|
||||
string = (str*) relation_node->nod_arg[e_rln_name];
|
||||
}
|
||||
else {
|
||||
string = (str*) node->nod_arg[e_alt_name];
|
||||
}
|
||||
|
||||
assert (string);
|
||||
fb_assert (string);
|
||||
|
||||
dsql_rel* relation = METD_get_relation (request, string);
|
||||
|
||||
@ -4278,10 +4278,10 @@ static void make_index( dsql_req* request,
|
||||
zero-length name, indicating that an index name
|
||||
should be generated */
|
||||
|
||||
assert(element->nod_type != nod_foreign);
|
||||
fb_assert(element->nod_type != nod_foreign);
|
||||
|
||||
dsql_nod* index = element->nod_arg[e_pri_index];
|
||||
assert(index);
|
||||
fb_assert(index);
|
||||
|
||||
const str* string = (str*) index->nod_arg[e_idx_name];
|
||||
if (string)
|
||||
@ -4342,7 +4342,7 @@ static void make_index_trg_ref_int( dsql_req* request,
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
assert(element->nod_type == nod_foreign)
|
||||
fb_assert(element->nod_type == nod_foreign)
|
||||
|
||||
/* for_rel_name_str is the name of the relation
|
||||
on which the ddl operation is being done,
|
||||
@ -4357,7 +4357,7 @@ static void make_index_trg_ref_int( dsql_req* request,
|
||||
should be generated */
|
||||
|
||||
dsql_nod* index = element->nod_arg[e_for_index];
|
||||
assert(index);
|
||||
fb_assert(index);
|
||||
|
||||
const str* string = (str*) index->nod_arg[e_idx_name];
|
||||
if (string)
|
||||
@ -4375,12 +4375,12 @@ static void make_index_trg_ref_int( dsql_req* request,
|
||||
if (element->nod_arg[e_for_action])
|
||||
{
|
||||
dsql_nod* nod_for_action = element->nod_arg[e_for_action];
|
||||
assert(nod_for_action->nod_type == nod_ref_upd_del);
|
||||
fb_assert(nod_for_action->nod_type == nod_ref_upd_del);
|
||||
|
||||
dsql_nod* nod_ref_upd_action = nod_for_action->nod_arg[e_ref_upd];
|
||||
if (nod_ref_upd_action)
|
||||
{
|
||||
assert(nod_ref_upd_action->nod_type == nod_ref_trig_action);
|
||||
fb_assert(nod_ref_upd_action->nod_type == nod_ref_trig_action);
|
||||
|
||||
request->append_uchar(gds_dyn_foreign_key_update);
|
||||
switch (nod_ref_upd_action->nod_flags)
|
||||
@ -4409,7 +4409,7 @@ static void make_index_trg_ref_int( dsql_req* request,
|
||||
request->append_uchar(gds_dyn_foreign_key_none);
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
request->append_uchar(gds_dyn_foreign_key_none); /* just in case */
|
||||
break;
|
||||
}
|
||||
@ -4418,7 +4418,7 @@ static void make_index_trg_ref_int( dsql_req* request,
|
||||
dsql_nod* nod_ref_del_action = nod_for_action->nod_arg[e_ref_del];
|
||||
if (nod_ref_del_action)
|
||||
{
|
||||
assert(nod_ref_del_action->nod_type == nod_ref_trig_action);
|
||||
fb_assert(nod_ref_del_action->nod_type == nod_ref_trig_action);
|
||||
|
||||
request->append_uchar(gds_dyn_foreign_key_delete);
|
||||
switch (nod_ref_del_action->nod_flags) {
|
||||
@ -4446,7 +4446,7 @@ static void make_index_trg_ref_int( dsql_req* request,
|
||||
request->append_uchar(gds_dyn_foreign_key_none);
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
request->append_uchar(gds_dyn_foreign_key_none); /* just in case */
|
||||
break;
|
||||
/* Error */
|
||||
@ -4705,7 +4705,7 @@ static void modify_domain( dsql_req* request)
|
||||
string = (str*) element->nod_arg[e_dft_default_source];
|
||||
if (string)
|
||||
{
|
||||
assert(string->str_length <= MAX_USHORT);
|
||||
fb_assert(string->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_fld_default_source,
|
||||
string->str_data,
|
||||
(USHORT) string->str_length);
|
||||
@ -4752,7 +4752,7 @@ static void modify_domain( dsql_req* request)
|
||||
|
||||
request->end_blr();
|
||||
if ((string = (str*) element->nod_arg[e_cnstr_source]) != NULL) {
|
||||
assert(string->str_length <= MAX_USHORT);
|
||||
fb_assert(string->str_length <= MAX_USHORT);
|
||||
request->append_string( gds_dyn_fld_validation_source,
|
||||
string->str_data,
|
||||
string->str_length);
|
||||
@ -5122,7 +5122,7 @@ static void modify_relation( dsql_req* request)
|
||||
gds_arg_gds, gds_dsql_construct_err, 0);
|
||||
}
|
||||
|
||||
assert((element->nod_arg[1])->nod_type == nod_restrict);
|
||||
fb_assert((element->nod_arg[1])->nod_type == nod_restrict);
|
||||
request->append_cstring(gds_dyn_delete_local_fld, field_name->str_data);
|
||||
request->append_uchar(gds_dyn_end);
|
||||
break;
|
||||
@ -5319,7 +5319,7 @@ static void put_field( dsql_req* request, dsql_fld* field, bool udf_flag)
|
||||
if (field->fld_dtype == dtype_varying)
|
||||
{
|
||||
/* CVC: Fix the assertion */
|
||||
assert((field->fld_length) <= MAX_SSHORT);
|
||||
fb_assert((field->fld_length) <= MAX_SSHORT);
|
||||
request->append_number(gds_dyn_fld_length,
|
||||
(SSHORT) (field->fld_length - sizeof(USHORT)));
|
||||
}
|
||||
@ -5766,7 +5766,7 @@ static void stuff_default_blr( dsql_req* request,
|
||||
* blr in the blr stream in the request.
|
||||
*
|
||||
*********************************************/
|
||||
assert((*default_buff == blr_version4) || (*default_buff == blr_version5));
|
||||
fb_assert((*default_buff == blr_version4) || (*default_buff == blr_version5));
|
||||
|
||||
unsigned int i;
|
||||
|
||||
@ -5775,7 +5775,7 @@ static void stuff_default_blr( dsql_req* request,
|
||||
request->append_uchar(default_buff[i]);
|
||||
}
|
||||
|
||||
assert(default_buff[i] == blr_eoc);
|
||||
fb_assert(default_buff[i] == blr_eoc);
|
||||
}
|
||||
|
||||
|
||||
@ -5796,8 +5796,8 @@ static void stuff_matching_blr(dsql_req* request, const dsql_nod* for_columns,
|
||||
**************************************/
|
||||
|
||||
/* count of foreign key columns */
|
||||
assert(prim_columns->nod_count == for_columns->nod_count);
|
||||
assert(prim_columns->nod_count != 0);
|
||||
fb_assert(prim_columns->nod_count == for_columns->nod_count);
|
||||
fb_assert(prim_columns->nod_count != 0);
|
||||
|
||||
request->append_uchar(blr_boolean);
|
||||
if (prim_columns->nod_count > 1) {
|
||||
@ -5963,10 +5963,10 @@ static void set_nod_value_attributes( dsql_nod* node, const dsql_fld* field)
|
||||
{
|
||||
if (nod_dom_value == child->nod_type)
|
||||
{
|
||||
assert(field->fld_dtype <= MAX_UCHAR);
|
||||
fb_assert(field->fld_dtype <= MAX_UCHAR);
|
||||
child->nod_desc.dsc_dtype = (UCHAR) field->fld_dtype;
|
||||
child->nod_desc.dsc_length = field->fld_length;
|
||||
assert(field->fld_scale <= MAX_SCHAR);
|
||||
fb_assert(field->fld_scale <= MAX_SCHAR);
|
||||
child->nod_desc.dsc_scale = (SCHAR) field->fld_scale;
|
||||
}
|
||||
else if ((nod_constant != child->nod_type) &&
|
||||
|
@ -1542,7 +1542,7 @@ ISC_STATUS GDS_DSQL_SET_CURSOR_CPP( ISC_STATUS* user_status,
|
||||
request->req_cursor = MAKE_symbol(request->req_dbb, cursor,
|
||||
length, SYM_cursor, request);
|
||||
} else {
|
||||
assert(request->req_cursor != symbol);
|
||||
fb_assert(request->req_cursor != symbol);
|
||||
ERRD_post(gds_sqlerr, gds_arg_number, (SLONG) - 502,
|
||||
gds_arg_gds, gds_dsql_decl_err, 0);
|
||||
}
|
||||
@ -3271,7 +3271,7 @@ static ISC_STATUS execute_request(dsql_req* request,
|
||||
|
||||
default:
|
||||
/* Catch invalid request types */
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
/* Fall into ... */
|
||||
|
||||
case REQ_SELECT:
|
||||
|
@ -625,19 +625,14 @@ typedef tsql* TSQL;
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define _assert(ex) {if (!(ex)) {ERRD_assert_msg (NULL, (char*)__FILE__, __LINE__);}}
|
||||
#undef assert
|
||||
#define assert(ex) _assert(ex)
|
||||
#define ASSERT_FAIL ERRD_assert_msg (NULL, (char*)__FILE__, __LINE__)
|
||||
#undef fb_assert
|
||||
#define fb_assert(ex) {if (!(ex)) {ERRD_assert_msg (NULL, (char*)__FILE__, __LINE__);}}
|
||||
|
||||
#else // PROD_BUILD
|
||||
|
||||
#define DEV_BLKCHK(blk, typ)
|
||||
#define _assert(ex)
|
||||
#undef assert
|
||||
#define assert(ex)
|
||||
#define ASSERT_FAIL
|
||||
#undef fb_assert
|
||||
#define fb_assert(ex)
|
||||
|
||||
#endif // DEV_BUILD
|
||||
|
||||
|
@ -276,7 +276,7 @@ void ERRD_post(ISC_STATUS status, ...)
|
||||
|
||||
/* calculate length of the status */
|
||||
PARSE_STATUS(tmp_status, tmp_status_len, warning_indx);
|
||||
assert(warning_indx == 0);
|
||||
fb_assert(warning_indx == 0);
|
||||
|
||||
if (status_vector[0] != gds_arg_gds ||
|
||||
(status_vector[0] == gds_arg_gds && status_vector[1] == 0 &&
|
||||
|
@ -1640,7 +1640,7 @@ static void gen_error_condition( dsql_req* request, const dsql_nod* node)
|
||||
return;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1973,7 +1973,7 @@ static void gen_plan( dsql_req* request, const dsql_nod* plan_expression)
|
||||
}
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ void HSHD_insert(DSQL_SYM symbol)
|
||||
const SSHORT h = hash(symbol->sym_string, symbol->sym_length);
|
||||
const void* database = symbol->sym_dbb;
|
||||
|
||||
assert(symbol->sym_type >= SYM_statement && symbol->sym_type <= SYM_eof);
|
||||
fb_assert(symbol->sym_type >= SYM_statement && symbol->sym_type <= SYM_eof);
|
||||
|
||||
for (DSQL_SYM old = hash_table[h]; old; old = old->sym_collision)
|
||||
if ((!database || (database == old->sym_dbb)) &&
|
||||
|
@ -200,7 +200,7 @@ dsql_nod* MAKE_constant(str* constant, dsql_constant_type numeric_flag)
|
||||
}
|
||||
|
||||
default:
|
||||
assert(numeric_flag == CONSTANT_STRING);
|
||||
fb_assert(numeric_flag == CONSTANT_STRING);
|
||||
DEV_BLKCHK(constant, dsql_type_str);
|
||||
|
||||
node->nod_desc.dsc_dtype = dtype_text;
|
||||
@ -420,7 +420,7 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
|
||||
instead of VARCHAR for historical reasons. */
|
||||
if (node->nod_type == nod_substr && desc1.dsc_dtype == dtype_blob) {
|
||||
dsql_nod* for_node = node->nod_arg [e_substr_length];
|
||||
assert (for_node->nod_desc.dsc_dtype == dtype_long);
|
||||
fb_assert (for_node->nod_desc.dsc_dtype == dtype_long);
|
||||
/* Migrate the charset from the blob to the string. */
|
||||
desc->dsc_ttype = desc1.dsc_scale;
|
||||
const SLONG len = *(SLONG *) for_node->nod_desc.dsc_address;
|
||||
@ -545,7 +545,7 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
|
||||
desc->dsc_scale = ISC_TIME_SECONDS_PRECISION_SCALE;
|
||||
}
|
||||
else {
|
||||
assert(dtype == dtype_timestamp);
|
||||
fb_assert(dtype == dtype_timestamp);
|
||||
desc->dsc_dtype = dtype_double;
|
||||
desc->dsc_length = sizeof(double);
|
||||
desc->dsc_scale = 0;
|
||||
@ -570,13 +570,13 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
|
||||
desc->dsc_dtype = desc1.dsc_dtype;
|
||||
if (!DTYPE_IS_DATE(desc->dsc_dtype))
|
||||
desc->dsc_dtype = desc2.dsc_dtype;
|
||||
assert(DTYPE_IS_DATE(desc->dsc_dtype));
|
||||
fb_assert(DTYPE_IS_DATE(desc->dsc_dtype));
|
||||
desc->dsc_length = type_lengths[desc->dsc_dtype];
|
||||
desc->dsc_scale = 0;
|
||||
}
|
||||
else {
|
||||
/* <non-date> - <date> */
|
||||
assert(node->nod_type == nod_subtract);
|
||||
fb_assert(node->nod_type == nod_subtract);
|
||||
ERRD_post(gds_expression_eval_err, 0);
|
||||
}
|
||||
return;
|
||||
@ -629,14 +629,14 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
|
||||
&& DTYPE_IS_EXACT(desc2.dsc_dtype)) dtype = dtype_int64;
|
||||
else if (DTYPE_IS_NUMERIC(desc1.dsc_dtype)
|
||||
&& DTYPE_IS_NUMERIC(desc2.dsc_dtype)) {
|
||||
assert(DTYPE_IS_APPROX(desc1.dsc_dtype) ||
|
||||
fb_assert(DTYPE_IS_APPROX(desc1.dsc_dtype) ||
|
||||
DTYPE_IS_APPROX(desc2.dsc_dtype));
|
||||
dtype = dtype_double;
|
||||
}
|
||||
else {
|
||||
/* mixed numeric and non-numeric: */
|
||||
|
||||
assert(DTYPE_IS_DATE(dtype1) || DTYPE_IS_DATE(dtype2));
|
||||
fb_assert(DTYPE_IS_DATE(dtype1) || DTYPE_IS_DATE(dtype2));
|
||||
|
||||
/* The MAX(dtype) rule doesn't apply with dtype_int64 */
|
||||
|
||||
@ -687,7 +687,7 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
|
||||
desc->dsc_scale = ISC_TIME_SECONDS_PRECISION_SCALE;
|
||||
}
|
||||
else {
|
||||
assert(dtype == dtype_timestamp);
|
||||
fb_assert(dtype == dtype_timestamp);
|
||||
desc->dsc_dtype = dtype_int64;
|
||||
desc->dsc_length = sizeof(SINT64);
|
||||
desc->dsc_scale = -9;
|
||||
@ -712,13 +712,13 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
|
||||
desc->dsc_dtype = desc1.dsc_dtype;
|
||||
if (!DTYPE_IS_DATE(desc->dsc_dtype))
|
||||
desc->dsc_dtype = desc2.dsc_dtype;
|
||||
assert(DTYPE_IS_DATE(desc->dsc_dtype));
|
||||
fb_assert(DTYPE_IS_DATE(desc->dsc_dtype));
|
||||
desc->dsc_length = type_lengths[desc->dsc_dtype];
|
||||
desc->dsc_scale = 0;
|
||||
}
|
||||
else {
|
||||
/* <non-date> - <date> */
|
||||
assert(node->nod_type == nod_subtract2);
|
||||
fb_assert(node->nod_type == nod_subtract2);
|
||||
ERRD_post(gds_expression_eval_err, 0);
|
||||
}
|
||||
return;
|
||||
@ -744,8 +744,8 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
|
||||
/* The result type is int64 because both operands are
|
||||
exact numeric: hence we don't need the NUMERIC_SCALE
|
||||
macro here. */
|
||||
assert(DTYPE_IS_EXACT(desc1.dsc_dtype));
|
||||
assert(DTYPE_IS_EXACT(desc2.dsc_dtype));
|
||||
fb_assert(DTYPE_IS_EXACT(desc1.dsc_dtype));
|
||||
fb_assert(DTYPE_IS_EXACT(desc2.dsc_dtype));
|
||||
|
||||
desc->dsc_scale = MIN(desc1.dsc_scale, desc2.dsc_scale);
|
||||
node->nod_flags |= NOD_COMP_DIALECT;
|
||||
@ -1056,7 +1056,7 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
|
||||
return;
|
||||
|
||||
default:
|
||||
ASSERT_FAIL; /* unexpected dsql_nod type */
|
||||
fb_assert(false); /* unexpected dsql_nod type */
|
||||
|
||||
case nod_dom_value: /* computed value not used */
|
||||
/* By the time we get here, any nod_dom_value node should have had
|
||||
@ -1064,7 +1064,7 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
|
||||
* to the type of the existing domain to which a CHECK constraint
|
||||
* is being added.
|
||||
*/
|
||||
assert(node->nod_desc.dsc_dtype != dtype_null);
|
||||
fb_assert(node->nod_desc.dsc_dtype != dtype_null);
|
||||
if (desc != &node->nod_desc)
|
||||
*desc = node->nod_desc;
|
||||
return;
|
||||
@ -1447,7 +1447,7 @@ dsql_nod* MAKE_field(DSQL_CTX context, dsql_fld* field, dsql_nod* indices)
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert(!indices);
|
||||
fb_assert(!indices);
|
||||
MAKE_desc_from_field(&node->nod_desc, field);
|
||||
}
|
||||
|
||||
@ -1613,8 +1613,8 @@ dsql_sym* MAKE_symbol(DBB database,
|
||||
{
|
||||
DEV_BLKCHK(database, dsql_type_dbb);
|
||||
DEV_BLKCHK(object, dsql_type_req);
|
||||
assert(name);
|
||||
assert(length > 0);
|
||||
fb_assert(name);
|
||||
fb_assert(length > 0);
|
||||
|
||||
TSQL tdsql = GET_THREAD_DATA;
|
||||
|
||||
|
@ -451,8 +451,8 @@ void METD_get_col_default(DSQL_REQ request,
|
||||
|
||||
/* the default string must be of the form:
|
||||
blr_version4 blr_literal ..... blr_eoc */
|
||||
assert((buffer[0] == blr_version4) || (buffer[0] == blr_version5));
|
||||
assert(buffer[1] == blr_literal);
|
||||
fb_assert((buffer[0] == blr_version4) || (buffer[0] == blr_version5));
|
||||
fb_assert(buffer[1] == blr_literal);
|
||||
|
||||
}
|
||||
else {
|
||||
@ -831,8 +831,8 @@ void METD_get_domain_default(DSQL_REQ request,
|
||||
|
||||
/* the default string must be of the form:
|
||||
blr_version4 blr_literal ..... blr_eoc */
|
||||
assert((buffer[0] == blr_version4) || (buffer[0] == blr_version5));
|
||||
assert(buffer[1] == blr_literal);
|
||||
fb_assert((buffer[0] == blr_version4) || (buffer[0] == blr_version5));
|
||||
fb_assert(buffer[1] == blr_literal);
|
||||
|
||||
}
|
||||
else {
|
||||
@ -1878,7 +1878,7 @@ static void convert_dtype( DSQL_FLD field, SSHORT field_type)
|
||||
field->fld_dtype = gds_cvt_blr_dtype[field_type];
|
||||
field->fld_length = type_lengths[field->fld_dtype];
|
||||
|
||||
assert(field->fld_dtype != dtype_null);
|
||||
fb_assert(field->fld_dtype != dtype_null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5879,7 +5879,7 @@ int LexerState::yylex (
|
||||
* ptr points to the next character.
|
||||
*/
|
||||
|
||||
assert(ptr <= end);
|
||||
fb_assert(ptr <= end);
|
||||
|
||||
if ((tok_class & CHR_DIGIT) ||
|
||||
((c == '.') && (ptr < end) && (classes [*ptr] & CHR_DIGIT)))
|
||||
@ -5962,7 +5962,7 @@ int LexerState::yylex (
|
||||
|
||||
if (!have_error)
|
||||
{
|
||||
assert(have_digit);
|
||||
fb_assert(have_digit);
|
||||
|
||||
if (have_exp_digit)
|
||||
{
|
||||
|
@ -4855,7 +4855,7 @@ int LexerState::yylex (
|
||||
* ptr points to the next character.
|
||||
*/
|
||||
|
||||
assert(ptr <= end);
|
||||
fb_assert(ptr <= end);
|
||||
|
||||
if ((tok_class & CHR_DIGIT) ||
|
||||
((c == '.') && (ptr < end) && (classes [*ptr] & CHR_DIGIT)))
|
||||
@ -4938,7 +4938,7 @@ int LexerState::yylex (
|
||||
|
||||
if (!have_error)
|
||||
{
|
||||
assert(have_digit);
|
||||
fb_assert(have_digit);
|
||||
|
||||
if (have_exp_digit)
|
||||
{
|
||||
|
@ -581,7 +581,7 @@ DSQL_NOD PASS1_node(DSQL_REQ request, DSQL_NOD input, bool proc_flag)
|
||||
gds_arg_gds, gds_extract_input_mismatch, 0);
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
node = MAKE_node(input->nod_type, e_extract_count);
|
||||
@ -2254,7 +2254,7 @@ static bool invalid_reference(DSQL_CTX context, DSQL_NOD node,
|
||||
|
||||
switch (node->nod_type) {
|
||||
default:
|
||||
ASSERT_FAIL;
|
||||
fb_assert(false);
|
||||
/* FALLINTO */
|
||||
|
||||
case nod_map:
|
||||
@ -3047,7 +3047,7 @@ static DSQL_CTX pass1_cursor_context( DSQL_REQ request, DSQL_NOD cursor, DSQL_NO
|
||||
|
||||
// this function must throw an error if no cursor was found
|
||||
DSQL_NOD node = pass1_cursor_name(request, string, true);
|
||||
assert(node);
|
||||
fb_assert(node);
|
||||
|
||||
temp = node->nod_arg[e_cur_rse];
|
||||
if (temp->nod_type == nod_for_select)
|
||||
@ -3978,7 +3978,7 @@ static bool pass1_found_aggregate(DSQL_NOD node, USHORT check_scope_level,
|
||||
return false;
|
||||
|
||||
default:
|
||||
ASSERT_FAIL;
|
||||
fb_assert(false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -4009,7 +4009,7 @@ static bool pass1_found_aggregate(DSQL_NOD node, USHORT check_scope_level,
|
||||
return false;
|
||||
|
||||
default:
|
||||
ASSERT_FAIL;
|
||||
fb_assert(false);
|
||||
}
|
||||
|
||||
return found;
|
||||
@ -4062,7 +4062,7 @@ static bool pass1_found_field(DSQL_NOD node, USHORT check_scope_level,
|
||||
return (field_context->ctx_scope_level >= check_scope_level);
|
||||
|
||||
default:
|
||||
ASSERT_FAIL;
|
||||
fb_assert(false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -4202,7 +4202,7 @@ static bool pass1_found_field(DSQL_NOD node, USHORT check_scope_level,
|
||||
return false;
|
||||
|
||||
default:
|
||||
ASSERT_FAIL;
|
||||
fb_assert(false);
|
||||
}
|
||||
|
||||
return found;
|
||||
@ -4438,7 +4438,7 @@ static DSQL_NOD pass1_join(DSQL_REQ request, DSQL_NOD input, bool proc_flag)
|
||||
break;
|
||||
|
||||
default:
|
||||
ASSERT_FAIL; // join type expected.
|
||||
fb_assert(false); // join type expected.
|
||||
break;
|
||||
}
|
||||
// Process boolean (ON clause).
|
||||
@ -4483,7 +4483,7 @@ static DSQL_NOD pass1_label(DSQL_REQ request, DSQL_NOD input)
|
||||
label = input->nod_arg[e_while_label];
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
}
|
||||
|
||||
// look for a label, if specified
|
||||
@ -4491,7 +4491,7 @@ static DSQL_NOD pass1_label(DSQL_REQ request, DSQL_NOD input)
|
||||
STR string = NULL;
|
||||
|
||||
if (label) {
|
||||
assert(label->nod_type == nod_label);
|
||||
fb_assert(label->nod_type == nod_label);
|
||||
string = (STR) label->nod_arg[e_label_name];
|
||||
TEXT* label_string = (TEXT*) string->str_data;
|
||||
int index = request->req_loop_level;
|
||||
@ -4542,7 +4542,7 @@ static DSQL_NOD pass1_label(DSQL_REQ request, DSQL_NOD input)
|
||||
}
|
||||
}
|
||||
|
||||
assert(number > 0 && number <= request->req_loop_level);
|
||||
fb_assert(number > 0 && number <= request->req_loop_level);
|
||||
|
||||
if (!label) {
|
||||
label = MAKE_node(nod_label, e_label_count);
|
||||
@ -6091,7 +6091,7 @@ static DSQL_NOD pass1_variable( DSQL_REQ request, DSQL_NOD input)
|
||||
|
||||
if (request->req_flags & REQ_procedure) {
|
||||
procedure_node = request->req_ddl_node;
|
||||
assert(procedure_node);
|
||||
fb_assert(procedure_node);
|
||||
if (!(request->req_flags & REQ_trigger)) {
|
||||
// try to resolve variable name against input and output parameters
|
||||
if (var_nodes = procedure_node->nod_arg[e_prc_inputs])
|
||||
@ -6490,7 +6490,7 @@ static void remap_streams_to_parent_context( DSQL_NOD input, DSQL_CTX parent_con
|
||||
break;
|
||||
|
||||
default:
|
||||
ASSERT_FAIL;
|
||||
fb_assert(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -6683,7 +6683,7 @@ static void set_parameters_name( DSQL_NOD list_node, DSQL_NOD rel_node)
|
||||
set_parameter_name((*ptr)->nod_arg[0],
|
||||
(*ptr)->nod_arg[1], relation);
|
||||
else
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6720,7 +6720,7 @@ static void set_parameter_name( DSQL_NOD par_node, DSQL_NOD fld_node,
|
||||
DEV_BLKCHK(relation, dsql_type_dsql_rel);
|
||||
|
||||
/* Could it be something else ??? */
|
||||
assert(fld_node->nod_type == nod_field);
|
||||
fb_assert(fld_node->nod_type == nod_field);
|
||||
|
||||
if (fld_node->nod_desc.dsc_dtype != dtype_array)
|
||||
return;
|
||||
|
@ -1523,7 +1523,7 @@ static void put_acl( STR dyn, UCHAR attribute, SCL class_)
|
||||
return;
|
||||
|
||||
length = GENERATE_acl(class_, (UCHAR*) buffer);
|
||||
assert(length <= 4096); /* to make sure buffer is big enough */
|
||||
fb_assert(length <= 4096); /* to make sure buffer is big enough */
|
||||
|
||||
check_dyn(dyn, 3 + length);
|
||||
STUFF(attribute);
|
||||
|
@ -25,7 +25,7 @@
|
||||
//
|
||||
//____________________________________________________________
|
||||
//
|
||||
// $Id: cmd.cpp,v 1.22 2003-10-29 10:53:07 robocop Exp $
|
||||
// $Id: cmd.cpp,v 1.23 2003-11-03 23:51:47 brodsom Exp $
|
||||
//
|
||||
|
||||
#include "firebird.h"
|
||||
@ -604,7 +604,7 @@ static void create_trg_firing_cond( GPRE_REQ request, const cnstrt* constraint)
|
||||
const lls* prim_key_fld = constraint->cnstrt_referred_fields;
|
||||
const lls* field = prim_key_fld;
|
||||
|
||||
assert(field != NULL);
|
||||
fb_assert(field != NULL);
|
||||
|
||||
USHORT prim_key_num_flds = 0;
|
||||
while (field) {
|
||||
@ -612,7 +612,7 @@ static void create_trg_firing_cond( GPRE_REQ request, const cnstrt* constraint)
|
||||
field = field->lls_next;
|
||||
}
|
||||
|
||||
assert(prim_key_num_flds > 0);
|
||||
fb_assert(prim_key_num_flds > 0);
|
||||
|
||||
// generate blr
|
||||
STUFF(blr_if);
|
||||
@ -654,7 +654,7 @@ static void create_matching_blr(gpre_req* request, const cnstrt* constraint)
|
||||
const lls* prim_key_fld = constraint->cnstrt_referred_fields;
|
||||
const lls* field = prim_key_fld;
|
||||
|
||||
assert(field != NULL);
|
||||
fb_assert(field != NULL);
|
||||
|
||||
USHORT prim_key_num_flds = 0;
|
||||
while (field) {
|
||||
@ -662,13 +662,13 @@ static void create_matching_blr(gpre_req* request, const cnstrt* constraint)
|
||||
field = field->lls_next;
|
||||
}
|
||||
|
||||
assert(prim_key_num_flds > 0);
|
||||
fb_assert(prim_key_num_flds > 0);
|
||||
|
||||
// count of foreign key columns
|
||||
const lls* for_key_fld = constraint->cnstrt_fields;
|
||||
field = for_key_fld;
|
||||
|
||||
assert(field != NULL);
|
||||
fb_assert(field != NULL);
|
||||
|
||||
USHORT for_key_num_flds = 0;
|
||||
while (field) {
|
||||
@ -676,8 +676,8 @@ static void create_matching_blr(gpre_req* request, const cnstrt* constraint)
|
||||
field = field->lls_next;
|
||||
}
|
||||
|
||||
assert(for_key_num_flds > 0);
|
||||
assert(prim_key_num_flds == for_key_num_flds);
|
||||
fb_assert(for_key_num_flds > 0);
|
||||
fb_assert(prim_key_num_flds == for_key_num_flds);
|
||||
|
||||
STUFF(blr_boolean);
|
||||
if (prim_key_num_flds > 1)
|
||||
@ -726,12 +726,12 @@ static void create_default_blr(
|
||||
{
|
||||
int i;
|
||||
|
||||
assert(*default_buff == blr_version4 || *default_buff == blr_version5);
|
||||
fb_assert(*default_buff == blr_version4 || *default_buff == blr_version5);
|
||||
|
||||
for (i = 1; ((i < buff_size) && (default_buff[i] != blr_eoc)); i++)
|
||||
STUFF(default_buff[i]);
|
||||
|
||||
assert(default_buff[i] == blr_eoc);
|
||||
fb_assert(default_buff[i] == blr_eoc);
|
||||
|
||||
}
|
||||
|
||||
@ -906,7 +906,7 @@ static void create_set_default_trg(GPRE_REQ request,
|
||||
TEXT s[512];
|
||||
TEXT default_val[BLOB_BUFFER_SIZE];
|
||||
|
||||
assert(request->req_actions->act_type == ACT_create_table ||
|
||||
fb_assert(request->req_actions->act_type == ACT_create_table ||
|
||||
request->req_actions->act_type == ACT_alter_table);
|
||||
|
||||
lls* for_key_fld = constraint->cnstrt_fields;
|
||||
@ -1072,7 +1072,7 @@ static void create_set_default_trg(GPRE_REQ request,
|
||||
|
||||
if (search_for_default && search_for_domain != NULL) {
|
||||
/* search for domain level default */
|
||||
assert(search_for_column == false);
|
||||
fb_assert(search_for_column == false);
|
||||
/* search for domain in memory */
|
||||
for (req = requests; req; req = req->req_next) {
|
||||
if ((req->req_type == REQ_ddl) &&
|
||||
@ -1115,7 +1115,7 @@ static void create_set_default_trg(GPRE_REQ request,
|
||||
|
||||
if (search_for_default && search_for_column) {
|
||||
/* nothing is found in memory, try to check db system tables */
|
||||
assert(search_for_domain == NULL);
|
||||
fb_assert(search_for_domain == NULL);
|
||||
if (MET_get_column_default(relation, for_key_fld_name->str_string,
|
||||
default_val,
|
||||
sizeof(default_val)) != FALSE)
|
||||
@ -1392,7 +1392,7 @@ static void create_constraint( GPRE_REQ request, const act* action,
|
||||
break;
|
||||
default:
|
||||
/* just in case */
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
STUFF(gds_dyn_foreign_key_none);
|
||||
break;
|
||||
}
|
||||
@ -1417,7 +1417,7 @@ static void create_constraint( GPRE_REQ request, const act* action,
|
||||
break;
|
||||
default:
|
||||
/* just in case */
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
STUFF(gds_dyn_foreign_key_none);
|
||||
break;
|
||||
}
|
||||
@ -2562,7 +2562,7 @@ static void put_dtype( GPRE_REQ request, const gpre_fld* field)
|
||||
/* Fall into */
|
||||
|
||||
case dtype_varying:
|
||||
assert(length);
|
||||
fb_assert(length);
|
||||
if (field->fld_dtype == dtype_varying)
|
||||
dtype = blr_varying;
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
//
|
||||
//____________________________________________________________
|
||||
//
|
||||
// $Id: cme.cpp,v 1.16 2003-10-29 10:53:07 robocop Exp $
|
||||
// $Id: cme.cpp,v 1.17 2003-11-03 23:51:47 brodsom Exp $
|
||||
//
|
||||
|
||||
#include "firebird.h"
|
||||
@ -1848,7 +1848,7 @@ static GPRE_NOD cmp_value( GPRE_NOD node, GPRE_REQ request)
|
||||
|
||||
static USHORT get_string_len( GPRE_FLD field)
|
||||
{
|
||||
assert(field->fld_dtype <= MAX_UCHAR);
|
||||
fb_assert(field->fld_dtype <= MAX_UCHAR);
|
||||
|
||||
dsc tmp_dsc;
|
||||
tmp_dsc.dsc_dtype = (UCHAR) field->fld_dtype;
|
||||
|
@ -25,7 +25,7 @@
|
||||
//
|
||||
//____________________________________________________________
|
||||
//
|
||||
// $Id: cmp.cpp,v 1.22 2003-10-15 01:18:01 brodsom Exp $
|
||||
// $Id: cmp.cpp,v 1.23 2003-11-03 23:51:47 brodsom Exp $
|
||||
//
|
||||
|
||||
#include "firebird.h"
|
||||
@ -742,9 +742,9 @@ static void cmp_field( GPRE_REQ request, GPRE_FLD field, REF reference)
|
||||
if (reference && reference->ref_value
|
||||
&& (reference->ref_flags & REF_array_elem)) field = field->fld_array;
|
||||
|
||||
assert(field != NULL);
|
||||
assert(field->fld_dtype);
|
||||
assert(field->fld_length);
|
||||
fb_assert(field != NULL);
|
||||
fb_assert(field->fld_dtype);
|
||||
fb_assert(field->fld_length);
|
||||
|
||||
switch (field->fld_dtype) {
|
||||
case dtype_cstring:
|
||||
|
@ -20,7 +20,7 @@
|
||||
//
|
||||
// All Rights Reserved.
|
||||
// Contributor(s): ______________________________________.
|
||||
// $Id: gpre.cpp,v 1.43 2003-10-29 10:53:07 robocop Exp $
|
||||
// $Id: gpre.cpp,v 1.44 2003-11-03 23:51:47 brodsom Exp $
|
||||
// Revision 1.2 2000/11/16 15:54:29 fsg
|
||||
// Added new switch -verbose to gpre that will dump
|
||||
// parsed lines to stderr
|
||||
@ -2243,7 +2243,7 @@ static TOK get_token()
|
||||
|
||||
// for FORTRAN, make note of the first token in a statement
|
||||
|
||||
assert(first_position <= MAX_USHORT);
|
||||
fb_assert(first_position <= MAX_USHORT);
|
||||
token.tok_first = (USHORT) first_position;
|
||||
first_position = FALSE;
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
*
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
* $Id: gpre.h,v 1.52 2003-10-29 10:53:07 robocop Exp $
|
||||
* $Id: gpre.h,v 1.53 2003-11-03 23:51:47 brodsom Exp $
|
||||
* Revision 1.3 2000/11/27 09:26:13 fsg
|
||||
* Fixed bugs in gpre to handle PYXIS forms
|
||||
* and allow edit.e and fred.e to go through
|
||||
@ -1489,20 +1489,20 @@ EXTERN USHORT ada_flags;
|
||||
|
||||
#undef EXTERN
|
||||
|
||||
#ifndef assert
|
||||
#ifndef fb_assert
|
||||
#ifdef DEV_BUILD
|
||||
#define _assert(ex) {if (!(ex)){CPR_assert (__FILE__, __LINE__);}}
|
||||
#define assert(ex) _assert(ex)
|
||||
#else
|
||||
#define _assert(ex)
|
||||
#define assert(ex)
|
||||
#endif
|
||||
#endif
|
||||
#undef fb_assert
|
||||
#define fb_assert(ex) {if (!(ex)){CPR_assert (__FILE__, __LINE__);}}
|
||||
#else // DEV_BUILD
|
||||
#undef fb_assert
|
||||
#define fb_assert(ex)
|
||||
#endif // DEV_BUILD
|
||||
#endif // fb_assert
|
||||
|
||||
#define assert_IS_REQ(x) assert(!(x) || ((x)->req_type >= 0 && (x)->req_type < REQ_LASTREQUEST))
|
||||
#define assert_IS_SYM(x) assert(!(x) || ((x)->sym_type >= 0 && (x)->sym_type < SYM_LASTSYM))
|
||||
#define assert_IS_NOD(x) assert(!(x) || ((x)->nod_type >= 1 && (x)->nod_type < nod_LASTNOD))
|
||||
#define assert_IS_ACT(x) assert(!(x) || ((x)->act_type >= 0 && (x)->act_type < ACT_LASTACT))
|
||||
#define assert_IS_REQ(x) fb_assert(!(x) || ((x)->req_type >= 0 && (x)->req_type < REQ_LASTREQUEST))
|
||||
#define assert_IS_SYM(x) fb_assert(!(x) || ((x)->sym_type >= 0 && (x)->sym_type < SYM_LASTSYM))
|
||||
#define assert_IS_NOD(x) fb_assert(!(x) || ((x)->nod_type >= 1 && (x)->nod_type < nod_LASTNOD))
|
||||
#define assert_IS_ACT(x) fb_assert(!(x) || ((x)->act_type >= 0 && (x)->act_type < ACT_LASTACT))
|
||||
|
||||
#endif /* GPRE_GPRE_H */
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
*
|
||||
*____________________________________________________________
|
||||
*
|
||||
* $Id: gpre_meta.epp,v 1.31 2003-10-29 10:53:07 robocop Exp $
|
||||
* $Id: gpre_meta.epp,v 1.32 2003-11-03 23:51:47 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -43,7 +43,6 @@
|
||||
#include "../gpre/msc_proto.h"
|
||||
#include "../gpre/par_proto.h"
|
||||
#include "../jrd/constants.h"
|
||||
#include "../jrd/gdsassert.h"
|
||||
|
||||
|
||||
const int MAX_USER_LENGTH = 33;
|
||||
@ -469,7 +468,7 @@ bool MET_get_domain_default(dbb* database,
|
||||
if ((database->dbb_handle == NULL) && !MET_database(database, false))
|
||||
CPR_exit(FINI_ERROR);
|
||||
|
||||
assert(database->dbb_transaction == NULL);
|
||||
fb_assert(database->dbb_transaction == NULL);
|
||||
FRBRD* gds_trans = NULL;
|
||||
|
||||
FRBRD* DB = database->dbb_handle; // Overrides global DB
|
||||
@ -517,8 +516,8 @@ bool MET_get_domain_default(dbb* database,
|
||||
blr_version4 blr_literal ..... blr_eoc OR
|
||||
blr_version4 blr_null blr_eoc OR
|
||||
blr_version4 blr_user_name blr_eoc */
|
||||
assert(buffer[0] == blr_version4 || buffer[0] == blr_version5);
|
||||
assert(buffer[1] == blr_literal ||
|
||||
fb_assert(buffer[0] == blr_version4 || buffer[0] == blr_version5);
|
||||
fb_assert(buffer[1] == blr_literal ||
|
||||
buffer[1] == blr_null || buffer[1] == blr_user_name);
|
||||
|
||||
has_default = true;
|
||||
@ -566,7 +565,7 @@ bool MET_get_column_default(const gpre_rel* relation,
|
||||
if ((database->dbb_handle == NULL) && !MET_database(database, false))
|
||||
CPR_exit(FINI_ERROR);
|
||||
|
||||
assert(database->dbb_transaction == NULL);
|
||||
fb_assert(database->dbb_transaction == NULL);
|
||||
FRBRD* gds_trans = NULL;
|
||||
|
||||
FRBRD* DB = database->dbb_handle; // Overrides global DB
|
||||
@ -626,8 +625,8 @@ bool MET_get_column_default(const gpre_rel* relation,
|
||||
blr_version4 blr_null blr_eoc OR
|
||||
blr_version4 blr_user_name blr_eoc */
|
||||
|
||||
assert(buffer[0] == blr_version4 || buffer[0] == blr_version5);
|
||||
assert(buffer[1] == blr_literal ||
|
||||
fb_assert(buffer[0] == blr_version4 || buffer[0] == blr_version5);
|
||||
fb_assert(buffer[1] == blr_literal ||
|
||||
buffer[1] == blr_null || buffer[1] == blr_user_name);
|
||||
}
|
||||
else {
|
||||
@ -663,7 +662,7 @@ LLS MET_get_primary_key(dbb* database, const TEXT* relation_name)
|
||||
if ((database->dbb_handle == NULL) && !MET_database(database, false))
|
||||
CPR_exit(FINI_ERROR);
|
||||
|
||||
assert(database->dbb_transaction == NULL);
|
||||
fb_assert(database->dbb_transaction == NULL);
|
||||
FRBRD* gds_trans = NULL;
|
||||
|
||||
FRBRD* DB = database->dbb_handle; // Overrides global DB
|
||||
@ -2047,9 +2046,9 @@ static bool get_intl_char_subtype(
|
||||
{
|
||||
UCHAR buffer[32]; /* BASED ON RDB$COLLATION_NAME */
|
||||
|
||||
assert(id != NULL);
|
||||
assert(name != NULL);
|
||||
assert(database != NULL);
|
||||
fb_assert(id != NULL);
|
||||
fb_assert(name != NULL);
|
||||
fb_assert(database != NULL);
|
||||
|
||||
|
||||
DB = database->dbb_handle;
|
||||
@ -2123,7 +2122,7 @@ static bool resolve_charset_and_collation(
|
||||
const UCHAR* charset,
|
||||
const UCHAR* collation)
|
||||
{
|
||||
assert(id != NULL);
|
||||
fb_assert(id != NULL);
|
||||
|
||||
if (!DB)
|
||||
return false;
|
||||
|
@ -26,7 +26,7 @@
|
||||
*
|
||||
*____________________________________________________________
|
||||
*
|
||||
* $Id: gpre_meta_boot.cpp,v 1.31 2003-10-29 10:53:07 robocop Exp $
|
||||
* $Id: gpre_meta_boot.cpp,v 1.32 2003-11-03 23:51:47 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -134,7 +134,7 @@ bool MET_database(DBB db,
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ bool MET_domain_lookup(GPRE_REQ request,
|
||||
if (!request)
|
||||
return false;
|
||||
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ bool MET_get_domain_default(DBB db,
|
||||
TEXT* buffer,
|
||||
USHORT buff_length)
|
||||
{
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ bool MET_get_column_default(const gpre_rel* relation,
|
||||
TEXT* buffer,
|
||||
USHORT buff_length)
|
||||
{
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -240,8 +240,8 @@ LLS MET_get_primary_key(DBB db, const TEXT* relation_name)
|
||||
if ((db->dbb_handle == NULL) && !MET_database(db, FALSE))
|
||||
CPR_exit(FINI_ERROR);
|
||||
|
||||
assert(db->dbb_transaction == NULL);
|
||||
assert(0);
|
||||
fb_assert(db->dbb_transaction == NULL);
|
||||
fb_assert(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -279,7 +279,7 @@ GPRE_FLD MET_field(GPRE_REL relation, const char* string)
|
||||
|
||||
if (sw_language == lang_internal)
|
||||
return NULL;
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -331,7 +331,7 @@ GPRE_NOD MET_fields(GPRE_CTX context)
|
||||
|
||||
if (sw_language == lang_internal)
|
||||
return NULL;
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -491,7 +491,7 @@ GPRE_PRC MET_get_procedure(DBB db, const TEXT* string, const TEXT* owner_name)
|
||||
if (procedure->prc_flags & PRC_scanned)
|
||||
return procedure;
|
||||
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -564,7 +564,7 @@ UDF MET_get_udf(DBB db, const TEXT* string)
|
||||
if (!udf_val)
|
||||
return NULL;
|
||||
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -580,7 +580,7 @@ GPRE_REL MET_get_view_relation(GPRE_REQ request,
|
||||
const char* view_name,
|
||||
const char* relation_or_alias, USHORT level)
|
||||
{
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -609,7 +609,7 @@ IND MET_index(DBB db, const TEXT* string)
|
||||
|
||||
if (sw_language == lang_internal)
|
||||
return NULL;
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -629,7 +629,7 @@ void MET_load_hash_table( DBB db)
|
||||
|
||||
if (sw_language == lang_internal)
|
||||
return;
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -706,7 +706,7 @@ bool MET_type(GPRE_FLD field,
|
||||
return true;
|
||||
}
|
||||
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -726,7 +726,7 @@ bool MET_trigger_exists(DBB db,
|
||||
|
||||
//strcpy(name, trigger_name);
|
||||
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -758,7 +758,7 @@ static SLONG array_size( GPRE_FLD field)
|
||||
|
||||
static void get_array( DBB db, const TEXT* field_name, GPRE_FLD field)
|
||||
{
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -786,11 +786,11 @@ static bool get_intl_char_subtype(SSHORT* id,
|
||||
USHORT length,
|
||||
DBB db)
|
||||
{
|
||||
assert(id != NULL);
|
||||
assert(name != NULL);
|
||||
assert(db != NULL);
|
||||
fb_assert(id != NULL);
|
||||
fb_assert(name != NULL);
|
||||
fb_assert(db != NULL);
|
||||
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -826,9 +826,9 @@ static bool resolve_charset_and_collation(
|
||||
SSHORT* id,
|
||||
const UCHAR* charset, const UCHAR* collation)
|
||||
{
|
||||
assert(id != NULL);
|
||||
fb_assert(id != NULL);
|
||||
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
return (false);
|
||||
}
|
||||
|
||||
@ -887,7 +887,7 @@ extern "C" {
|
||||
|
||||
void CVT_move (const dsc* a, dsc* b, FPTR_VOID c)
|
||||
{
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
/* Not available in boot_gpre */
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
//
|
||||
// All Rights Reserved.
|
||||
// Contributor(s): ______________________________________.
|
||||
// $Id: par.cpp,v 1.37 2003-10-29 10:53:07 robocop Exp $
|
||||
// $Id: par.cpp,v 1.38 2003-11-03 23:51:47 brodsom Exp $
|
||||
// Revision 1.2 2000/11/27 09:26:13 fsg
|
||||
// Fixed bugs in gpre to handle PYXIS forms
|
||||
// and allow edit.e and fred.e to go through
|
||||
@ -1012,8 +1012,8 @@ void PAR_reserving( USHORT flags, bool parse_sql)
|
||||
{
|
||||
if (!lock_block->rrl_lock_level)
|
||||
{
|
||||
assert(lock_level <= MAX_UCHAR);
|
||||
assert(lock_mode <= MAX_UCHAR);
|
||||
fb_assert(lock_level <= MAX_UCHAR);
|
||||
fb_assert(lock_mode <= MAX_UCHAR);
|
||||
lock_block->rrl_lock_level = (UCHAR) lock_level;
|
||||
lock_block->rrl_lock_mode = (UCHAR) lock_mode;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
//
|
||||
//____________________________________________________________
|
||||
//
|
||||
// $Id: sql.cpp,v 1.32 2003-10-28 13:39:32 brodsom Exp $
|
||||
// $Id: sql.cpp,v 1.33 2003-11-03 23:51:47 brodsom Exp $
|
||||
//
|
||||
|
||||
#include "firebird.h"
|
||||
@ -2489,7 +2489,7 @@ static ACT act_declare_udf(void)
|
||||
return_parameter = EXP_pos_USHORT_ordinal(true);
|
||||
if (return_parameter > 10)
|
||||
PAR_error("return parameter not in range");
|
||||
assert(return_parameter <= MAX_SSHORT);
|
||||
fb_assert(return_parameter <= MAX_SSHORT);
|
||||
udf_declaration->decl_udf_return_parameter = (SSHORT) return_parameter;
|
||||
}
|
||||
else {
|
||||
@ -5696,8 +5696,8 @@ static void par_fkey_extension(cnstrt* cnstrt_val)
|
||||
// [ON UPDATE { NO ACTION | CASCADE | SET DEFAULT | SET NULL } ]
|
||||
//
|
||||
|
||||
assert(token.tok_keyword == KW_ON);
|
||||
assert(cnstrt_val != NULL);
|
||||
fb_assert(token.tok_keyword == KW_ON);
|
||||
fb_assert(cnstrt_val != NULL);
|
||||
|
||||
PAR_get_token();
|
||||
|
||||
|
@ -41,13 +41,13 @@ USHORT CVBIG5_big5_to_unicode(CSCONVERT obj,
|
||||
USHORT this_len;
|
||||
UCHAR c1, c2;
|
||||
|
||||
assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CVBIG5_big5_to_unicode);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CVBIG5_big5_to_unicode);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -120,13 +120,13 @@ USHORT CVBIG5_unicode_to_big5(CSCONVERT obj,
|
||||
int tmp1, tmp2;
|
||||
USHORT src_start = unicode_len;
|
||||
|
||||
assert(unicode_str != NULL || big5_str == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CVBIG5_unicode_to_big5);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(unicode_str != NULL || big5_str == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CVBIG5_unicode_to_big5);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -161,8 +161,8 @@ USHORT CVBIG5_unicode_to_big5(CSCONVERT obj,
|
||||
break;
|
||||
}
|
||||
else {
|
||||
assert(BIG51(tmp1));
|
||||
assert(BIG52(tmp2));
|
||||
fb_assert(BIG51(tmp1));
|
||||
fb_assert(BIG52(tmp2));
|
||||
*big5_str++ = tmp1;
|
||||
*big5_str++ = tmp2;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
@ -230,10 +230,10 @@ USHORT CVBIG5_big5_byte2short(CSCONVERT obj,
|
||||
UCHAR *dst_start;
|
||||
USHORT src_start = src_len;
|
||||
|
||||
assert(src != NULL || dst == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(src != NULL || dst == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
/* Length estimate needed? */
|
||||
@ -276,8 +276,8 @@ SSHORT CVBIG5_big5_mbtowc(CSCONVERT obj,
|
||||
* Grab a single character from a mb stream.
|
||||
*
|
||||
**************************************/
|
||||
assert(src != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(src != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
if (!src_len)
|
||||
return -1;
|
||||
|
@ -41,13 +41,13 @@ USHORT CVGB_gb2312_to_unicode(CSCONVERT obj,
|
||||
USHORT this_len;
|
||||
UCHAR c1, c2;
|
||||
|
||||
assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CVGB_gb2312_to_unicode);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CVGB_gb2312_to_unicode);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -120,13 +120,13 @@ USHORT CVGB_unicode_to_gb2312(CSCONVERT obj,
|
||||
int tmp1, tmp2;
|
||||
USHORT src_start = unicode_len;
|
||||
|
||||
assert(unicode_str != NULL || gb_str == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CVGB_unicode_to_gb2312);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(unicode_str != NULL || gb_str == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CVGB_unicode_to_gb2312);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -161,8 +161,8 @@ USHORT CVGB_unicode_to_gb2312(CSCONVERT obj,
|
||||
break;
|
||||
}
|
||||
else {
|
||||
assert(GB1(tmp1));
|
||||
assert(GB2(tmp2));
|
||||
fb_assert(GB1(tmp1));
|
||||
fb_assert(GB2(tmp2));
|
||||
*gb_str++ = tmp1;
|
||||
*gb_str++ = tmp2;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
@ -230,10 +230,10 @@ USHORT CVGB_gb2312_byte2short(CSCONVERT obj,
|
||||
UCHAR *dst_start;
|
||||
USHORT src_start = src_len;
|
||||
|
||||
assert(src != NULL || dst == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(src != NULL || dst == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
/* Length estimate needed? */
|
||||
@ -276,8 +276,8 @@ SSHORT CVGB_gb2312_mbtowc(CSCONVERT obj,
|
||||
* Grab a single character from a mb stream.
|
||||
*
|
||||
**************************************/
|
||||
assert(src != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(src != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
if (!src_len)
|
||||
return -1;
|
||||
|
@ -44,13 +44,13 @@ USHORT CVJIS_eucj_to_unicode(CSCONVERT obj,
|
||||
USHORT src_start = src_len;
|
||||
USHORT this_len;
|
||||
|
||||
assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CVJIS_eucj_to_unicode);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CVJIS_eucj_to_unicode);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -137,13 +137,13 @@ USHORT CVJIS_sjis_to_unicode(CSCONVERT obj,
|
||||
USHORT this_len;
|
||||
USHORT table;
|
||||
|
||||
assert(sjis_str != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CVJIS_sjis_to_unicode);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(sjis_str != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CVJIS_sjis_to_unicode);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -200,8 +200,8 @@ USHORT CVJIS_sjis_to_unicode(CSCONVERT obj,
|
||||
[(USHORT)wide / 256]
|
||||
+ (wide % 256)];
|
||||
else {
|
||||
assert(table == 2);
|
||||
assert(wide <= 255);
|
||||
fb_assert(table == 2);
|
||||
fb_assert(wide <= 255);
|
||||
ch = sjis_to_unicode_mapping_array
|
||||
[sjis_to_unicode_map[(USHORT) wide / 256] + (wide % 256)];
|
||||
};
|
||||
@ -392,13 +392,13 @@ USHORT CVJIS_unicode_to_sjis(CSCONVERT obj,
|
||||
USHORT tmp1, tmp2;
|
||||
USHORT src_start = unicode_len;
|
||||
|
||||
assert(unicode_str != NULL || sjis_str == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CVJIS_unicode_to_sjis);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(unicode_str != NULL || sjis_str == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CVJIS_unicode_to_sjis);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -438,7 +438,7 @@ USHORT CVJIS_unicode_to_sjis(CSCONVERT obj,
|
||||
};
|
||||
seven2eight(&tmp1, &tmp2);
|
||||
if (tmp1 == 0) { /* half-width kana ? */
|
||||
assert(SJIS_SINGLE(tmp2));
|
||||
fb_assert(SJIS_SINGLE(tmp2));
|
||||
*sjis_str++ = tmp2;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
sjis_len--;
|
||||
@ -448,8 +448,8 @@ USHORT CVJIS_unicode_to_sjis(CSCONVERT obj,
|
||||
break;
|
||||
}
|
||||
else {
|
||||
assert(SJIS1(tmp1));
|
||||
assert(SJIS2(tmp2));
|
||||
fb_assert(SJIS1(tmp1));
|
||||
fb_assert(SJIS2(tmp2));
|
||||
*sjis_str++ = tmp1;
|
||||
*sjis_str++ = tmp2;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
@ -473,13 +473,13 @@ USHORT CVJIS_unicode_to_eucj(CSCONVERT obj, UCHAR *eucj_str, USHORT eucj_len, UC
|
||||
USHORT tmp1, tmp2;
|
||||
USHORT src_start = unicode_len;
|
||||
|
||||
assert(unicode_str != NULL || eucj_str == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CVJIS_unicode_to_eucj);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(unicode_str != NULL || eucj_str == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CVJIS_unicode_to_eucj);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -509,7 +509,7 @@ USHORT CVJIS_unicode_to_eucj(CSCONVERT obj, UCHAR *eucj_str, USHORT eucj_len, UC
|
||||
tmp1 = jis_ch / 256;
|
||||
tmp2 = jis_ch % 256;
|
||||
if (tmp1 == 0) { /* ASCII character */
|
||||
assert(!(tmp2 & 0x80));
|
||||
fb_assert(!(tmp2 & 0x80));
|
||||
*eucj_str++ = tmp2;
|
||||
eucj_len--;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
@ -520,8 +520,8 @@ USHORT CVJIS_unicode_to_eucj(CSCONVERT obj, UCHAR *eucj_str, USHORT eucj_len, UC
|
||||
break;
|
||||
}
|
||||
else {
|
||||
assert(!(tmp1 & 0x80));
|
||||
assert(!(tmp2 & 0x80));
|
||||
fb_assert(!(tmp1 & 0x80));
|
||||
fb_assert(!(tmp2 & 0x80));
|
||||
*eucj_str++ = tmp1 | 0x80;
|
||||
*eucj_str++ = tmp2 | 0x80;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
@ -634,10 +634,10 @@ static USHORT CVJIS_euc2sjis(CSCONVERT obj, UCHAR *sjis_str, USHORT sjis_len, UC
|
||||
UCHAR *sjis_start;
|
||||
USHORT src_start = euc_len;
|
||||
|
||||
assert(euc_str != NULL || sjis_str == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(euc_str != NULL || sjis_str == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -727,10 +727,10 @@ USHORT CVJIS_euc_byte2short(CSCONVERT obj, UCHAR *dst, USHORT dst_len, UCHAR *sr
|
||||
UCHAR *dst_start;
|
||||
USHORT src_start = src_len;
|
||||
|
||||
assert(src != NULL || dst == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(src != NULL || dst == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
/* Length estimate needed? */
|
||||
@ -775,8 +775,8 @@ SSHORT CVJIS_euc_mbtowc(CSCONVERT obj, UCS2_CHAR *wc, UCHAR *src, USHORT src_len
|
||||
* Grab a single character from a mb stream.
|
||||
*
|
||||
**************************************/
|
||||
assert(src != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(src != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
if (!src_len)
|
||||
return -1;
|
||||
@ -814,10 +814,10 @@ static USHORT CVJIS_sjis2euc(CSCONVERT obj, UCHAR *euc_str, USHORT euc_len, UCHA
|
||||
UCHAR *euc_start;
|
||||
USHORT src_start = sjis_len;
|
||||
|
||||
assert(sjis_str != NULL || euc_str == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(sjis_str != NULL || euc_str == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (euc_str == NULL)
|
||||
@ -901,10 +901,10 @@ USHORT CVJIS_sjis_byte2short(CSCONVERT obj, UCHAR *dst, USHORT dst_len, UCHAR *s
|
||||
UCHAR *dst_start;
|
||||
USHORT src_start = src_len;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert(src != NULL || dst == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(src != NULL || dst == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (dst == NULL)
|
||||
@ -950,8 +950,8 @@ SSHORT CVJIS_sjis_mbtowc(CSCONVERT obj, UCS2_CHAR *wc, UCHAR *src, USHORT src_le
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(src != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(src != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
if (!src_len)
|
||||
return -1;
|
||||
|
@ -47,13 +47,13 @@ USHORT CVKSC_ksc_to_unicode(CSCONVERT obj,
|
||||
USHORT src_start = ksc_len;
|
||||
USHORT this_len;
|
||||
|
||||
assert(ksc_str != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CVKSC_ksc_to_unicode);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(ksc_str != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CVKSC_ksc_to_unicode);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -123,13 +123,13 @@ USHORT CVKSC_unicode_to_ksc(CSCONVERT obj,
|
||||
int tmp1, tmp2;
|
||||
USHORT src_start = unicode_len;
|
||||
|
||||
assert(unicode_str != NULL || ksc_str == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CVKSC_unicode_to_ksc);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(unicode_str != NULL || ksc_str == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CVKSC_unicode_to_ksc);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -160,8 +160,8 @@ USHORT CVKSC_unicode_to_ksc(CSCONVERT obj,
|
||||
break;
|
||||
}
|
||||
else {
|
||||
assert(KSC1(tmp1));
|
||||
assert(KSC2(tmp2));
|
||||
fb_assert(KSC1(tmp1));
|
||||
fb_assert(KSC2(tmp2));
|
||||
*ksc_str++ = tmp1;
|
||||
*ksc_str++ = tmp2;
|
||||
unicode_len -= sizeof(*unicode_str);
|
||||
@ -212,10 +212,10 @@ USHORT CVKSC_ksc_byte2short(CSCONVERT obj,
|
||||
USHORT *dst_start;
|
||||
USHORT src_start = src_len;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert(src != NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(src != NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
|
||||
#ifdef DEBUG
|
||||
ib_printf("dst_len = %d, src_len = %d\n src = %s\n", dst_len, src_len,
|
||||
@ -269,8 +269,8 @@ short CVKSC_ksc_mbtowc(CSCONVERT obj,
|
||||
UCHAR *src,
|
||||
USHORT src_len)
|
||||
{
|
||||
assert(src != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(src != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
if (!src_len)
|
||||
return -1;
|
||||
|
@ -57,13 +57,13 @@ USHORT CV_unicode_to_nc(CSCONVERT obj,
|
||||
UCHAR ch;
|
||||
UNICODE uni;
|
||||
|
||||
assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CV_unicode_to_nc);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CV_unicode_to_nc);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -111,13 +111,13 @@ USHORT CV_wc_to_wc(CSCONVERT obj,
|
||||
UNICODE uni;
|
||||
USHORT src_start = src_len;
|
||||
|
||||
assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CV_wc_to_wc);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(obj->csconvert_misc != NULL);
|
||||
fb_assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CV_wc_to_wc);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(obj->csconvert_misc != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -165,13 +165,13 @@ USHORT CV_nc_to_unicode(CSCONVERT obj,
|
||||
UNICODE ch;
|
||||
USHORT src_start = src_len;
|
||||
|
||||
assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CV_nc_to_unicode);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
assert(sizeof(UNICODE) == 2);
|
||||
fb_assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CV_nc_to_unicode);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(sizeof(UNICODE) == 2);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -211,11 +211,11 @@ USHORT CV_wc_copy(CSCONVERT obj,
|
||||
BYTE *start;
|
||||
USHORT src_start = src_len;
|
||||
|
||||
assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CV_wc_copy);
|
||||
fb_assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CV_wc_copy);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -253,12 +253,12 @@ USHORT eight_bit_convert(CSCONVERT obj,
|
||||
UCHAR ch;
|
||||
USHORT src_start = src_len;
|
||||
|
||||
assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) eight_bit_convert);
|
||||
assert(obj->csconvert_datatable != NULL);
|
||||
fb_assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) eight_bit_convert);
|
||||
fb_assert(obj->csconvert_datatable != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
|
@ -54,9 +54,9 @@ SSHORT CS_UTFFSS_fss_mbtowc(TEXTTYPE *obj, UCS2_CHAR *wc, NCHAR *p, USHORT n)
|
||||
* Note: This routine has a cousin in jrd/intl.c
|
||||
*
|
||||
**************************************/
|
||||
assert(obj);
|
||||
assert(wc);
|
||||
assert(p);
|
||||
fb_assert(obj);
|
||||
fb_assert(wc);
|
||||
fb_assert(p);
|
||||
|
||||
return fss_mbtowc(wc, p, n);
|
||||
}
|
||||
@ -263,11 +263,11 @@ USHORT CS_UTFFSS_fss_to_unicode(CSCONVERT obj,
|
||||
USHORT src_start = src_len;
|
||||
fss_size_t res;
|
||||
|
||||
assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CS_UTFFSS_fss_to_unicode ||
|
||||
fb_assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CS_UTFFSS_fss_to_unicode ||
|
||||
((TEXTTYPE) obj)->texttype_fn_to_wc == (FPTR_SHORT) CS_UTFFSS_fss_to_unicode);
|
||||
|
||||
*err_code = 0;
|
||||
@ -284,7 +284,7 @@ USHORT CS_UTFFSS_fss_to_unicode(CSCONVERT obj,
|
||||
*err_code = CS_BAD_INPUT;
|
||||
break;
|
||||
}
|
||||
assert(res <= src_len);
|
||||
fb_assert(res <= src_len);
|
||||
dest_ptr++;
|
||||
dest_len -= sizeof(*dest_ptr);
|
||||
src_ptr += res;
|
||||
@ -312,11 +312,11 @@ USHORT CS_UTFFSS_unicode_to_fss(CSCONVERT obj,
|
||||
MBCHAR *p;
|
||||
fss_size_t res;
|
||||
|
||||
assert(unicode_str != NULL || fss_str == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) CS_UTFFSS_unicode_to_fss);
|
||||
fb_assert(unicode_str != NULL || fss_str == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) CS_UTFFSS_unicode_to_fss);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
|
@ -537,7 +537,7 @@ static __inline UCHAR CP1251_LOWER(UCHAR ch)
|
||||
*/
|
||||
USHORT famasc_key_length(TEXTTYPE obj, USHORT inLen)
|
||||
{
|
||||
/* assert (inLen <= LANGASCII_MAX_KEY); - possible upper logic error if true */
|
||||
/* fb_assert (inLen <= LANGASCII_MAX_KEY); - possible upper logic error if true */
|
||||
return (MIN(inLen, LANGASCII_MAX_KEY));
|
||||
}
|
||||
|
||||
@ -558,11 +558,11 @@ USHORT famasc_string_to_key(TEXTTYPE obj, USHORT iInLen, BYTE *pInChar, USHORT i
|
||||
BYTE *outbuff;
|
||||
BYTE *inbuff;
|
||||
|
||||
assert(pOutChar != NULL);
|
||||
assert(pInChar != NULL);
|
||||
assert(iInLen <= LANGASCII_MAX_KEY);
|
||||
assert(iOutLen <= LANGASCII_MAX_KEY);
|
||||
assert(iOutLen >= famasc_key_length(obj, iInLen));
|
||||
fb_assert(pOutChar != NULL);
|
||||
fb_assert(pInChar != NULL);
|
||||
fb_assert(iInLen <= LANGASCII_MAX_KEY);
|
||||
fb_assert(iOutLen <= LANGASCII_MAX_KEY);
|
||||
fb_assert(iOutLen >= famasc_key_length(obj, iInLen));
|
||||
|
||||
/* point inbuff at last character */
|
||||
inbuff = pInChar + iInLen - 1;
|
||||
@ -582,7 +582,7 @@ USHORT famasc_string_to_key(TEXTTYPE obj, USHORT iInLen, BYTE *pInChar, USHORT i
|
||||
|
||||
static SSHORT all_spaces(BYTE *s, SSHORT len)
|
||||
{
|
||||
assert(s != NULL);
|
||||
fb_assert(s != NULL);
|
||||
|
||||
while (len-- > 0)
|
||||
if (*s++ != ASCII_SPACE)
|
||||
@ -596,9 +596,9 @@ SSHORT famasc_compare(TEXTTYPE obj, USHORT l1, BYTE *s1, USHORT l2, BYTE *s2)
|
||||
USHORT len;
|
||||
USHORT i;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert(s1 != NULL);
|
||||
assert(s2 != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(s1 != NULL);
|
||||
fb_assert(s2 != NULL);
|
||||
|
||||
len = MIN(l1, l2);
|
||||
for (i = 0; i < len; i++) {
|
||||
@ -639,11 +639,11 @@ USHORT famasc_to_upper(TEXTTYPE obj, BYTE ch)
|
||||
SSHORT famasc_str_to_upper(TEXTTYPE obj, USHORT iLen, BYTE *pStr, USHORT iOutLen, BYTE *pOutStr)
|
||||
{
|
||||
BYTE *p;
|
||||
assert(pStr != NULL);
|
||||
assert(pOutStr != NULL);
|
||||
assert(iLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen >= iLen);
|
||||
fb_assert(pStr != NULL);
|
||||
fb_assert(pOutStr != NULL);
|
||||
fb_assert(iLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen >= iLen);
|
||||
p = pOutStr;
|
||||
while (iLen && iOutLen) {
|
||||
*pOutStr++ = ASCII7_UPPER(*pStr);
|
||||
@ -675,11 +675,11 @@ USHORT cp1251_to_upper(TEXTTYPE obj, BYTE ch)
|
||||
SSHORT cp1251_str_to_upper(TEXTTYPE obj, USHORT iLen, BYTE *pStr, USHORT iOutLen, BYTE *pOutStr)
|
||||
{
|
||||
BYTE *p;
|
||||
assert(pStr != NULL);
|
||||
assert(pOutStr != NULL);
|
||||
assert(iLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen >= iLen);
|
||||
fb_assert(pStr != NULL);
|
||||
fb_assert(pOutStr != NULL);
|
||||
fb_assert(iLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen >= iLen);
|
||||
p = pOutStr;
|
||||
while (iLen && iOutLen) {
|
||||
*pOutStr++ = CP1251_UPPER(*pStr);
|
||||
|
@ -99,11 +99,11 @@ static SSHORT big5_str_to_upper(TEXTTYPE obj, USHORT iLen, BYTE *pStr, USHORT iO
|
||||
USHORT waiting_for_big52 = FALSE;
|
||||
BYTE c;
|
||||
|
||||
assert(pStr != NULL);
|
||||
assert(pOutStr != NULL);
|
||||
assert(iLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen >= iLen);
|
||||
fb_assert(pStr != NULL);
|
||||
fb_assert(pOutStr != NULL);
|
||||
fb_assert(iLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen >= iLen);
|
||||
p = pOutStr;
|
||||
while (iLen && iOutLen) {
|
||||
c = *pStr++;
|
||||
|
@ -623,11 +623,11 @@ USHORT fam1_to_upper(TEXTTYPE obj, BYTE ch)
|
||||
SSHORT fam1_str_to_upper(TEXTTYPE obj, USHORT iLen, BYTE *pStr, USHORT iOutLen, BYTE *pOutStr)
|
||||
{
|
||||
BYTE *p;
|
||||
assert(pStr != NULL);
|
||||
assert(pOutStr != NULL);
|
||||
assert(iLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen >= iLen);
|
||||
fb_assert(pStr != NULL);
|
||||
fb_assert(pOutStr != NULL);
|
||||
fb_assert(iLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen >= iLen);
|
||||
p = pOutStr;
|
||||
while (iLen && iOutLen) {
|
||||
*pOutStr++ = LOCALE_UPPER(*pStr);
|
||||
@ -665,8 +665,8 @@ SSHORT LC_DOS_nc_mbtowc(TEXTTYPE obj, UCS2_CHAR *wc, UCHAR *ptr, USHORT count)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(obj);
|
||||
assert(ptr);
|
||||
fb_assert(obj);
|
||||
fb_assert(ptr);
|
||||
|
||||
if (count >= 1) {
|
||||
if (wc)
|
||||
|
@ -543,11 +543,11 @@ static USHORT fam2_to_upper(TEXTTYPE obj, BYTE ch)
|
||||
static SSHORT fam2_str_to_upper(TEXTTYPE obj, USHORT iLen, BYTE *pStr, USHORT iOutLen, BYTE *pOutStr)
|
||||
{
|
||||
BYTE *p;
|
||||
assert(pStr != NULL);
|
||||
assert(pOutStr != NULL);
|
||||
assert(iLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen >= iLen);
|
||||
fb_assert(pStr != NULL);
|
||||
fb_assert(pOutStr != NULL);
|
||||
fb_assert(iLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen >= iLen);
|
||||
p = pOutStr;
|
||||
while (iLen && iOutLen) {
|
||||
*pOutStr++ = LOCALE_UPPER(*pStr);
|
||||
|
@ -113,11 +113,11 @@ static USHORT fam2_to_upper (TEXTTYPE obj, BYTE ch)
|
||||
static SSHORT fam2_str_to_upper (TEXTTYPE obj, USHORT iLen, BYTE *pStr, USHORT iOutLen, BYTE *pOutStr)
|
||||
{
|
||||
BYTE *p;
|
||||
assert (pStr != NULL);
|
||||
assert (pOutStr != NULL);
|
||||
assert (iLen <= 32000); /* almost certainly an error */
|
||||
assert (iOutLen <= 32000); /* almost certainly an error */
|
||||
assert (iOutLen >= iLen);
|
||||
fb_assert (pStr != NULL);
|
||||
fb_assert (pOutStr != NULL);
|
||||
fb_assert (iLen <= 32000); /* almost certainly an error */
|
||||
fb_assert (iOutLen <= 32000); /* almost certainly an error */
|
||||
fb_assert (iOutLen >= iLen);
|
||||
p = pOutStr;
|
||||
while (iLen && iOutLen) {
|
||||
*pOutStr++ = LOCALE_UPPER (*pStr);
|
||||
|
@ -120,11 +120,11 @@ static SSHORT sjis_str_to_upper(TEXTTYPE obj, USHORT iLen, BYTE *pStr, USHORT iO
|
||||
USHORT waiting_for_sjis2 = FALSE;
|
||||
BYTE c;
|
||||
|
||||
assert(pStr != NULL);
|
||||
assert(pOutStr != NULL);
|
||||
assert(iLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
assert(iOutLen >= iLen);
|
||||
fb_assert(pStr != NULL);
|
||||
fb_assert(pOutStr != NULL);
|
||||
fb_assert(iLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen <= 32000); /* almost certainly an error */
|
||||
fb_assert(iOutLen >= iLen);
|
||||
p = pOutStr;
|
||||
while (iLen && iOutLen) {
|
||||
c = *pStr++;
|
||||
|
@ -146,11 +146,11 @@ static USHORT LCKSC_string_to_key(TEXTTYPE obj, USHORT iInLen, BYTE *pInChar, US
|
||||
BYTE *inbuff;
|
||||
BYTE *outbuff;
|
||||
|
||||
assert(pOutChar != NULL);
|
||||
assert(pInChar != NULL);
|
||||
assert(iInLen <= LANGKSC_MAX_KEY);
|
||||
assert(iOutLen <= LANGKSC_MAX_KEY);
|
||||
assert(iOutLen >= LCKSC_key_length(obj, iInLen));
|
||||
fb_assert(pOutChar != NULL);
|
||||
fb_assert(pInChar != NULL);
|
||||
fb_assert(iInLen <= LANGKSC_MAX_KEY);
|
||||
fb_assert(iOutLen <= LANGKSC_MAX_KEY);
|
||||
fb_assert(iOutLen >= LCKSC_key_length(obj, iInLen));
|
||||
|
||||
inbuff = pInChar + iInLen - 1;
|
||||
while ((inbuff >= pInChar) && (*inbuff == ASCII_SPACE))
|
||||
@ -182,7 +182,7 @@ static USHORT LCKSC_string_to_key(TEXTTYPE obj, USHORT iInLen, BYTE *pInChar, US
|
||||
if (!iOutLen)
|
||||
break;
|
||||
idx = GetSpeHanNdx(*pInChar, *(pInChar + 1));
|
||||
assert(idx >= 0);
|
||||
fb_assert(idx >= 0);
|
||||
*outbuff++ = gen_han[idx][0];
|
||||
*outbuff++ = gen_han[idx][1];
|
||||
*outbuff++ = 2;
|
||||
@ -194,9 +194,9 @@ static USHORT LCKSC_string_to_key(TEXTTYPE obj, USHORT iInLen, BYTE *pInChar, US
|
||||
|
||||
*outbuff++ = *pInChar;
|
||||
iOutLen--;
|
||||
assert(KSC1(*pInChar) || (*pInChar < 0x80));
|
||||
fb_assert(KSC1(*pInChar) || (*pInChar < 0x80));
|
||||
if (KSC1(*pInChar)) { /* the rest characters of KSC_5601 table */
|
||||
assert(KSC2(*(pInChar + 1)));
|
||||
fb_assert(KSC2(*(pInChar + 1)));
|
||||
if (!iOutLen)
|
||||
break;
|
||||
*outbuff++ = *(pInChar + 1);
|
||||
|
@ -91,7 +91,7 @@
|
||||
USHORT LC_NARROW_key_length(TEXTTYPE obj, USHORT inLen)
|
||||
{
|
||||
USHORT len;
|
||||
/* assert (inLen <= LANGFAM2_MAX_KEY); *//* almost certainly an error */
|
||||
/* fb_assert (inLen <= LANGFAM2_MAX_KEY); *//* almost certainly an error */
|
||||
len = 3 * MAX(inLen, 2);
|
||||
return (MIN(len, LANGFAM2_MAX_KEY));
|
||||
}
|
||||
@ -127,11 +127,11 @@ USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, BYTE *pInChar, USHOR
|
||||
BYTE *inbuff;
|
||||
SortOrderTblEntry* coll;
|
||||
|
||||
assert(pOutChar != NULL);
|
||||
assert(pInChar != NULL);
|
||||
/* assert (iInLen <= LANGFAM2_MAX_KEY); */
|
||||
assert(iOutLen <= LANGFAM2_MAX_KEY);
|
||||
assert(iOutLen >= LC_NARROW_key_length(obj, iInLen));
|
||||
fb_assert(pOutChar != NULL);
|
||||
fb_assert(pInChar != NULL);
|
||||
/* fb_assert (iInLen <= LANGFAM2_MAX_KEY); */
|
||||
fb_assert(iOutLen <= LANGFAM2_MAX_KEY);
|
||||
fb_assert(iOutLen >= LC_NARROW_key_length(obj, iInLen));
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Dump out the input string */
|
||||
@ -156,10 +156,10 @@ USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, BYTE *pInChar, USHOR
|
||||
iInLen = (inbuff - pInChar + 1);
|
||||
|
||||
for (i = 0; i < iInLen; i++, pInChar++) {
|
||||
assert(lprimary < iOutLen);
|
||||
assert(lsecondary < sizeof(secondary));
|
||||
assert(ltertiary < sizeof(tertiary));
|
||||
assert(lspecial < sizeof(special));
|
||||
fb_assert(lprimary < iOutLen);
|
||||
fb_assert(lsecondary < sizeof(secondary));
|
||||
fb_assert(ltertiary < sizeof(tertiary));
|
||||
fb_assert(lspecial < sizeof(special));
|
||||
|
||||
coll =
|
||||
&((SortOrderTblEntry*) obj->
|
||||
@ -184,7 +184,7 @@ USHORT LC_NARROW_string_to_key(TEXTTYPE obj, USHORT iInLen, BYTE *pInChar, USHOR
|
||||
ExpandChar* exp = &((ExpandChar*) obj->texttype_expand_table)[0];
|
||||
while (exp->Ch && exp->Ch != *pInChar)
|
||||
exp++;
|
||||
assert(exp->Ch == *pInChar);
|
||||
fb_assert(exp->Ch == *pInChar);
|
||||
for (j = 0; j < 2; j++) {
|
||||
if (j)
|
||||
coll =
|
||||
@ -363,7 +363,7 @@ SortOrderTblEntry* get_coltab_entry(TEXTTYPE obj, UCHAR **p, USHORT *l, COLSTAT
|
||||
(*l)--;
|
||||
(*p)++;
|
||||
stat->stat_flags &= ~HAVE_WAITING;
|
||||
assert(stat->stat_waiting);
|
||||
fb_assert(stat->stat_waiting);
|
||||
return stat->stat_waiting;
|
||||
}
|
||||
|
||||
@ -390,7 +390,7 @@ SortOrderTblEntry* get_coltab_entry(TEXTTYPE obj, UCHAR **p, USHORT *l, COLSTAT
|
||||
ExpandChar* exp = &((ExpandChar*) obj->texttype_expand_table)[0];
|
||||
while (exp->Ch && exp->Ch != **p)
|
||||
exp++;
|
||||
assert(exp->Ch == **p);
|
||||
fb_assert(exp->Ch == **p);
|
||||
/* Have coll1 */
|
||||
/* Have waiting */
|
||||
|
||||
@ -489,8 +489,8 @@ SSHORT LC_NARROW_compare(TEXTTYPE obj, USHORT l1, BYTE *s1, USHORT l2, BYTE *s2)
|
||||
}
|
||||
|
||||
/* One of the strings ended */
|
||||
assert(l1 == 0 || l2 == 0);
|
||||
assert(col1 == NULL || col2 == NULL);
|
||||
fb_assert(l1 == 0 || l2 == 0);
|
||||
fb_assert(col1 == NULL || col2 == NULL);
|
||||
|
||||
if (col1 && !col2)
|
||||
return 500;
|
||||
@ -537,9 +537,9 @@ static SSHORT old_fam2_compare(TEXTTYPE obj, USHORT l1, BYTE *s1, USHORT l2, BYT
|
||||
USHORT len;
|
||||
USHORT i;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert(s1 != NULL);
|
||||
assert(s2 != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(s1 != NULL);
|
||||
fb_assert(s2 != NULL);
|
||||
|
||||
len1 = LC_NARROW_string_to_key(obj, l1, s1, sizeof(key1), key1, FALSE);
|
||||
len2 = LC_NARROW_string_to_key(obj, l2, s2, sizeof(key2), key2, FALSE);
|
||||
|
@ -111,9 +111,9 @@ TEXTTYPE_ENTRY(UNI201_init)
|
||||
|
||||
static SSHORT wc_mbtowc(TEXTTYPE *obj, UCS2_CHAR *wc, NCHAR *p, USHORT n)
|
||||
{
|
||||
assert(obj);
|
||||
assert(wc);
|
||||
assert(p);
|
||||
fb_assert(obj);
|
||||
fb_assert(wc);
|
||||
fb_assert(p);
|
||||
|
||||
if (n < sizeof(UCS2_CHAR))
|
||||
return -1;
|
||||
|
@ -245,7 +245,7 @@ void LD_assert(const SCHAR* filename, int lineno)
|
||||
*
|
||||
* Functional description
|
||||
*
|
||||
* Utility function for assert() macro
|
||||
* Utility function for fb_assert() macro
|
||||
* Defined locally (clone from jrd/err.c) as ERR_assert isn't
|
||||
* a shared module entry point on all platforms, whereas gds__log is.
|
||||
*
|
||||
@ -424,7 +424,7 @@ USHORT DLL_EXPORT LD_lookup(USHORT objtype,
|
||||
}
|
||||
default:
|
||||
#ifdef DEV_BUILD
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
#endif
|
||||
*fun = NULL;
|
||||
return (1);
|
||||
|
@ -47,7 +47,7 @@ void LD2_assert(filename, lineno)
|
||||
*
|
||||
* Functional description
|
||||
*
|
||||
* Utility function for assert() macro
|
||||
* Utility function for fb_assert() macro
|
||||
* Defined locally (clone from jrd/err.c) as ERR_assert isn't
|
||||
* a shared module entry point on all platforms, whereas gds__log is.
|
||||
*
|
||||
@ -113,7 +113,7 @@ USHORT DLL_EXPORT LD2_lookup(USHORT objtype,
|
||||
}
|
||||
default:
|
||||
#ifdef DEV_BUILD
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
#endif
|
||||
*fun = NULL;
|
||||
return 1;
|
||||
|
@ -38,16 +38,16 @@
|
||||
typedef USHORT UNICODE;
|
||||
|
||||
/* Redirect the assertion code defined by gdsassert.h to a local routine */
|
||||
#ifdef assert
|
||||
#undef assert
|
||||
#ifdef fb_assert
|
||||
#undef fb_assert
|
||||
#endif
|
||||
#ifndef DEV_BUILD
|
||||
#define ERR_assert /* nothing */
|
||||
#define assert(ex) /* nothing */
|
||||
#define fb_assert(ex) /* nothing */
|
||||
#else
|
||||
#include <stdlib.h> /* prototype for abort() */
|
||||
#define ERR_assert LD_assert
|
||||
#define assert(ex) {if (!(ex)){LD_assert (__FILE__, __LINE__); abort();}}
|
||||
#define fb_assert(ex) {if (!(ex)){LD_assert (__FILE__, __LINE__); abort();}}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -81,7 +81,7 @@ void ExecuteStatement::Open(TDBB tdbb, JRD_NOD sql, SSHORT nVars, bool SingleTon
|
||||
StartOfSqlOperator = 0;
|
||||
SingleMode = SingleTon;
|
||||
|
||||
assert(tdbb->tdbb_transaction->tra_pool);
|
||||
fb_assert(tdbb->tdbb_transaction->tra_pool);
|
||||
vary *v = reinterpret_cast <vary*> (
|
||||
FB_NEW(*tdbb->tdbb_transaction->tra_pool) char[BUFFER_LARGE + sizeof(vary)]);
|
||||
v->vary_length = BUFFER_LARGE;
|
||||
@ -178,7 +178,7 @@ err_handler:
|
||||
|
||||
bool ExecuteStatement::Fetch(TDBB tdbb, JRD_NOD * JrdVar) {
|
||||
// If already bugged - we should never get here
|
||||
assert(! (tdbb->tdbb_status_vector[0] == 1 &&
|
||||
fb_assert(! (tdbb->tdbb_status_vector[0] == 1 &&
|
||||
tdbb->tdbb_status_vector[1] != 0));
|
||||
if (! Statement)
|
||||
return false;
|
||||
|
@ -416,8 +416,8 @@ static ISC_STATUS open_blob(
|
||||
*/
|
||||
|
||||
if (filter->blf_filter == (PTR) filter_transliterate_text) {
|
||||
assert(to == BLOB_text);
|
||||
assert(from == BLOB_text);
|
||||
fb_assert(to == BLOB_text);
|
||||
fb_assert(from == BLOB_text);
|
||||
control->ctl_to_sub_type = to_charset;
|
||||
control->ctl_from_sub_type = from_charset;
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ bool BTR_description(JRD_REL relation,
|
||||
return false;
|
||||
}
|
||||
|
||||
//assert(id <= MAX_USHORT);
|
||||
//fb_assert(id <= MAX_USHORT);
|
||||
idx->idx_id = (USHORT)id;
|
||||
idx->idx_root = irt_desc->irt_root;
|
||||
idx->idx_selectivity = irt_desc->irt_stuff.irt_selectivity;
|
||||
@ -773,7 +773,7 @@ void BTR_insert(TDBB tdbb, WIN * root_window, IIB * insertion)
|
||||
USHORT l;
|
||||
quad_put(split_page, node->btn_number);
|
||||
node->btn_prefix = 0;
|
||||
assert(key.key_length <= MAX_UCHAR);
|
||||
fb_assert(key.key_length <= MAX_UCHAR);
|
||||
l = node->btn_length = (UCHAR) key.key_length;
|
||||
q = node->btn_data;
|
||||
p = key.key_data;
|
||||
@ -1217,10 +1217,10 @@ void BTR_make_key(TDBB tdbb,
|
||||
idx::idx_repeat * tail;
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
assert(count > 0);
|
||||
assert(idx != NULL);
|
||||
assert(exprs != NULL);
|
||||
assert(key != NULL);
|
||||
fb_assert(count > 0);
|
||||
fb_assert(idx != NULL);
|
||||
fb_assert(exprs != NULL);
|
||||
fb_assert(key != NULL);
|
||||
|
||||
tail = idx->idx_rpt;
|
||||
|
||||
@ -1556,7 +1556,7 @@ retry:
|
||||
|
||||
idx->idx_id = slot - root->irt_rpt;
|
||||
slot->irt_desc = space;
|
||||
assert(idx->idx_count <= MAX_UCHAR);
|
||||
fb_assert(idx->idx_count <= MAX_UCHAR);
|
||||
slot->irt_keys = (UCHAR) idx->idx_count;
|
||||
slot->irt_flags = idx->idx_flags | irt_in_progress;
|
||||
|
||||
@ -2281,7 +2281,7 @@ static CONTENTS delete_node(TDBB tdbb, WIN * window, BTN node)
|
||||
}
|
||||
else {
|
||||
page->btr_prefix_total -= node->btn_prefix;
|
||||
assert(l <= MAX_UCHAR);
|
||||
fb_assert(l <= MAX_UCHAR);
|
||||
node->btn_length = (UCHAR) l;
|
||||
node->btn_prefix = next->btn_prefix;
|
||||
}
|
||||
@ -2312,7 +2312,7 @@ static CONTENTS delete_node(TDBB tdbb, WIN * window, BTN node)
|
||||
// Journal b-tree page - logical log of delete
|
||||
if (dbb->dbb_wal) {
|
||||
JRNB journal;
|
||||
assert(node_offset <= MAX_USHORT);
|
||||
fb_assert(node_offset <= MAX_USHORT);
|
||||
journal.jrnb_type = JRNP_BTREE_DELETE;
|
||||
journal.jrnb_prefix_total = page->btr_prefix_total;
|
||||
journal.jrnb_offset = (USHORT) node_offset;
|
||||
@ -2564,7 +2564,7 @@ static SLONG fast_load(TDBB tdbb,
|
||||
split_node->btn_prefix = 0;
|
||||
p = split_node->btn_data;
|
||||
q = key->key_data;
|
||||
assert(key->key_length <= MAX_UCHAR);
|
||||
fb_assert(key->key_length <= MAX_UCHAR);
|
||||
if ( (l = split_node->btn_length = (UCHAR) key->key_length) ) {
|
||||
do {
|
||||
*p++ = *q++;
|
||||
@ -2596,7 +2596,7 @@ static SLONG fast_load(TDBB tdbb,
|
||||
|
||||
// Insert the new node in the now current bucket
|
||||
|
||||
assert(prefix <= MAX_UCHAR);
|
||||
fb_assert(prefix <= MAX_UCHAR);
|
||||
node->btn_prefix = (UCHAR) prefix;
|
||||
bucket->btr_prefix_total += prefix;
|
||||
quad_put(isr->isr_record_number, node->btn_number);
|
||||
@ -2650,7 +2650,7 @@ static SLONG fast_load(TDBB tdbb,
|
||||
bucket->btr_header.pag_type = pag_index;
|
||||
bucket->btr_relation = relation->rel_id;
|
||||
bucket->btr_id = (UCHAR)(idx->idx_id % 256);
|
||||
assert(level <= MAX_UCHAR);
|
||||
fb_assert(level <= MAX_UCHAR);
|
||||
bucket->btr_level = (UCHAR) level;
|
||||
if (idx->idx_flags & idx_descending)
|
||||
bucket->btr_header.pag_flags |= btr_descending;
|
||||
@ -2694,7 +2694,7 @@ static SLONG fast_load(TDBB tdbb,
|
||||
split_node->btn_prefix = 0;
|
||||
p = split_node->btn_data;
|
||||
q = key->key_data;
|
||||
assert(key->key_length <= MAX_UCHAR);
|
||||
fb_assert(key->key_length <= MAX_UCHAR);
|
||||
if ( (l = split_node->btn_length = (UCHAR) key->key_length) ) {
|
||||
do {
|
||||
MOVE_BYTE(q, p);
|
||||
@ -2720,7 +2720,7 @@ static SLONG fast_load(TDBB tdbb,
|
||||
|
||||
// Now propogate up the lower-level bucket by storing a "pointer" to it.
|
||||
node = NEXT_NODE(node);
|
||||
assert(prefix <= MAX_UCHAR);
|
||||
fb_assert(prefix <= MAX_UCHAR);
|
||||
node->btn_prefix = (UCHAR) prefix;
|
||||
bucket->btr_prefix_total += prefix;
|
||||
quad_put(windows[level - 1].win_page, node->btn_number);
|
||||
@ -3627,7 +3627,7 @@ static SLONG insert_node(TDBB tdbb,
|
||||
QUAD_MOVE(node->btn_number, new_node->btn_number);
|
||||
p = new_node->btn_data;
|
||||
q = new_key->key_data;
|
||||
assert(new_key->key_length <= MAX_UCHAR);
|
||||
fb_assert(new_key->key_length <= MAX_UCHAR);
|
||||
if ( (l = new_node->btn_length = (UCHAR) new_key->key_length) ) {
|
||||
do {
|
||||
MOVE_BYTE(q, p);
|
||||
|
@ -4908,13 +4908,13 @@ static SSHORT lock_buffer(
|
||||
to do so. */
|
||||
|
||||
if (page_type == pag_header || page_type == pag_transactions) {
|
||||
assert(lock->lck_ast == blocking_ast_bdb);
|
||||
assert(lock->lck_object == reinterpret_cast<blk*>(bdb));
|
||||
fb_assert(lock->lck_ast == blocking_ast_bdb);
|
||||
fb_assert(lock->lck_object == reinterpret_cast<blk*>(bdb));
|
||||
lock->lck_ast = 0;
|
||||
lock->lck_object = NULL;
|
||||
}
|
||||
else
|
||||
assert(lock->lck_ast != NULL);
|
||||
fb_assert(lock->lck_ast != NULL);
|
||||
|
||||
lock->lck_key.lck_long = bdb->bdb_page;
|
||||
if (PAGE_LOCK_OPT(lock, lock_type, wait)) {
|
||||
@ -4923,7 +4923,7 @@ static SSHORT lock_buffer(
|
||||
out. Flag the bdb so that the lock is released when
|
||||
the buffer is released. */
|
||||
|
||||
assert(page_type == pag_header
|
||||
fb_assert(page_type == pag_header
|
||||
|| page_type == pag_transactions);
|
||||
lock->lck_ast = blocking_ast_bdb;
|
||||
lock->lck_object = reinterpret_cast<blk*>(bdb);
|
||||
@ -4933,7 +4933,7 @@ static SSHORT lock_buffer(
|
||||
}
|
||||
|
||||
if (!lock->lck_ast) {
|
||||
assert(page_type == pag_header || page_type == pag_transactions);
|
||||
fb_assert(page_type == pag_header || page_type == pag_transactions);
|
||||
lock->lck_ast = blocking_ast_bdb;
|
||||
lock->lck_object = reinterpret_cast<blk*>(bdb);
|
||||
}
|
||||
|
102
src/jrd/cmp.cpp
102
src/jrd/cmp.cpp
@ -648,7 +648,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
#endif
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
/* FALLINTO */
|
||||
case dtype_sql_time:
|
||||
case dtype_sql_date:
|
||||
@ -710,7 +710,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
#endif
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
/* FALLINTO */
|
||||
case dtype_sql_time:
|
||||
case dtype_sql_date:
|
||||
@ -930,7 +930,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
case dtype_timestamp:
|
||||
node->nod_flags |= nod_date;
|
||||
|
||||
assert(DTYPE_IS_DATE(desc1.dsc_dtype) ||
|
||||
fb_assert(DTYPE_IS_DATE(desc1.dsc_dtype) ||
|
||||
DTYPE_IS_DATE(desc2.dsc_dtype));
|
||||
|
||||
if (COULD_BE_DATE(desc1) && COULD_BE_DATE(desc2)) {
|
||||
@ -978,7 +978,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
desc->dsc_flags = 0;
|
||||
}
|
||||
else {
|
||||
assert(dtype == dtype_timestamp);
|
||||
fb_assert(dtype == dtype_timestamp);
|
||||
desc->dsc_dtype = DEFAULT_DOUBLE;
|
||||
desc->dsc_length = type_lengths[desc->dsc_dtype];
|
||||
desc->dsc_scale = 0;
|
||||
@ -1007,7 +1007,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
desc->dsc_dtype = desc1.dsc_dtype;
|
||||
if (!DTYPE_IS_DATE(desc->dsc_dtype))
|
||||
desc->dsc_dtype = desc2.dsc_dtype;
|
||||
assert(DTYPE_IS_DATE(desc->dsc_dtype));
|
||||
fb_assert(DTYPE_IS_DATE(desc->dsc_dtype));
|
||||
desc->dsc_length = type_lengths[desc->dsc_dtype];
|
||||
desc->dsc_scale = 0;
|
||||
desc->dsc_sub_type = 0;
|
||||
@ -1058,7 +1058,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
return;
|
||||
#endif
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
/* FALLINTO */
|
||||
case dtype_blob:
|
||||
case dtype_array:
|
||||
@ -1099,7 +1099,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
else {
|
||||
/* mixed numeric and non-numeric: */
|
||||
|
||||
assert(COULD_BE_DATE(desc1) || COULD_BE_DATE(desc2));
|
||||
fb_assert(COULD_BE_DATE(desc1) || COULD_BE_DATE(desc2));
|
||||
|
||||
/* The MAX(dtype) rule doesn't apply with dtype_int64 */
|
||||
|
||||
@ -1117,7 +1117,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
case dtype_sql_time:
|
||||
node->nod_flags |= nod_date;
|
||||
|
||||
assert(DTYPE_IS_DATE(desc1.dsc_dtype) ||
|
||||
fb_assert(DTYPE_IS_DATE(desc1.dsc_dtype) ||
|
||||
DTYPE_IS_DATE(desc2.dsc_dtype));
|
||||
|
||||
if ((DTYPE_IS_DATE(dtype1) || (dtype1 == dtype_null)) &&
|
||||
@ -1163,7 +1163,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
desc->dsc_flags = 0;
|
||||
}
|
||||
else {
|
||||
assert(dtype == dtype_timestamp
|
||||
fb_assert(dtype == dtype_timestamp
|
||||
|| dtype == dtype_null);
|
||||
desc->dsc_dtype = DEFAULT_DOUBLE;
|
||||
desc->dsc_length = type_lengths[desc->dsc_dtype];
|
||||
@ -1193,7 +1193,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
desc->dsc_dtype = desc1.dsc_dtype;
|
||||
if (!DTYPE_IS_DATE(desc->dsc_dtype))
|
||||
desc->dsc_dtype = desc2.dsc_dtype;
|
||||
assert(DTYPE_IS_DATE(desc->dsc_dtype));
|
||||
fb_assert(DTYPE_IS_DATE(desc->dsc_dtype));
|
||||
desc->dsc_length = type_lengths[desc->dsc_dtype];
|
||||
desc->dsc_scale = 0;
|
||||
desc->dsc_sub_type = 0;
|
||||
@ -1255,7 +1255,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
return;
|
||||
#endif
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
/* FALLINTO */
|
||||
case dtype_blob:
|
||||
case dtype_array:
|
||||
@ -1304,7 +1304,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
return;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
/* FALLINTO */
|
||||
case DTYPE_CANNOT:
|
||||
/* break to error reporting code */
|
||||
@ -1352,7 +1352,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
return;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
/* FALLINTO */
|
||||
case DTYPE_CANNOT:
|
||||
/* break to error reporting code */
|
||||
@ -1598,7 +1598,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
|
||||
return;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2040,7 +2040,7 @@ void CMP_decrement_prc_use_count(TDBB tdbb, JRD_PRC procedure)
|
||||
this routine can be called for the procedure which is being freed itself.
|
||||
Hence we should just silently ignore such a situation. */
|
||||
|
||||
// assert(procedure->prc_use_count > 0); -- commented out by dimitr, 2003.01.30
|
||||
// fb_assert(procedure->prc_use_count > 0); -- commented out by dimitr, 2003.01.30
|
||||
if (!procedure->prc_use_count)
|
||||
return;
|
||||
|
||||
@ -2253,8 +2253,8 @@ static UCHAR *alloc_map(TDBB tdbb, CSB csb, USHORT stream)
|
||||
string = FB_NEW_RPT(*tdbb->tdbb_default, MAP_LENGTH) str;
|
||||
string->str_length = MAP_LENGTH;
|
||||
csb->csb_rpt[stream].csb_map = (UCHAR *) string->str_data;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(stream <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(stream <= MAX_UCHAR); */
|
||||
string->str_data[0] = (UCHAR) stream;
|
||||
|
||||
return (UCHAR *) string->str_data;
|
||||
@ -2561,8 +2561,8 @@ static JRD_NOD copy(
|
||||
relative_stream = (stream) ? remap[stream - 1] : stream;
|
||||
new_stream = csb->csb_n_stream++;
|
||||
node->nod_arg[e_rel_stream] = (JRD_NOD) (SLONG) new_stream;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(new_stream <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(new_stream <= MAX_UCHAR); */
|
||||
remap[stream] = (UCHAR) new_stream;
|
||||
|
||||
node->nod_arg[e_rel_context] = input->nod_arg[e_rel_context];
|
||||
@ -2630,8 +2630,8 @@ static JRD_NOD copy(
|
||||
stream = (USHORT)(ULONG) input->nod_arg[e_prc_stream];
|
||||
new_stream = csb->csb_n_stream++;
|
||||
node->nod_arg[e_prc_stream] = (JRD_NOD) (SLONG) new_stream;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(new_stream <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(new_stream <= MAX_UCHAR); */
|
||||
remap[stream] = (UCHAR) new_stream;
|
||||
node->nod_arg[e_prc_procedure] = input->nod_arg[e_prc_procedure];
|
||||
element = CMP_csb_element(csb, new_stream);
|
||||
@ -2651,12 +2651,12 @@ static JRD_NOD copy(
|
||||
node->nod_type = input->nod_type;
|
||||
node->nod_count = 0;
|
||||
stream = (USHORT)(ULONG) input->nod_arg[e_agg_stream];
|
||||
assert(stream <= MAX_STREAMS);
|
||||
fb_assert(stream <= MAX_STREAMS);
|
||||
new_stream = csb->csb_n_stream++;
|
||||
assert(new_stream <= MAX_STREAMS);
|
||||
fb_assert(new_stream <= MAX_STREAMS);
|
||||
node->nod_arg[e_agg_stream] = (JRD_NOD) (SLONG) new_stream;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(new_stream <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(new_stream <= MAX_UCHAR); */
|
||||
remap[stream] = (UCHAR) new_stream;
|
||||
CMP_csb_element(csb, new_stream);
|
||||
|
||||
@ -2682,8 +2682,8 @@ static JRD_NOD copy(
|
||||
stream = (USHORT)(ULONG) input->nod_arg[e_uni_stream];
|
||||
new_stream = csb->csb_n_stream++;
|
||||
node->nod_arg[e_uni_stream] = (JRD_NOD) (SLONG) new_stream;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(new_stream <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(new_stream <= MAX_UCHAR); */
|
||||
remap[stream] = (UCHAR) new_stream;
|
||||
CMP_csb_element(csb, new_stream);
|
||||
|
||||
@ -2861,8 +2861,8 @@ static JRD_NOD make_defaults(TDBB tdbb, CSB csb, USHORT stream, JRD_NOD statemen
|
||||
|
||||
if (!(map = csb->csb_rpt[stream].csb_map)) {
|
||||
map = local_map;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(stream <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(stream <= MAX_UCHAR); */
|
||||
map[0] = (UCHAR) stream;
|
||||
map[1] = 1;
|
||||
map[2] = 2;
|
||||
@ -2925,8 +2925,8 @@ static JRD_NOD make_validation(TDBB tdbb, CSB csb, USHORT stream)
|
||||
|
||||
if (!(map = csb->csb_rpt[stream].csb_map)) {
|
||||
map = local_map;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(stream <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(stream <= MAX_UCHAR); */
|
||||
map[0] = (UCHAR) stream;
|
||||
}
|
||||
|
||||
@ -3129,8 +3129,8 @@ static JRD_NOD pass1(
|
||||
|
||||
if (!(map = tail->csb_map)) {
|
||||
map = local_map;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(stream + 2 <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(stream + 2 <= MAX_UCHAR); */
|
||||
local_map[0] = (UCHAR) stream;
|
||||
map[1] = stream + 1;
|
||||
map[2] = stream + 2;
|
||||
@ -3173,8 +3173,8 @@ static JRD_NOD pass1(
|
||||
tail = &csb->csb_rpt[stream];
|
||||
tail->csb_flags |= csb_modify;
|
||||
pass1_modify(tdbb, csb, node);
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(node->nod_arg [e_mod_new_stream] <= MAX_USHORT); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(node->nod_arg [e_mod_new_stream] <= MAX_USHORT); */
|
||||
if ( (node->nod_arg[e_mod_validate] = make_validation(tdbb, csb,
|
||||
(USHORT)(ULONG) node->
|
||||
nod_arg[e_mod_new_stream])) ) node->nod_count =
|
||||
@ -3228,7 +3228,7 @@ static JRD_NOD pass1(
|
||||
break;
|
||||
|
||||
case nod_aggregate:
|
||||
assert((int)(SLONG) node->nod_arg[e_agg_stream] <= MAX_STREAMS);
|
||||
fb_assert((int)(SLONG) node->nod_arg[e_agg_stream] <= MAX_STREAMS);
|
||||
csb->csb_rpt[(USHORT)(ULONG) node->nod_arg[e_agg_stream]].csb_flags |=
|
||||
csb_no_dbkey;
|
||||
ignore_dbkey(tdbb, csb, (RSE) node->nod_arg[e_agg_rse], view);
|
||||
@ -3588,8 +3588,8 @@ static void pass1_modify(TDBB tdbb, CSB csb, JRD_NOD node)
|
||||
alloc_map(tdbb, csb,
|
||||
(SSHORT)(SLONG) node->nod_arg[e_mod_new_stream]);
|
||||
source = copy(tdbb, csb, source, map, 0, FALSE);
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(source->nod_arg [e_rel_stream] <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(source->nod_arg [e_rel_stream] <= MAX_UCHAR); */
|
||||
map[new_stream] = (UCHAR)(ULONG) source->nod_arg[e_rel_stream];
|
||||
view_node = copy(tdbb, csb, node, map, 0, TRUE);
|
||||
view_node->nod_arg[e_mod_org_stream] = (JRD_NOD) (SLONG) stream;
|
||||
@ -3882,7 +3882,7 @@ static void pass1_source(TDBB tdbb,
|
||||
/* Special case group-by/global aggregates */
|
||||
|
||||
if (source->nod_type == nod_aggregate) {
|
||||
assert((int)(SLONG) source->nod_arg[e_agg_stream] <= MAX_STREAMS);
|
||||
fb_assert((int)(SLONG) source->nod_arg[e_agg_stream] <= MAX_STREAMS);
|
||||
pass1(tdbb, csb, source, parent_view, view_stream, FALSE);
|
||||
return;
|
||||
}
|
||||
@ -3899,8 +3899,8 @@ static void pass1_source(TDBB tdbb,
|
||||
stream = (USHORT)(ULONG) source->nod_arg[e_rel_stream];
|
||||
element = CMP_csb_element(csb, stream);
|
||||
element->csb_view = parent_view;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(view_stream <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(view_stream <= MAX_UCHAR); */
|
||||
element->csb_view_stream = (UCHAR) view_stream;
|
||||
|
||||
/* in the case where there is a parent view, find the context name */
|
||||
@ -4166,12 +4166,12 @@ USHORT update_stream, USHORT priv, JRD_REL view, USHORT view_stream)
|
||||
so that access to views can be checked at the field level */
|
||||
|
||||
CMP_csb_element(csb, stream)->csb_view = view;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(view_stream <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(view_stream <= MAX_UCHAR); */
|
||||
CMP_csb_element(csb, stream)->csb_view_stream = (UCHAR) view_stream;
|
||||
CMP_csb_element(csb, update_stream)->csb_view = view;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(view_stream <= MAX_UCHAR); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(view_stream <= MAX_UCHAR); */
|
||||
CMP_csb_element(csb, update_stream)->csb_view_stream =
|
||||
(UCHAR) view_stream;
|
||||
|
||||
@ -4692,7 +4692,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, JRD_NOD node, JRD_NOD parent)
|
||||
pass2(tdbb, csb, node->nod_arg[e_agg_map], node);
|
||||
pass2(tdbb, csb, node->nod_arg[e_agg_group], node);
|
||||
stream = (USHORT)(ULONG) node->nod_arg[e_agg_stream];
|
||||
assert(stream <= MAX_STREAMS);
|
||||
fb_assert(stream <= MAX_STREAMS);
|
||||
process_map(tdbb, csb, node->nod_arg[e_agg_map],
|
||||
&csb->csb_rpt[stream].csb_format);
|
||||
break;
|
||||
@ -4757,7 +4757,7 @@ static JRD_NOD pass2(TDBB tdbb, CSB csb, JRD_NOD node, JRD_NOD parent)
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Note: no assert (FALSE); here as too many nodes are missing */
|
||||
/* Note: no fb_assert (FALSE); here as too many nodes are missing */
|
||||
break;
|
||||
}
|
||||
|
||||
@ -4814,7 +4814,7 @@ static void pass2_rse(TDBB tdbb, CSB csb, RSE rse)
|
||||
}
|
||||
else if (node->nod_type == nod_aggregate) {
|
||||
USHORT stream = (USHORT)(ULONG) node->nod_arg[e_agg_stream];
|
||||
assert(stream <= MAX_STREAMS);
|
||||
fb_assert(stream <= MAX_STREAMS);
|
||||
csb->csb_rpt[stream].csb_flags |= csb_active;
|
||||
pass2(tdbb, csb, node, (JRD_NOD) rse);
|
||||
}
|
||||
@ -5221,7 +5221,7 @@ static RSB post_rse(TDBB tdbb, CSB csb, RSE rse)
|
||||
}
|
||||
else if (node->nod_type == nod_aggregate) {
|
||||
USHORT stream = (USHORT)(ULONG) node->nod_arg[e_agg_stream];
|
||||
assert(stream <= MAX_STREAMS);
|
||||
fb_assert(stream <= MAX_STREAMS);
|
||||
csb->csb_rpt[stream].csb_flags &= ~csb_active;
|
||||
}
|
||||
}
|
||||
@ -5476,8 +5476,8 @@ static void process_map(TDBB tdbb, CSB csb, JRD_NOD map, FMT * input_format)
|
||||
|
||||
/* Flesh out the format of the record */
|
||||
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(FLAG_BYTES (format->fmt_count) <= MAX_USHORT); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(FLAG_BYTES (format->fmt_count) <= MAX_USHORT); */
|
||||
format->fmt_length = (USHORT) FLAG_BYTES(format->fmt_count);
|
||||
fmt::fmt_desc_iterator desc3, end_desc;
|
||||
|
||||
|
@ -1128,11 +1128,11 @@ USHORT CVT_get_string_ptr(const dsc* desc,
|
||||
* already a string, output pointers point to ttype_ascii.
|
||||
*
|
||||
**************************************/
|
||||
assert(desc != NULL);
|
||||
assert(ttype != NULL);
|
||||
assert(address != NULL);
|
||||
assert(err != NULL);
|
||||
assert((((temp != NULL) && (length > 0))
|
||||
fb_assert(desc != NULL);
|
||||
fb_assert(ttype != NULL);
|
||||
fb_assert(address != NULL);
|
||||
fb_assert(err != NULL);
|
||||
fb_assert((((temp != NULL) && (length > 0))
|
||||
|| (desc->dsc_dtype == dtype_text)
|
||||
|| (desc->dsc_dtype == dtype_cstring)
|
||||
|| (desc->dsc_dtype == dtype_varying)));
|
||||
@ -1268,10 +1268,10 @@ USHORT CVT_make_string(const dsc* desc,
|
||||
* The pointer to this string is returned in address.
|
||||
*
|
||||
**************************************/
|
||||
assert(desc != NULL);
|
||||
assert(address != NULL);
|
||||
assert(err != NULL);
|
||||
assert((((temp != NULL) && (length > 0))
|
||||
fb_assert(desc != NULL);
|
||||
fb_assert(address != NULL);
|
||||
fb_assert(err != NULL);
|
||||
fb_assert((((temp != NULL) && (length > 0))
|
||||
|| ((INTL_TTYPE(desc) <= dtype_any_text)
|
||||
&& (INTL_TTYPE(desc) == to_interp))));
|
||||
|
||||
@ -1405,7 +1405,7 @@ void CVT_move(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
clock = tdbb->tdbb_request->req_timestamp;
|
||||
else {
|
||||
/* All requests should have a timestamp */
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
clock = time(0);
|
||||
}
|
||||
}
|
||||
@ -1420,7 +1420,7 @@ void CVT_move(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
return;
|
||||
|
||||
default:
|
||||
assert(FALSE); /* Fall into ... */
|
||||
fb_assert(FALSE); /* Fall into ... */
|
||||
case dtype_short:
|
||||
case dtype_long:
|
||||
case dtype_int64:
|
||||
@ -1478,7 +1478,7 @@ void CVT_move(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
return;
|
||||
|
||||
default:
|
||||
assert(FALSE); /* Fall into ... */
|
||||
fb_assert(FALSE); /* Fall into ... */
|
||||
case dtype_sql_time:
|
||||
case dtype_short:
|
||||
case dtype_long:
|
||||
@ -1512,7 +1512,7 @@ void CVT_move(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
return;
|
||||
|
||||
default:
|
||||
assert(FALSE); /* Fall into ... */
|
||||
fb_assert(FALSE); /* Fall into ... */
|
||||
case dtype_sql_date:
|
||||
case dtype_short:
|
||||
case dtype_long:
|
||||
@ -1601,8 +1601,8 @@ void CVT_move(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
case dtype_text:
|
||||
length = MIN(length, to->dsc_length);
|
||||
l -= length;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert((to->dsc_length - length) <= MAX_SSHORT); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert((to->dsc_length - length) <= MAX_SSHORT); */
|
||||
fill = (SSHORT) (to->dsc_length - length);
|
||||
|
||||
CVT_COPY_BUFF(q, p, length);
|
||||
@ -1639,8 +1639,8 @@ void CVT_move(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
length =
|
||||
MIN(length, (SLONG) (to->dsc_length - sizeof(USHORT)));
|
||||
l -= length;
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(length <= MAX_USHORT); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(length <= MAX_USHORT); */
|
||||
((VARY *) p)->vary_length = (USHORT) length;
|
||||
p = reinterpret_cast<UCHAR*>(((VARY *) p)->vary_string);
|
||||
CVT_COPY_BUFF(q, p, length);
|
||||
@ -1682,7 +1682,7 @@ void CVT_move(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
return;
|
||||
|
||||
default:
|
||||
assert(FALSE); /* Fall into ... */
|
||||
fb_assert(FALSE); /* Fall into ... */
|
||||
case dtype_blob:
|
||||
conversion_error(from, err);
|
||||
return;
|
||||
@ -1711,8 +1711,8 @@ void CVT_move(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
|
||||
case dtype_short:
|
||||
l = CVT_get_long(from, (SSHORT) to->dsc_scale, err);
|
||||
/* TMN: Here we should really have the following assert */
|
||||
/* assert(l <= MAX_SSHORT); */
|
||||
/* TMN: Here we should really have the following fb_assert */
|
||||
/* fb_assert(l <= MAX_SSHORT); */
|
||||
*(SSHORT *) p = (SSHORT) l;
|
||||
if (*(SSHORT *) p != l)
|
||||
(*err) (gds_arith_except, 0);
|
||||
@ -1815,7 +1815,7 @@ static void datetime_to_text(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
TDBB tdbb = NULL;
|
||||
bool version4 = true;
|
||||
|
||||
assert(DTYPE_IS_TEXT(to->dsc_dtype));
|
||||
fb_assert(DTYPE_IS_TEXT(to->dsc_dtype));
|
||||
|
||||
/* Convert a date or time value into a timestamp for manipulation */
|
||||
|
||||
@ -1845,7 +1845,7 @@ static void datetime_to_text(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
date = *(GDS_TIMESTAMP *) from->dsc_address;
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(false);
|
||||
(*err) (gds_badblk, 0); /* internal error */
|
||||
break;
|
||||
}
|
||||
@ -1915,7 +1915,7 @@ static void datetime_to_text(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
/* Prior to BLR Version5, when a timestamp is converted to a string it
|
||||
is silently truncated if the destination string is not large enough */
|
||||
|
||||
assert(to->dsc_dtype <= dtype_any_text);
|
||||
fb_assert(to->dsc_dtype <= dtype_any_text);
|
||||
|
||||
l = (to->dsc_dtype == dtype_cstring) ? 1 :
|
||||
(to->dsc_dtype == dtype_varying) ? sizeof(USHORT) : 0;
|
||||
@ -2126,7 +2126,7 @@ static void float_to_text(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
d = *(double*) from->dsc_address;
|
||||
}
|
||||
else {
|
||||
assert(dtype_real == from->dsc_dtype);
|
||||
fb_assert(dtype_real == from->dsc_dtype);
|
||||
precision = 8; /* minimum significant digits in a float */
|
||||
d = (double) *(float*) from->dsc_address;
|
||||
}
|
||||
@ -2184,7 +2184,7 @@ static void float_to_text(const dsc* from, dsc* to, FPTR_STATUS err)
|
||||
}
|
||||
}
|
||||
}
|
||||
assert(chars_printed <= width);
|
||||
fb_assert(chars_printed <= width);
|
||||
|
||||
/* Now move the result to the destination array. */
|
||||
|
||||
@ -2748,11 +2748,11 @@ double power_of_ten(const int scale)
|
||||
};
|
||||
|
||||
/* The sole caller of this function checks for scale <= 308 before calling,
|
||||
* but we just assert the weakest precondition which lets the code work.
|
||||
* but we just fb_assert the weakest precondition which lets the code work.
|
||||
* If the size of the exponent field, and thus the scaling, of doubles
|
||||
* gets bigger, increase the size of the upper_part array.
|
||||
*/
|
||||
assert((scale >= 0) && (scale < 320));
|
||||
fb_assert((scale >= 0) && (scale < 320));
|
||||
|
||||
/* Note that "scale >> 5" is another way of writing "scale / 32",
|
||||
* while "scale & 0x1f" is another way of writing "scale % 32".
|
||||
|
@ -278,7 +278,7 @@ SSHORT CVT2_compare(const dsc* arg1, const dsc* arg2, FPTR_STATUS err)
|
||||
default:
|
||||
/* the two arguments have identical dtype and scale, but the
|
||||
dtype is not one of your defined types! */
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
|
||||
} /* switch on dtype */
|
||||
@ -602,8 +602,8 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_STATUS err)
|
||||
obj1 = INTL_texttype_lookup(tdbb, ttype1, err, NULL);
|
||||
obj2 = INTL_texttype_lookup(tdbb, ttype2, err, NULL);
|
||||
}
|
||||
assert(obj1 != NULL);
|
||||
assert(obj2 != NULL);
|
||||
fb_assert(obj1 != NULL);
|
||||
fb_assert(obj2 != NULL);
|
||||
if (obj1.getBytesPerChar() != 1 || obj2.getBytesPerChar() != 1)
|
||||
(*err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
}
|
||||
@ -626,7 +626,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_STATUS err)
|
||||
if (!ret_val)
|
||||
{
|
||||
UCHAR blank_char = both_are_text ? '\x20' : '\x0';
|
||||
assert (safemin == common_top);
|
||||
fb_assert (safemin == common_top);
|
||||
if (l1 < l2)
|
||||
{
|
||||
for (safemin = l1; safemin < l2 && !ret_val; ++safemin)
|
||||
@ -639,7 +639,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_STATUS err)
|
||||
if (buffer1[safemin] != blank_char)
|
||||
ret_val = buffer1[safemin] > blank_char ? 1 : -1;
|
||||
}
|
||||
assert(ret_val || l1 == l2);
|
||||
fb_assert(ret_val || l1 == l2);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -736,7 +736,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_STATUS err)
|
||||
if (arg1->dsc_sub_type == BLOB_text)
|
||||
{
|
||||
obj1 = INTL_texttype_lookup(tdbb, ttype1, err, NULL);
|
||||
assert(obj1 != NULL);
|
||||
fb_assert(obj1 != NULL);
|
||||
ttype1 = obj1.getType();
|
||||
if (ttype1 == ttype_none || ttype1 == ttype_ascii)
|
||||
bin_cmp = true;
|
||||
@ -744,7 +744,7 @@ SSHORT CVT2_blob_compare(const dsc* arg1, const dsc* arg2, FPTR_STATUS err)
|
||||
if (arg2->dsc_dtype <= dtype_varying)
|
||||
{
|
||||
obj2 = INTL_texttype_lookup(tdbb, ttype2, err, NULL);
|
||||
assert(obj2 != NULL);
|
||||
fb_assert(obj2 != NULL);
|
||||
ttype2 = obj2.getType();
|
||||
if (ttype2 == ttype_none || ttype2 == ttype_ascii)
|
||||
bin_cmp = true;
|
||||
@ -834,13 +834,13 @@ USHORT CVT2_make_string2(const dsc* desc,
|
||||
USHORT from_len;
|
||||
USHORT from_interp;
|
||||
|
||||
assert(desc != NULL);
|
||||
assert(address != NULL);
|
||||
assert(err != NULL);
|
||||
assert((((temp != NULL) && (length > 0))
|
||||
fb_assert(desc != NULL);
|
||||
fb_assert(address != NULL);
|
||||
fb_assert(err != NULL);
|
||||
fb_assert((((temp != NULL) && (length > 0))
|
||||
|| ((INTL_TTYPE(desc) <= dtype_any_text)
|
||||
&& (INTL_TTYPE(desc) == to_interp))) || (ptr != NULL));
|
||||
assert((ptr == NULL) || (*ptr == NULL));
|
||||
fb_assert((ptr == NULL) || (*ptr == NULL));
|
||||
|
||||
if (desc->dsc_dtype == dtype_text) {
|
||||
from_buf = desc->dsc_address;
|
||||
|
@ -292,7 +292,7 @@ USHORT DFW_assign_index_type(DFW work, SSHORT field_type, SSHORT ttype)
|
||||
/* Dynamic text cannot occur here as this is for an on-disk
|
||||
index, which must be bound to a text type. */
|
||||
|
||||
assert(ttype != ttype_dynamic);
|
||||
fb_assert(ttype != ttype_dynamic);
|
||||
|
||||
if (INTL_defined_type(tdbb, status, ttype))
|
||||
return INTL_TEXT_TO_INDEX(ttype);
|
||||
@ -1309,7 +1309,7 @@ static void check_dependencies(TDBB tdbb,
|
||||
obj_type = gds_udf_name;
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
if (field_name)
|
||||
@ -1780,7 +1780,7 @@ static bool create_index( TDBB tdbb,
|
||||
}
|
||||
}
|
||||
|
||||
assert(work->dfw_id == dbb->dbb_max_idx);
|
||||
fb_assert(work->dfw_id == dbb->dbb_max_idx);
|
||||
IDX_create_index( tdbb,
|
||||
relation,
|
||||
&idx,
|
||||
@ -1788,7 +1788,7 @@ static bool create_index( TDBB tdbb,
|
||||
&work->dfw_id,
|
||||
transaction,
|
||||
&selectivity);
|
||||
assert(work->dfw_id == idx.idx_id);
|
||||
fb_assert(work->dfw_id == idx.idx_id);
|
||||
DFW_update_index(work, idx.idx_id, selectivity);
|
||||
|
||||
if (partner_relation)
|
||||
@ -2453,7 +2453,7 @@ static bool delete_index(TDBB tdbb, SSHORT phase, DFW work, JRD_TRA transaction)
|
||||
* it for the exclusive lock it would have to be 1.
|
||||
* IF now it is NOT 1 then someone else got a lock to
|
||||
* the index and something is seriously wrong */
|
||||
assert(index->idl_count == 1);
|
||||
fb_assert(index->idl_count == 1);
|
||||
if (!--index->idl_count)
|
||||
{
|
||||
/* Release index existence lock and memory. */
|
||||
@ -3184,7 +3184,7 @@ static bool find_depend_in_dfw( TDBB tdbb,
|
||||
dfw_type = dfw_delete_index;
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3545,7 +3545,7 @@ static FMT make_format(TDBB tdbb, JRD_REL relation, USHORT * version, TFB stack)
|
||||
}
|
||||
}
|
||||
|
||||
assert(offset <= MAX_USHORT);
|
||||
fb_assert(offset <= MAX_USHORT);
|
||||
|
||||
format->fmt_length = (USHORT)offset;
|
||||
|
||||
@ -3843,9 +3843,9 @@ static bool make_version(TDBB tdbb, SSHORT phase, DFW work, JRD_TRA transaction)
|
||||
tfb_ = FB_NEW(*tdbb->tdbb_default) tfb;
|
||||
tfb_->tfb_next = external;
|
||||
external = tfb_;
|
||||
assert(FLD.RDB$EXTERNAL_TYPE <= MAX_UCHAR);
|
||||
fb_assert(FLD.RDB$EXTERNAL_TYPE <= MAX_UCHAR);
|
||||
tfb_->tfb_desc.dsc_dtype = (UCHAR)FLD.RDB$EXTERNAL_TYPE;
|
||||
assert(FLD.RDB$EXTERNAL_SCALE >= MIN_SCHAR &&
|
||||
fb_assert(FLD.RDB$EXTERNAL_SCALE >= MIN_SCHAR &&
|
||||
FLD.RDB$EXTERNAL_SCALE <= MAX_SCHAR);
|
||||
tfb_->tfb_desc.dsc_scale = (SCHAR)FLD.RDB$EXTERNAL_SCALE;
|
||||
tfb_->tfb_desc.dsc_length = FLD.RDB$EXTERNAL_LENGTH;
|
||||
@ -4279,7 +4279,7 @@ static void put_summary_blob(BLB blob, RSR_T type, SLONG blob_id[2])
|
||||
// Go ahead and open blob
|
||||
|
||||
BLB blr = BLB_open(tdbb, dbb->dbb_sys_trans, (BID)blob_id);
|
||||
assert(blr->blb_length <= MAX_USHORT);
|
||||
fb_assert(blr->blb_length <= MAX_USHORT);
|
||||
USHORT length = (USHORT)blr->blb_length;
|
||||
UCHAR* buffer = (length > sizeof(temp)) ?
|
||||
(UCHAR*) gds__alloc((SLONG) blr->blb_length) : temp;
|
||||
|
@ -67,8 +67,8 @@ BOOLEAN DLS_get_temp_space(ULONG size, SFB sfb)
|
||||
MDLS *ptr;
|
||||
BOOLEAN result = FALSE;
|
||||
|
||||
assert(size > (ULONG) 0);
|
||||
assert(sfb);
|
||||
fb_assert(size > (ULONG) 0);
|
||||
fb_assert(sfb);
|
||||
|
||||
ptr = DLS_get_access();
|
||||
|
||||
@ -124,10 +124,10 @@ void DLS_put_temp_space(SFB sfb)
|
||||
if (sfb && sfb->sfb_dls) {
|
||||
ptr = DLS_get_access();
|
||||
#ifdef V4_THREADING
|
||||
assert(ptr->mdls_mutex_init);
|
||||
fb_assert(ptr->mdls_mutex_init);
|
||||
V4_MUTEX_LOCK(ptr->mdls_mutex);
|
||||
#endif
|
||||
assert(sfb->sfb_dls->dls_inuse >= sfb->sfb_file_size);
|
||||
fb_assert(sfb->sfb_dls->dls_inuse >= sfb->sfb_file_size);
|
||||
if (sfb->sfb_dls->dls_inuse > sfb->sfb_file_size)
|
||||
sfb->sfb_dls->dls_inuse -= sfb->sfb_file_size;
|
||||
else
|
||||
|
@ -754,7 +754,7 @@ USHORT DSC_convert_to_text_length(USHORT dsc_type)
|
||||
if (dsc_type < (sizeof(_DSC_convert_to_text_length) /
|
||||
sizeof(_DSC_convert_to_text_length[0])))
|
||||
return _DSC_convert_to_text_length[dsc_type];
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -784,7 +784,7 @@ void DSC_make_descriptor(DSC * desc,
|
||||
static BOOLEAN been_here = FALSE;
|
||||
if (!been_here) {
|
||||
been_here = TRUE;
|
||||
assert(validate_dsc_tables());
|
||||
fb_assert(validate_dsc_tables());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -866,7 +866,7 @@ void DSC_make_descriptor(DSC * desc,
|
||||
desc->dsc_length = 2 * sizeof(SLONG);
|
||||
desc->dsc_dtype = dtype_blob;
|
||||
if (sub_type == BLOB_text) {
|
||||
assert(charset <= MAX_SCHAR);
|
||||
fb_assert(charset <= MAX_SCHAR);
|
||||
desc->dsc_scale = (SCHAR) charset;
|
||||
}
|
||||
break;
|
||||
@ -877,7 +877,7 @@ void DSC_make_descriptor(DSC * desc,
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
desc->dsc_dtype = dtype_null;
|
||||
break;
|
||||
}
|
||||
|
@ -1142,7 +1142,7 @@ static void grant( GBL gbl, UCHAR ** ptr)
|
||||
} else if (id == drq_get_role_nm) {
|
||||
ERR_punt();
|
||||
} else {
|
||||
assert(id == drq_gcg1);
|
||||
fb_assert(id == drq_gcg1);
|
||||
DYN_error_punt(TRUE, 78, NULL, NULL, NULL, NULL, NULL);
|
||||
// msg 78: "SELECT RDB$USER_PRIVILEGES failed in grant"
|
||||
}
|
||||
|
@ -1868,7 +1868,7 @@ void DYN_define_index(GBL gbl,
|
||||
break;
|
||||
|
||||
case gds_dyn_foreign_key_delete:
|
||||
assert(ri_actionP != NULL);
|
||||
fb_assert(ri_actionP != NULL);
|
||||
switch (verb = *(*ptr)++)
|
||||
{
|
||||
case gds_dyn_foreign_key_cascade:
|
||||
@ -1911,13 +1911,13 @@ void DYN_define_index(GBL gbl,
|
||||
(*ri_actionP) |= FOR_KEY_DEL_NONE;
|
||||
break;
|
||||
default:
|
||||
assert(0); /* should not come here */
|
||||
fb_assert(0); /* should not come here */
|
||||
DYN_unsupported_verb();
|
||||
}
|
||||
break;
|
||||
|
||||
case gds_dyn_foreign_key_update:
|
||||
assert(ri_actionP != NULL);
|
||||
fb_assert(ri_actionP != NULL);
|
||||
switch (verb = *(*ptr)++)
|
||||
{
|
||||
case gds_dyn_foreign_key_cascade:
|
||||
@ -1960,7 +1960,7 @@ void DYN_define_index(GBL gbl,
|
||||
(*ri_actionP) |= FOR_KEY_UPD_NONE;
|
||||
break;
|
||||
default:
|
||||
assert(0); /* should not come here */
|
||||
fb_assert(0); /* should not come here */
|
||||
DYN_unsupported_verb();
|
||||
}
|
||||
break;
|
||||
@ -2846,7 +2846,7 @@ void DYN_define_parameter( GBL gbl, UCHAR ** ptr, TEXT * procedure_name)
|
||||
|
||||
/* Control should never reach this point,
|
||||
because id should always have one of the values tested above. */
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
DYN_error_punt(TRUE, 0, NULL, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
@ -3004,7 +3004,7 @@ void DYN_define_procedure( GBL gbl, UCHAR ** ptr)
|
||||
|
||||
/* Control should never reach this point, because id should have
|
||||
one of the values tested-for above. */
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
DYN_error_punt(TRUE, 0, NULL, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
@ -3231,7 +3231,7 @@ void DYN_define_relation( GBL gbl, UCHAR ** ptr)
|
||||
|
||||
/* Control should never reach this point, because id should
|
||||
always have one of the values test-for above. */
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
DYN_error_punt(TRUE, 0, NULL, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
@ -3907,7 +3907,7 @@ void DYN_define_trigger(GBL gbl,
|
||||
case isc_dyn_system_flag:
|
||||
X.RDB$SYSTEM_FLAG = DYN_get_number(ptr);
|
||||
X.RDB$SYSTEM_FLAG.NULL = FALSE;
|
||||
/* assert(!ignore_perm || ignore_perm
|
||||
/* fb_assert(!ignore_perm || ignore_perm
|
||||
&& X.RDB$SYSTEM_FLAG == frb_sysflag_referential_constraint); */
|
||||
break;
|
||||
|
||||
|
@ -2731,7 +2731,7 @@ static ULONG check_update_fld_type(const dyn_fld* orig_fld,
|
||||
USHORT maxflen = DSC_string_length(&orig_fld->dyn_dsc);
|
||||
|
||||
/* We can have this assertion since this case is for both string fields. */
|
||||
assert(DSC_string_length(&new_fld->dyn_dsc) - maxflen
|
||||
fb_assert(DSC_string_length(&new_fld->dyn_dsc) - maxflen
|
||||
== new_fld->dyn_charbytelen - orig_fld->dyn_charbytelen);
|
||||
/* if (new_fld->dyn_dsc.dsc_length < maxflen) */
|
||||
if (DSC_string_length(&new_fld->dyn_dsc) < maxflen)
|
||||
@ -2741,7 +2741,7 @@ static ULONG check_update_fld_type(const dyn_fld* orig_fld,
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
return 87; /* MODIFY RDB$FIELDS FAILED */
|
||||
}
|
||||
break;
|
||||
@ -2902,13 +2902,13 @@ static ULONG check_update_fld_type(const dyn_fld* orig_fld,
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
return 87; /* MODIFY RDB$FIELDS FAILED */
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
return 87; /* MODIFY RDB$FIELDS FAILED */
|
||||
}
|
||||
return FB_SUCCESS;
|
||||
|
@ -132,7 +132,7 @@ SINT64 DYN_UTIL_gen_unique_id(TDBB tdbb,
|
||||
{
|
||||
/* 32 bytes allocated for size of of a metadata name */
|
||||
SCHAR blr[sizeof(gen_id_blr1) + sizeof(gen_id_blr2) + 1 + 32], *p;
|
||||
assert(strlen(generator_name) < 32);
|
||||
fb_assert(strlen(generator_name) < 32);
|
||||
|
||||
p = blr;
|
||||
memcpy(p, gen_id_blr1, sizeof(gen_id_blr1));
|
||||
|
@ -418,7 +418,7 @@ void ERR_post(ISC_STATUS status, ...)
|
||||
|
||||
/* calculate length of the status */
|
||||
PARSE_STATUS(tmp_status, tmp_status_len, warning_indx);
|
||||
assert(warning_indx == 0);
|
||||
fb_assert(warning_indx == 0);
|
||||
|
||||
if (status_vector[0] != gds_arg_gds ||
|
||||
(status_vector[0] == gds_arg_gds && status_vector[1] == 0 &&
|
||||
|
@ -1075,7 +1075,7 @@ static void deliver_request(EVT_REQ request)
|
||||
if (end < p + event->evnt_length + 5)
|
||||
{
|
||||
/* Running out of space - allocate some more and copy it over */
|
||||
assert(event_buffer == buffer); /* we're in this block only once */
|
||||
fb_assert(event_buffer == buffer); /* we're in this block only once */
|
||||
UCHAR* new_buffer = (UCHAR*)gds__alloc((SLONG) MAX_EVENT_BUFFER);
|
||||
/* FREE: at procedure exit */
|
||||
if (!new_buffer)
|
||||
|
@ -19,7 +19,7 @@
|
||||
*
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
* $Id: evl.cpp,v 1.45 2003-11-03 17:14:44 skidder Exp $
|
||||
* $Id: evl.cpp,v 1.46 2003-11-03 23:53:50 brodsom Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -871,7 +871,7 @@ DSC* EVL_expr(TDBB tdbb, JRD_NOD node)
|
||||
if (request->req_timestamp)
|
||||
clock = request->req_timestamp;
|
||||
else {
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
clock = time(0);
|
||||
}
|
||||
times = *localtime(&clock);
|
||||
@ -903,7 +903,7 @@ DSC* EVL_expr(TDBB tdbb, JRD_NOD node)
|
||||
*((GDS_TIMESTAMP *) impure->vlu_desc.dsc_address) = enc_times;
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1039,7 +1039,7 @@ DSC* EVL_expr(TDBB tdbb, JRD_NOD node)
|
||||
part = times.tm_wday;
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
part = 0;
|
||||
}
|
||||
*(USHORT *) impure->vlu_desc.dsc_address = part;
|
||||
@ -1304,7 +1304,7 @@ BOOLEAN EVL_field(JRD_REL relation, REC record, USHORT id, DSC * desc)
|
||||
gds_arg_string, "*** null ***", 0);
|
||||
}
|
||||
|
||||
assert(default_literal->nod_type == nod_literal);
|
||||
fb_assert(default_literal->nod_type == nod_literal);
|
||||
|
||||
DSC* default_desc = &default_literal->lit_desc;
|
||||
desc->dsc_dtype = default_desc->dsc_dtype;
|
||||
@ -1833,7 +1833,7 @@ void EVL_make_value(TDBB tdbb, DSC * desc, VLU value)
|
||||
case dtype_cstring:
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2075,8 +2075,8 @@ USHORT EVL_mb_sleuth_check(TDBB tdbb,
|
||||
SSHORT err_code;
|
||||
USHORT err_pos;
|
||||
|
||||
assert(search != NULL);
|
||||
assert(match != NULL);
|
||||
fb_assert(search != NULL);
|
||||
fb_assert(match != NULL);
|
||||
|
||||
/* Note: search_merge has already converted the match
|
||||
string to wide character (see note in sleuth()) */
|
||||
@ -2131,9 +2131,9 @@ USHORT EVL_mb_sleuth_merge(TDBB tdbb,
|
||||
SSHORT err_code;
|
||||
USHORT err_pos;
|
||||
|
||||
assert(control != NULL);
|
||||
assert(match != NULL);
|
||||
assert(combined != NULL);
|
||||
fb_assert(control != NULL);
|
||||
fb_assert(match != NULL);
|
||||
fb_assert(combined != NULL);
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
@ -2344,7 +2344,7 @@ static DSC *add(DSC * desc, JRD_NOD node, VLU value)
|
||||
SLONG l1, l2;
|
||||
|
||||
DEV_BLKCHK(node, type_nod);
|
||||
assert(node->nod_type == nod_add ||
|
||||
fb_assert(node->nod_type == nod_add ||
|
||||
node->nod_type == nod_subtract ||
|
||||
node->nod_type == nod_total ||
|
||||
node->nod_type == nod_average ||
|
||||
@ -2430,7 +2430,7 @@ static DSC *add2(DSC * desc, JRD_NOD node, VLU value)
|
||||
SINT64 i1, i2;
|
||||
|
||||
DEV_BLKCHK(node, type_nod);
|
||||
assert(node->nod_type == nod_add2 ||
|
||||
fb_assert(node->nod_type == nod_add2 ||
|
||||
node->nod_type == nod_subtract2 ||
|
||||
node->nod_type == nod_average2 ||
|
||||
node->nod_type == nod_agg_total2 ||
|
||||
@ -2534,7 +2534,7 @@ static DSC *add_datetime(DSC * desc, JRD_NOD node, VLU value)
|
||||
**************************************/
|
||||
BYTE dtype; /* Which addition routine to use? */
|
||||
|
||||
assert(node->nod_flags & nod_date);
|
||||
fb_assert(node->nod_flags & nod_date);
|
||||
|
||||
/* Value is the LHS of the operand. desc is the RHS */
|
||||
|
||||
@ -2542,7 +2542,7 @@ static DSC *add_datetime(DSC * desc, JRD_NOD node, VLU value)
|
||||
dtype = DSC_add_result[value->vlu_desc.dsc_dtype][desc->dsc_dtype];
|
||||
}
|
||||
else {
|
||||
assert((node->nod_type == nod_subtract)
|
||||
fb_assert((node->nod_type == nod_subtract)
|
||||
|| (node->nod_type == nod_subtract2));
|
||||
dtype = DSC_sub_result[value->vlu_desc.dsc_dtype][desc->dsc_dtype];
|
||||
|
||||
@ -2606,13 +2606,13 @@ static DSC *add_sql_date(DSC * desc, JRD_NOD node, VLU value)
|
||||
struct tm times;
|
||||
|
||||
DEV_BLKCHK(node, type_nod);
|
||||
assert(node->nod_type == nod_add ||
|
||||
fb_assert(node->nod_type == nod_add ||
|
||||
node->nod_type == nod_subtract ||
|
||||
node->nod_type == nod_add2 || node->nod_type == nod_subtract2);
|
||||
|
||||
result = &value->vlu_desc;
|
||||
|
||||
assert(value->vlu_desc.dsc_dtype == dtype_sql_date ||
|
||||
fb_assert(value->vlu_desc.dsc_dtype == dtype_sql_date ||
|
||||
desc->dsc_dtype == dtype_sql_date);
|
||||
|
||||
/* Coerce operand1 to a count of days */
|
||||
@ -2643,13 +2643,13 @@ static DSC *add_sql_date(DSC * desc, JRD_NOD node, VLU value)
|
||||
return result;
|
||||
}
|
||||
|
||||
assert(op1_is_date || op2_is_date);
|
||||
assert(!(op1_is_date && op2_is_date));
|
||||
fb_assert(op1_is_date || op2_is_date);
|
||||
fb_assert(!(op1_is_date && op2_is_date));
|
||||
|
||||
/* Perform the operation */
|
||||
|
||||
if ((node->nod_type == nod_subtract) || (node->nod_type == nod_subtract2)) {
|
||||
assert(op1_is_date);
|
||||
fb_assert(op1_is_date);
|
||||
d2 = d1 - d2;
|
||||
}
|
||||
else
|
||||
@ -2708,20 +2708,20 @@ static DSC *add_sql_time(DSC * desc, JRD_NOD node, VLU value)
|
||||
BOOLEAN op2_is_time = FALSE;
|
||||
|
||||
DEV_BLKCHK(node, type_nod);
|
||||
assert(node->nod_type == nod_add ||
|
||||
fb_assert(node->nod_type == nod_add ||
|
||||
node->nod_type == nod_subtract ||
|
||||
node->nod_type == nod_add2 || node->nod_type == nod_subtract2);
|
||||
|
||||
result = &value->vlu_desc;
|
||||
|
||||
assert(value->vlu_desc.dsc_dtype == dtype_sql_time ||
|
||||
fb_assert(value->vlu_desc.dsc_dtype == dtype_sql_time ||
|
||||
desc->dsc_dtype == dtype_sql_time);
|
||||
|
||||
/* Coerce operand1 to a count of seconds */
|
||||
if (value->vlu_desc.dsc_dtype == dtype_sql_time) {
|
||||
d1 = *(GDS_TIME *) value->vlu_desc.dsc_address;
|
||||
op1_is_time++;
|
||||
assert(d1 >= 0 && d1 < ISC_TICKS_PER_DAY);
|
||||
fb_assert(d1 >= 0 && d1 < ISC_TICKS_PER_DAY);
|
||||
}
|
||||
else
|
||||
d1 =
|
||||
@ -2731,7 +2731,7 @@ static DSC *add_sql_time(DSC * desc, JRD_NOD node, VLU value)
|
||||
if (desc->dsc_dtype == dtype_sql_time) {
|
||||
d2 = *(GDS_TIME *) desc->dsc_address;
|
||||
op2_is_time++;
|
||||
assert(d2 >= 0 && d2 < ISC_TICKS_PER_DAY);
|
||||
fb_assert(d2 >= 0 && d2 < ISC_TICKS_PER_DAY);
|
||||
}
|
||||
else
|
||||
d2 = MOV_get_int64(desc, ISC_TIME_SECONDS_PRECISION_SCALE);
|
||||
@ -2749,13 +2749,13 @@ static DSC *add_sql_time(DSC * desc, JRD_NOD node, VLU value)
|
||||
return result;
|
||||
}
|
||||
|
||||
assert(op1_is_time || op2_is_time);
|
||||
assert(!(op1_is_time && op2_is_time));
|
||||
fb_assert(op1_is_time || op2_is_time);
|
||||
fb_assert(!(op1_is_time && op2_is_time));
|
||||
|
||||
/* Perform the operation */
|
||||
|
||||
if ((node->nod_type == nod_subtract) || (node->nod_type == nod_subtract2)) {
|
||||
assert(op1_is_time);
|
||||
fb_assert(op1_is_time);
|
||||
d2 = d1 - d2;
|
||||
}
|
||||
else
|
||||
@ -2770,7 +2770,7 @@ static DSC *add_sql_time(DSC * desc, JRD_NOD node, VLU value)
|
||||
/* And make it in the range of values for a day */
|
||||
d2 %= (ISC_TICKS_PER_DAY);
|
||||
|
||||
assert(d2 >= 0 && d2 < ISC_TICKS_PER_DAY);
|
||||
fb_assert(d2 >= 0 && d2 < ISC_TICKS_PER_DAY);
|
||||
|
||||
value->vlu_misc.vlu_sql_time = d2;
|
||||
|
||||
@ -2809,7 +2809,7 @@ static DSC *add_timestamp(DSC * desc, JRD_NOD node, VLU value)
|
||||
struct tm times;
|
||||
|
||||
DEV_BLKCHK(node, type_nod);
|
||||
assert(node->nod_type == nod_add ||
|
||||
fb_assert(node->nod_type == nod_add ||
|
||||
node->nod_type == nod_subtract ||
|
||||
node->nod_type == nod_add2 || node->nod_type == nod_subtract2);
|
||||
|
||||
@ -2955,8 +2955,8 @@ static DSC *add_timestamp(DSC * desc, JRD_NOD node, VLU value)
|
||||
d2 = get_day_fraction(desc);
|
||||
}
|
||||
else {
|
||||
assert((node->nod_type == nod_add) || (node->nod_type == nod_add2));
|
||||
assert(op2_is_timestamp);
|
||||
fb_assert((node->nod_type == nod_add) || (node->nod_type == nod_add2));
|
||||
fb_assert(op2_is_timestamp);
|
||||
d1 = get_day_fraction(&value->vlu_desc);
|
||||
d2 = get_timestamp_to_isc_ticks(desc);
|
||||
};
|
||||
@ -2964,7 +2964,7 @@ static DSC *add_timestamp(DSC * desc, JRD_NOD node, VLU value)
|
||||
/* Perform the operation */
|
||||
|
||||
if ((node->nod_type == nod_subtract) || (node->nod_type == nod_subtract2)) {
|
||||
assert(op1_is_timestamp);
|
||||
fb_assert(op1_is_timestamp);
|
||||
d2 = d1 - d2;
|
||||
}
|
||||
else
|
||||
@ -3003,7 +3003,7 @@ static DSC *add_timestamp(DSC * desc, JRD_NOD node, VLU value)
|
||||
return_result:
|
||||
/* Caution: target of GOTO */
|
||||
|
||||
assert(value->vlu_misc.vlu_timestamp.timestamp_time >= 0 &&
|
||||
fb_assert(value->vlu_misc.vlu_timestamp.timestamp_time >= 0 &&
|
||||
value->vlu_misc.vlu_timestamp.timestamp_time < ISC_TICKS_PER_DAY);
|
||||
|
||||
result->dsc_dtype = dtype_timestamp;
|
||||
@ -4682,7 +4682,7 @@ static SSHORT string_boolean(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
reinterpret_cast < vary * >(temp1),
|
||||
TEMP_SIZE(temp1));
|
||||
|
||||
assert(xtype1 == type1);
|
||||
fb_assert(xtype1 == type1);
|
||||
ret_val = string_function(tdbb, node, l1, p1, l2, p2, type1);
|
||||
}
|
||||
else {
|
||||
@ -4874,9 +4874,9 @@ static DSC *substring(
|
||||
USHORT l1 = BLB_get_segment(tdbb, blob, buffer, waste);
|
||||
offset -= l1;
|
||||
}
|
||||
assert(!offset && !(blob->blb_flags & BLB_eof));
|
||||
fb_assert(!offset && !(blob->blb_flags & BLB_eof));
|
||||
datalen = BLB_get_data(tdbb, blob, buffer, length);
|
||||
assert(datalen && datalen <= length);
|
||||
fb_assert(datalen && datalen <= length);
|
||||
desc.dsc_length = datalen;
|
||||
desc.dsc_address = buffer;
|
||||
INTL_ASSIGN_TTYPE(&desc, value->dsc_scale);
|
||||
|
@ -80,10 +80,10 @@ USHORT LIKENAME(TDBB tdbb, TextType obj, LIKETYPE * p1, SSHORT l1_bytes, /* byte
|
||||
USHORT escape;
|
||||
SSHORT l1, l2;
|
||||
|
||||
assert(p1 != NULL);
|
||||
assert(p2 != NULL);
|
||||
assert((l1_bytes % sizeof(LIKETYPE)) == 0);
|
||||
assert((l2_bytes % sizeof(LIKETYPE)) == 0);
|
||||
fb_assert(p1 != NULL);
|
||||
fb_assert(p2 != NULL);
|
||||
fb_assert((l1_bytes % sizeof(LIKETYPE)) == 0);
|
||||
fb_assert((l2_bytes % sizeof(LIKETYPE)) == 0);
|
||||
|
||||
l1 = l1_bytes / sizeof(LIKETYPE);
|
||||
l2 = l2_bytes / sizeof(LIKETYPE);
|
||||
@ -158,10 +158,10 @@ USHORT MATCHESNAME(TDBB tdbb,
|
||||
MATCHESTYPE c;
|
||||
SSHORT l1, l2;
|
||||
|
||||
assert(p1 != NULL);
|
||||
assert(p2 != NULL);
|
||||
assert((l1_bytes % sizeof(MATCHESTYPE)) == 0);
|
||||
assert((l2_bytes % sizeof(MATCHESTYPE)) == 0);
|
||||
fb_assert(p1 != NULL);
|
||||
fb_assert(p2 != NULL);
|
||||
fb_assert((l1_bytes % sizeof(MATCHESTYPE)) == 0);
|
||||
fb_assert((l2_bytes % sizeof(MATCHESTYPE)) == 0);
|
||||
|
||||
l1 = l1_bytes / sizeof(MATCHESTYPE);
|
||||
l2 = l2_bytes / sizeof(MATCHESTYPE);
|
||||
@ -213,8 +213,8 @@ USHORT SLEUTHNAME(TDBB tdbb_dummy,
|
||||
**************************************/
|
||||
SLEUTHTYPE *end_match, *end_search;
|
||||
|
||||
assert((match_len % sizeof(SLEUTHTYPE)) == 0);
|
||||
assert((search_len % sizeof(SLEUTHTYPE)) == 0);
|
||||
fb_assert((match_len % sizeof(SLEUTHTYPE)) == 0);
|
||||
fb_assert((search_len % sizeof(SLEUTHTYPE)) == 0);
|
||||
|
||||
end_match = match + (match_len / sizeof(SLEUTHTYPE));
|
||||
end_search = search + (search_len / sizeof(SLEUTHTYPE));
|
||||
@ -257,12 +257,12 @@ USHORT SLEUTH_MERGE_NAME(TDBB tdbb_dummy,
|
||||
SLEUTHTYPE c, *comb, **v, *vector[256], **end_vector, *p, max_op,
|
||||
temp[256], *t, *end_match, *end_control;
|
||||
|
||||
assert(match != NULL);
|
||||
assert(control != NULL);
|
||||
assert(combined != NULL);
|
||||
fb_assert(match != NULL);
|
||||
fb_assert(control != NULL);
|
||||
fb_assert(combined != NULL);
|
||||
|
||||
assert((match_bytes % sizeof(SLEUTHTYPE)) == 0);
|
||||
assert((control_bytes % sizeof(SLEUTHTYPE)) == 0);
|
||||
fb_assert((match_bytes % sizeof(SLEUTHTYPE)) == 0);
|
||||
fb_assert((control_bytes % sizeof(SLEUTHTYPE)) == 0);
|
||||
|
||||
end_match = match + (match_bytes / sizeof(SLEUTHTYPE));
|
||||
end_control = control + (control_bytes / sizeof(SLEUTHTYPE));
|
||||
@ -362,12 +362,12 @@ SLEUTHTYPE * match, SLEUTHTYPE * end_match)
|
||||
**************************************/
|
||||
SLEUTHTYPE c, d, *class_, *end_class;
|
||||
|
||||
assert(search != NULL);
|
||||
assert(end_search != NULL);
|
||||
assert(match != NULL);
|
||||
assert(end_match != NULL);
|
||||
assert(search <= end_search);
|
||||
assert(match <= end_match);
|
||||
fb_assert(search != NULL);
|
||||
fb_assert(end_search != NULL);
|
||||
fb_assert(match != NULL);
|
||||
fb_assert(end_match != NULL);
|
||||
fb_assert(search <= end_search);
|
||||
fb_assert(match <= end_match);
|
||||
|
||||
while (match < end_match) {
|
||||
c = *match++;
|
||||
@ -478,9 +478,9 @@ static BOOLEAN SLEUTH_CLASS_NAME(
|
||||
SLEUTHTYPE c;
|
||||
USHORT result;
|
||||
|
||||
assert(class_ != NULL);
|
||||
assert(end_class != NULL);
|
||||
assert(class_ <= end_class);
|
||||
fb_assert(class_ != NULL);
|
||||
fb_assert(end_class != NULL);
|
||||
fb_assert(class_ <= end_class);
|
||||
|
||||
result = TRUE;
|
||||
character = COND_UPPER(obj, character);
|
||||
|
@ -2039,7 +2039,7 @@ static JRD_NOD looper(TDBB tdbb, JRD_REQ request, JRD_NOD in_node)
|
||||
UCHAR op = (UCHAR) (IPTR) node->nod_arg[e_cursor_stmt_op];
|
||||
USHORT number = (USHORT) (IPTR) node->nod_arg[e_cursor_stmt_number];
|
||||
// get RSB and the impure area
|
||||
assert(request->req_cursors && number < request->req_cursors->count());
|
||||
fb_assert(request->req_cursors && number < request->req_cursors->count());
|
||||
RSB rsb = (RSB) (*request->req_cursors)[number];
|
||||
IRSB impure = (IRSB) ((UCHAR*) tdbb->tdbb_request + rsb->rsb_impure);
|
||||
switch (op) {
|
||||
|
@ -779,7 +779,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
else
|
||||
aux->ctlaux_expansion_factor = (EXP_SCALE * 1);
|
||||
|
||||
assert(aux->ctlaux_expansion_factor != 0);
|
||||
fb_assert(aux->ctlaux_expansion_factor != 0);
|
||||
|
||||
control->ctl_total_length =
|
||||
source->ctl_total_length * aux->ctlaux_expansion_factor /
|
||||
@ -804,7 +804,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
128, &err_code, &err_position);
|
||||
aux->ctlaux_expansion_factor = (EXP_SCALE * tmp) / 128;
|
||||
|
||||
assert(aux->ctlaux_expansion_factor != 0);
|
||||
fb_assert(aux->ctlaux_expansion_factor != 0);
|
||||
|
||||
aux->ctlaux_buffer1_len =
|
||||
80 * aux->ctlaux_expansion_factor / EXP_SCALE;
|
||||
@ -815,7 +815,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, CTL control)
|
||||
*/
|
||||
|
||||
aux->ctlaux_buffer1_len = MAX(aux->ctlaux_buffer1_len, 80);
|
||||
assert(aux->ctlaux_buffer1_len != 0);
|
||||
fb_assert(aux->ctlaux_buffer1_len != 0);
|
||||
|
||||
aux->ctlaux_buffer1 =
|
||||
(BYTE *) gds__alloc((SLONG) aux->ctlaux_buffer1_len);
|
||||
@ -1254,7 +1254,7 @@ static void string_put(CTL control, const char* line)
|
||||
string = (TMP) gds__alloc((SLONG) (sizeof(struct tmp) + l));
|
||||
/* FREE: on ACTION_close in string_filter() */
|
||||
if (!string) { /* NOMEM: */
|
||||
assert(FALSE); /* out of memory */
|
||||
fb_assert(FALSE); /* out of memory */
|
||||
return; /* & No error handling at this level */
|
||||
}
|
||||
string->tmp_next = NULL;
|
||||
|
@ -43,7 +43,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
$Id: flu.cpp,v 1.35 2003-09-22 17:52:27 brodsom Exp $
|
||||
$Id: flu.cpp,v 1.36 2003-11-03 23:53:50 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -413,7 +413,7 @@ FPTR_INT ISC_lookup_entrypoint(TEXT * module,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
assert(mod->mod_handle); /* assert that we found the module */
|
||||
fb_assert(mod->mod_handle); /* fb_assert that we found the module */
|
||||
mod->mod_use_count = 0;
|
||||
mod->mod_length = length;
|
||||
strcpy(mod->mod_name, module);
|
||||
@ -501,7 +501,7 @@ FPTR_INT ISC_lookup_entrypoint(TEXT* module,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
assert(mod->mod_handle); /* assert that we found the module */
|
||||
fb_assert(mod->mod_handle); /* fb_assert that we found the module */
|
||||
mod->mod_use_count = 0;
|
||||
mod->mod_length = length;
|
||||
strcpy(mod->mod_name, module);
|
||||
@ -578,7 +578,7 @@ FPTR_INT ISC_lookup_entrypoint(TEXT* module,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
assert(mod->mod_handle); /* assert that we found the module */
|
||||
fb_assert(mod->mod_handle); /* fb_assert that we found the module */
|
||||
mod->mod_use_count = 0;
|
||||
mod->mod_length = length;
|
||||
strcpy(mod->mod_name, module);
|
||||
@ -700,7 +700,7 @@ if (!(mod = FLU_lookup_module (module)))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
assert (mod->mod_handle); /* assert that we found the module */
|
||||
fb_assert (mod->mod_handle); /* fb_assert that we found the module */
|
||||
mod->mod_use_count = 0;
|
||||
mod->mod_length = length;
|
||||
strcpy (mod->mod_name, module);
|
||||
|
@ -30,7 +30,7 @@
|
||||
* 2003.08.10 Claudio Valderrama: Fix SF Bugs #544132 and #728839.
|
||||
*/
|
||||
/*
|
||||
$Id: fun.epp,v 1.26 2003-10-29 10:53:14 robocop Exp $
|
||||
$Id: fun.epp,v 1.27 2003-11-03 23:53:50 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -462,7 +462,7 @@ void FUN_evaluate(FUN function, JRD_NOD node, VLU value)
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
MOV_move(input, &temp_desc);
|
||||
break;
|
||||
|
||||
|
@ -729,7 +729,7 @@ SINT64 API_ROUTINE isc_portable_integer(const UCHAR* ptr, SSHORT length)
|
||||
SINT64 value;
|
||||
SSHORT shift;
|
||||
|
||||
assert(length <= 8);
|
||||
fb_assert(length <= 8);
|
||||
value = shift = 0;
|
||||
|
||||
while (--length >= 0) {
|
||||
@ -1217,8 +1217,8 @@ void API_ROUTINE gds__log_status(const TEXT* database,
|
||||
|
||||
#ifdef DEV_BUILD
|
||||
const size_t db_len = strlen(database);
|
||||
assert(db_len < BUFFER_XLARGE - 2);
|
||||
assert(db_len < MAXPATHLEN);
|
||||
fb_assert(db_len < BUFFER_XLARGE - 2);
|
||||
fb_assert(db_len < MAXPATHLEN);
|
||||
#endif
|
||||
|
||||
const int interpreted_line_length = 80; // raw estimation
|
||||
@ -3353,7 +3353,7 @@ static void blr_print_verb(gds_ctl* control, SSHORT level)
|
||||
}
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3675,7 +3675,7 @@ static void safe_concat_path(TEXT *resultString, const TEXT *appendString)
|
||||
int alen = strlen(appendString);
|
||||
if (len + alen > MAXPATHLEN - 1)
|
||||
alen = MAXPATHLEN - 1 - len;
|
||||
assert(alen >= 0);
|
||||
fb_assert(alen >= 0);
|
||||
memcpy(&resultString[len], appendString, alen);
|
||||
resultString[len + alen] = 0;
|
||||
}
|
||||
|
@ -28,8 +28,8 @@
|
||||
#include "../jrd/gds_proto.h"
|
||||
|
||||
|
||||
/* assert() has been made into a generic version that works across
|
||||
* gds components. Previously, the assert() defined here was only
|
||||
/* fb_assert() has been made into a generic version that works across
|
||||
* gds components. Previously, the fb_assert() defined here was only
|
||||
* usable within the engine.
|
||||
* 1996-Feb-09 David Schnepper
|
||||
*/
|
||||
@ -39,26 +39,20 @@
|
||||
#ifdef SUPERSERVER
|
||||
|
||||
#define fb_assert(ex) {if (!(ex)){gds__log (FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__); abort();}}
|
||||
#define fb_assert_continue(ex) {if (!(ex)){gds__log (FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__);}}
|
||||
|
||||
#else // !SUPERSERVER
|
||||
|
||||
#define fb_assert(ex) {if (!(ex)){ib_fprintf (ib_stderr, FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__); abort();}}
|
||||
#define fb_assert_continue(ex) {if (!(ex)){ib_fprintf (ib_stderr, FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__);}}
|
||||
|
||||
#endif // SUPERSERVER
|
||||
|
||||
#else // DEV_BUILD
|
||||
|
||||
#define fb_assert(ex) // nothing
|
||||
#define fb_assert_continue(ex) // nothing
|
||||
|
||||
#endif // DEV_BUILD
|
||||
|
||||
// It's a bit poor, since assert is a standard macro but this was the way it
|
||||
// was done. It is preferable to use the gds_assert(x) function, but I've left
|
||||
// the following for back compatibility since I don't want to wade through that
|
||||
// much code at the moment.
|
||||
|
||||
#ifndef assert
|
||||
#define assert(ex) fb_assert(ex)
|
||||
#endif // assert
|
||||
|
||||
#endif // JRD_GDSASSERT_H
|
||||
|
@ -389,7 +389,7 @@ void IDX_create_index(
|
||||
l = key.key_length;
|
||||
q = key.key_data;
|
||||
|
||||
assert(l > 0);
|
||||
fb_assert(l > 0);
|
||||
|
||||
do
|
||||
*p++ = *q++;
|
||||
|
@ -828,7 +828,7 @@ void INI_update_database(void)
|
||||
break;
|
||||
default:
|
||||
/* Make sure we add a new case per new major ODS. Look at code above */
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
header->hdr_ods_minor = minor_version;
|
||||
break;
|
||||
}
|
||||
@ -1507,7 +1507,7 @@ static void store_global_field(TDBB tdbb, GFLD* gfield, BLK* handle)
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ CharSetContainer* CharSetContainer::lookupCharset(TDBB tdbb, SSHORT ttype, ISC_S
|
||||
dbb->dbb_charsets[id] = cs;
|
||||
}
|
||||
|
||||
assert(cs != NULL);
|
||||
fb_assert(cs != NULL);
|
||||
return cs;
|
||||
}
|
||||
|
||||
@ -327,8 +327,8 @@ CsConvert CharSetContainer::lookupConverter(TDBB tdbb, CHARSET_ID to_cs)
|
||||
return NULL;
|
||||
}
|
||||
CsConvert converter = cvt;
|
||||
assert(converter.getFromCS() == cs.getId());
|
||||
assert(converter.getToCS() == to_cs);
|
||||
fb_assert(converter.getFromCS() == cs.getId());
|
||||
fb_assert(converter.getToCS() == to_cs);
|
||||
charset_converters.add(converter);
|
||||
return cvt;
|
||||
}
|
||||
@ -419,7 +419,7 @@ static void finish_texttype_init(TEXTTYPE txtobj)
|
||||
txtobj->texttype_fn_mbtowc = (FPTR_short) INTL_builtin_mb_mbtowc;
|
||||
}
|
||||
else
|
||||
assert(0);
|
||||
fb_assert(0);
|
||||
|
||||
txtobj->texttype_flags |= TEXTTYPE_init;
|
||||
}
|
||||
@ -619,11 +619,11 @@ int INTL_compare(TDBB tdbb,
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
assert(pText1 != NULL);
|
||||
assert(pText2 != NULL);
|
||||
assert(IS_TEXT(pText1) && IS_TEXT(pText2));
|
||||
assert(INTL_data_or_binary(pText1) || INTL_data_or_binary(pText2));
|
||||
assert(err);
|
||||
fb_assert(pText1 != NULL);
|
||||
fb_assert(pText2 != NULL);
|
||||
fb_assert(IS_TEXT(pText1) && IS_TEXT(pText2));
|
||||
fb_assert(INTL_data_or_binary(pText1) || INTL_data_or_binary(pText2));
|
||||
fb_assert(err);
|
||||
|
||||
/* normal compare routine from CVT_compare */
|
||||
/* trailing spaces in strings are ignored for comparision */
|
||||
@ -711,9 +711,9 @@ USHORT INTL_convert_bytes(TDBB tdbb,
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
|
||||
assert(src_ptr != NULL);
|
||||
assert(src_type != dest_type);
|
||||
assert(err != NULL);
|
||||
fb_assert(src_ptr != NULL);
|
||||
fb_assert(src_type != dest_type);
|
||||
fb_assert(err != NULL);
|
||||
|
||||
start_dest_ptr = dest_ptr;
|
||||
|
||||
@ -771,7 +771,7 @@ USHORT INTL_convert_bytes(TDBB tdbb,
|
||||
tmp_buffer = (BYTE *) FB_NEW(*tdbb->tdbb_default) char[(SLONG) src_len * sizeof(UCS2_CHAR)];
|
||||
|
||||
cs_obj = from_cs.getConvToUnicode();
|
||||
assert(cs_obj != NULL);
|
||||
fb_assert(cs_obj != NULL);
|
||||
len = cs_obj.convert(tmp_buffer, src_len * 2, src_ptr,
|
||||
src_len, &err_code, &err_position);
|
||||
if (err_code && !((err_code == CS_TRUNCATION_ERROR)
|
||||
@ -793,7 +793,7 @@ USHORT INTL_convert_bytes(TDBB tdbb,
|
||||
(ISC_STATUS) dest_type, 0);
|
||||
}
|
||||
cs_obj = to_cs.getConvFromUnicode();
|
||||
assert(cs_obj != NULL);
|
||||
fb_assert(cs_obj != NULL);
|
||||
len2 = cs_obj.convert(dest_ptr, dest_len, tmp_buffer,
|
||||
len, &err_code, &err_position);
|
||||
|
||||
@ -844,8 +844,8 @@ CsConvert INTL_convert_lookup(TDBB tdbb,
|
||||
|
||||
/* Should from_cs == to_cs? be handled better? YYY */
|
||||
|
||||
assert(from_cs != CS_dynamic);
|
||||
assert(to_cs != CS_dynamic);
|
||||
fb_assert(from_cs != CS_dynamic);
|
||||
fb_assert(to_cs != CS_dynamic);
|
||||
|
||||
charset = CharSetContainer::lookupCharset(tdbb, from_cs, NULL);
|
||||
if (charset == NULL)
|
||||
@ -880,9 +880,9 @@ int INTL_convert_string(dsc* to, const dsc* from, FPTR_STATUS err)
|
||||
if (tdbb == NULL) /* are we in the Engine? */
|
||||
return (1); /* no, then can't access intl gah */
|
||||
|
||||
assert(to != NULL);
|
||||
assert(from != NULL);
|
||||
assert(IS_TEXT(to) && IS_TEXT(from));
|
||||
fb_assert(to != NULL);
|
||||
fb_assert(from != NULL);
|
||||
fb_assert(IS_TEXT(to) && IS_TEXT(from));
|
||||
|
||||
CHARSET_ID from_cs = INTL_charset(tdbb, INTL_TTYPE(from), err);
|
||||
CHARSET_ID to_cs = INTL_charset(tdbb, INTL_TTYPE(to), err);
|
||||
@ -996,7 +996,7 @@ int INTL_data(const dsc* pText)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(pText != NULL);
|
||||
fb_assert(pText != NULL);
|
||||
|
||||
if (!IS_TEXT(pText))
|
||||
return FALSE;
|
||||
@ -1073,12 +1073,12 @@ UCS2_CHAR INTL_getch(TDBB tdbb,
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
assert(obj);
|
||||
assert(ptr);
|
||||
fb_assert(obj);
|
||||
fb_assert(ptr);
|
||||
|
||||
if (*obj == NULL) {
|
||||
*obj = INTL_texttype_lookup(tdbb, t_type, ERR_post, NULL);
|
||||
assert(*obj != NULL);
|
||||
fb_assert(*obj != NULL);
|
||||
}
|
||||
used = obj->mbtowc(&wc, *ptr, *count);
|
||||
if (used == -1)
|
||||
@ -1123,7 +1123,7 @@ USHORT INTL_key_length(TDBB tdbb, USHORT idxType, USHORT iLength)
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
|
||||
assert(idxType >= idx_first_intl_string);
|
||||
fb_assert(idxType >= idx_first_intl_string);
|
||||
|
||||
ttype = INTL_INDEX_TO_TEXT(idxType);
|
||||
|
||||
@ -1232,9 +1232,9 @@ void INTL_pad_spaces(TDBB tdbb, DSC * type, UCHAR * string, USHORT length)
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
assert(type != NULL);
|
||||
assert(IS_TEXT(type));
|
||||
assert(string != NULL);
|
||||
fb_assert(type != NULL);
|
||||
fb_assert(IS_TEXT(type));
|
||||
fb_assert(string != NULL);
|
||||
|
||||
charset = INTL_charset(tdbb, type->dsc_ttype, NULL);
|
||||
pad_spaces(tdbb, charset, string, length);
|
||||
@ -1268,13 +1268,13 @@ USHORT INTL_string_to_key(TDBB tdbb,
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
|
||||
assert(idxType >= idx_first_intl_string || idxType == idx_string
|
||||
fb_assert(idxType >= idx_first_intl_string || idxType == idx_string
|
||||
|| idxType == idx_byte_array || idxType == idx_metadata);
|
||||
assert(pString != NULL);
|
||||
assert(pByte != NULL);
|
||||
assert(pString->dsc_address != NULL);
|
||||
assert(pByte->dsc_address != NULL);
|
||||
assert(pByte->dsc_dtype == dtype_text);
|
||||
fb_assert(pString != NULL);
|
||||
fb_assert(pByte != NULL);
|
||||
fb_assert(pString->dsc_address != NULL);
|
||||
fb_assert(pByte->dsc_address != NULL);
|
||||
fb_assert(pByte->dsc_dtype == dtype_text);
|
||||
|
||||
switch (idxType) {
|
||||
case idx_string:
|
||||
@ -1352,8 +1352,8 @@ int INTL_str_to_upper(TDBB tdbb, DSC * pString)
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
assert(pString != NULL);
|
||||
assert(pString->dsc_address != NULL);
|
||||
fb_assert(pString != NULL);
|
||||
fb_assert(pString->dsc_address != NULL);
|
||||
|
||||
len =
|
||||
CVT_get_string_ptr(pString, &ttype, &src,
|
||||
@ -1440,11 +1440,11 @@ static bool all_spaces(
|
||||
**************************************/
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
assert(ptr != NULL);
|
||||
fb_assert(ptr != NULL);
|
||||
|
||||
CharSet obj = INTL_charset_lookup(tdbb, charset, NULL);
|
||||
|
||||
assert(obj != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
/*
|
||||
* We are assuming offset points to the first byte which was not
|
||||
@ -1496,10 +1496,10 @@ static USHORT nc_to_wc(CSCONVERT obj, UCS2_CHAR * pWide, USHORT nWide, /* byte c
|
||||
UCS2_CHAR *pStart;
|
||||
UCHAR *pNarrowStart;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert((pNarrow != NULL) || (pWide == NULL));
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert((pNarrow != NULL) || (pWide == NULL));
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (pWide == NULL)
|
||||
@ -1536,10 +1536,10 @@ static USHORT wc_to_wc(CSCONVERT obj, UCS2_CHAR * pDest, USHORT nDest, /* byte c
|
||||
UCS2_CHAR *pStart;
|
||||
UCS2_CHAR *pStart_src;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert((pSrc != NULL) || (pDest == NULL));
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert((pSrc != NULL) || (pDest == NULL));
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (pDest == NULL) /* length estimate needed? */
|
||||
@ -1577,11 +1577,11 @@ static void pad_spaces(TDBB tdbb, CHARSET_ID charset, BYTE * ptr, USHORT len)
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
assert(ptr != NULL);
|
||||
fb_assert(ptr != NULL);
|
||||
|
||||
CharSet obj = INTL_charset_lookup(tdbb, charset, NULL);
|
||||
|
||||
assert(obj != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
/* Single-octet character sets are optimized here */
|
||||
if (obj.getSpaceLength() == 1) {
|
||||
@ -1598,10 +1598,10 @@ static void pad_spaces(TDBB tdbb, CHARSET_ID charset, BYTE * ptr, USHORT len)
|
||||
while (ptr < end && space < end_space) {
|
||||
*ptr++ = *space++;
|
||||
}
|
||||
/* This assert is checking that we didn't have a buffer-end
|
||||
/* This fb_assert is checking that we didn't have a buffer-end
|
||||
* in the middle of a space character
|
||||
*/
|
||||
assert(!(ptr == end) || (space == end_space));
|
||||
fb_assert(!(ptr == end) || (space == end_space));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -137,14 +137,14 @@ static SSHORT internal_fss_mbtowc(TEXTTYPE * obj,
|
||||
* Return: (common to all mbtowc routines)
|
||||
* -1 Error in parsing next character
|
||||
* <n> Count of characters consumed.
|
||||
* *wc Next character from byte steam (if wc <> NULL)
|
||||
* *wc Next character from byte stream (if wc <> NULL)
|
||||
*
|
||||
* Note: This routine has a cousin in intl/cv_utffss.c
|
||||
*
|
||||
**************************************/
|
||||
assert(obj);
|
||||
assert(wc);
|
||||
assert(p);
|
||||
fb_assert(obj);
|
||||
fb_assert(wc);
|
||||
fb_assert(p);
|
||||
|
||||
return fss_mbtowc(wc, p, n);
|
||||
}
|
||||
@ -160,10 +160,10 @@ static USHORT internal_fss_to_unicode(CSCONVERT obj,
|
||||
USHORT src_start = src_len;
|
||||
fss_size_t res;
|
||||
|
||||
assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
fb_assert(src_ptr != NULL || dest_ptr == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -179,7 +179,7 @@ static USHORT internal_fss_to_unicode(CSCONVERT obj,
|
||||
*err_code = CS_BAD_INPUT;
|
||||
break;
|
||||
}
|
||||
assert(res <= src_len);
|
||||
fb_assert(res <= src_len);
|
||||
dest_ptr++;
|
||||
dest_len -= sizeof(*dest_ptr);
|
||||
src_ptr += res;
|
||||
@ -205,11 +205,11 @@ USHORT internal_unicode_to_fss(CSCONVERT obj,
|
||||
UCHAR *p;
|
||||
fss_size_t res;
|
||||
|
||||
assert(unicode_str != NULL || fss_str == NULL);
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(obj->csconvert_convert == (FPTR_SHORT) internal_unicode_to_fss);
|
||||
fb_assert(unicode_str != NULL || fss_str == NULL);
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert(obj->csconvert_convert == (FPTR_SHORT) internal_unicode_to_fss);
|
||||
|
||||
*err_code = 0;
|
||||
|
||||
@ -425,8 +425,8 @@ SSHORT INTL_builtin_nc_mbtowc(TEXTTYPE obj,
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(obj);
|
||||
assert(ptr);
|
||||
fb_assert(obj);
|
||||
fb_assert(ptr);
|
||||
|
||||
if (count >= 1) {
|
||||
if (wc)
|
||||
@ -456,8 +456,8 @@ SSHORT INTL_builtin_mb_mbtowc(TEXTTYPE obj,
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(obj);
|
||||
assert(ptr);
|
||||
fb_assert(obj);
|
||||
fb_assert(ptr);
|
||||
|
||||
if (count >= 2) {
|
||||
if (wc)
|
||||
@ -488,8 +488,8 @@ SSHORT INTL_builtin_wc_mbtowc(TEXTTYPE obj,
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(obj);
|
||||
assert(ptr);
|
||||
fb_assert(obj);
|
||||
fb_assert(ptr);
|
||||
|
||||
if (count >= 2) {
|
||||
if (wc)
|
||||
@ -557,10 +557,10 @@ static USHORT wc_to_nc(CSCONVERT obj, NCHAR * pDest, USHORT nDest, /* byte count
|
||||
NCHAR *pStart;
|
||||
UCS2_CHAR *pStart_src;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert((pSrc != NULL) || (pDest == NULL));
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert((pSrc != NULL) || (pDest == NULL));
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (pDest == NULL) /* length estimate needed? */
|
||||
@ -603,10 +603,10 @@ static USHORT mb_to_wc(CSCONVERT obj, UCS2_CHAR * pDest, USHORT nDest, /* byte c
|
||||
UCS2_CHAR *pStart;
|
||||
MBCHAR *pStart_src;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert((pSrc != NULL) || (pDest == NULL));
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert((pSrc != NULL) || (pDest == NULL));
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (pDest == NULL) /* length estimate needed? */
|
||||
@ -646,10 +646,10 @@ static USHORT wc_to_mb(CSCONVERT obj, MBCHAR * pDest, USHORT nDest, /* byte coun
|
||||
MBCHAR *pStart;
|
||||
UCS2_CHAR *pStart_src;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert((pSrc != NULL) || (pDest == NULL));
|
||||
assert(err_code != NULL);
|
||||
assert(err_position != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert((pSrc != NULL) || (pDest == NULL));
|
||||
fb_assert(err_code != NULL);
|
||||
fb_assert(err_position != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (pDest == NULL) /* length estimate needed? */
|
||||
@ -837,9 +837,9 @@ static USHORT cvt_ascii_to_unicode(CSCONVERT obj, UCS2_CHAR * pDest, USHORT nDes
|
||||
UCS2_CHAR *pStart;
|
||||
UCHAR *pStart_src;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert((pSrc != NULL) || (pDest == NULL));
|
||||
assert(err_code != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert((pSrc != NULL) || (pDest == NULL));
|
||||
fb_assert(err_code != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (pDest == NULL) /* length estimate needed? */
|
||||
@ -882,9 +882,9 @@ static USHORT cvt_unicode_to_ascii(CSCONVERT obj, NCHAR * pDest, USHORT nDest, /
|
||||
NCHAR *pStart;
|
||||
UCS2_CHAR *pStart_src;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert((pSrc != NULL) || (pDest == NULL));
|
||||
assert(err_code != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert((pSrc != NULL) || (pDest == NULL));
|
||||
fb_assert(err_code != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (pDest == NULL) /* length estimate needed? */
|
||||
@ -927,9 +927,9 @@ static USHORT cvt_none_to_unicode(CSCONVERT obj, UCS2_CHAR * pDest, USHORT nDest
|
||||
UCS2_CHAR *pStart;
|
||||
UCHAR *pStart_src;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert((pSrc != NULL) || (pDest == NULL));
|
||||
assert(err_code != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert((pSrc != NULL) || (pDest == NULL));
|
||||
fb_assert(err_code != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (pDest == NULL) /* length estimate needed? */
|
||||
@ -977,9 +977,9 @@ static USHORT cvt_utffss_to_ascii(CSCONVERT obj, UCHAR * pDest, USHORT nDest, /*
|
||||
UCHAR *pStart;
|
||||
UCHAR *pStart_src;
|
||||
|
||||
assert(obj != NULL);
|
||||
assert((pSrc != NULL) || (pDest == NULL));
|
||||
assert(err_code != NULL);
|
||||
fb_assert(obj != NULL);
|
||||
fb_assert((pSrc != NULL) || (pDest == NULL));
|
||||
fb_assert(err_code != NULL);
|
||||
|
||||
*err_code = 0;
|
||||
if (pDest == NULL) /* length estimate needed? */
|
||||
@ -1187,7 +1187,7 @@ FPTR_SHORT INTL_builtin_lookup(USHORT objtype, SSHORT parm1, SSHORT parm2) {
|
||||
/* Converting TO character set NONE should have been handled at
|
||||
* a higher level
|
||||
*/
|
||||
assert(parm1 != CS_NONE);
|
||||
fb_assert(parm1 != CS_NONE);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
|
@ -38,8 +38,8 @@ public:
|
||||
TextType(const TextType& obj) : tt(obj.tt) {}
|
||||
|
||||
USHORT key_length(USHORT a) {
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_key_length);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_key_length);
|
||||
return (*(reinterpret_cast<USHORT (*)(TEXTTYPE,USHORT)>
|
||||
(tt->texttype_fn_key_length)))(tt,a);
|
||||
}
|
||||
@ -50,8 +50,8 @@ public:
|
||||
UCHAR *d,
|
||||
USHORT e)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_string_to_key);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_string_to_key);
|
||||
return (*(reinterpret_cast
|
||||
<USHORT(*)(TEXTTYPE,USHORT,UCHAR*,USHORT,UCHAR*,USHORT)>
|
||||
(tt->texttype_fn_string_to_key)))
|
||||
@ -63,8 +63,8 @@ public:
|
||||
USHORT c,
|
||||
UCHAR *d)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_compare);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_compare);
|
||||
return (*(reinterpret_cast
|
||||
<short (*)(TEXTTYPE,USHORT,UCHAR*,USHORT,UCHAR*)>
|
||||
(tt->texttype_fn_compare)))(tt,a,b,c,d);
|
||||
@ -72,8 +72,8 @@ public:
|
||||
|
||||
USHORT to_upper(USHORT a)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_to_upper);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_to_upper);
|
||||
return (*(reinterpret_cast
|
||||
<short (*)(TEXTTYPE,USHORT)>
|
||||
(tt->texttype_fn_to_upper)))(tt,a);
|
||||
@ -81,8 +81,8 @@ public:
|
||||
|
||||
USHORT to_lower(USHORT a)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_to_lower);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_to_lower);
|
||||
return (*(reinterpret_cast
|
||||
<USHORT (*)(TEXTTYPE,USHORT)>
|
||||
(tt->texttype_fn_to_lower)))(tt,a);
|
||||
@ -93,8 +93,8 @@ public:
|
||||
USHORT c,
|
||||
UCHAR *d)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_str_to_upper);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_str_to_upper);
|
||||
return (*(reinterpret_cast
|
||||
<short (*)(TEXTTYPE,USHORT,UCHAR*,USHORT,UCHAR*)>
|
||||
(tt->texttype_fn_str_to_upper)))
|
||||
@ -108,8 +108,8 @@ public:
|
||||
SSHORT *e,
|
||||
USHORT *f)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_to_wc);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_to_wc);
|
||||
return (*(reinterpret_cast
|
||||
<USHORT (*)(TEXTTYPE,UCS2_CHAR*,USHORT,UCHAR*,USHORT,short*,USHORT*)>
|
||||
(tt->texttype_fn_to_wc)))
|
||||
@ -118,8 +118,8 @@ public:
|
||||
|
||||
USHORT mbtowc(UCS2_CHAR *a, UCHAR *b, USHORT c)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_mbtowc);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_mbtowc);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT (*)(TEXTTYPE, UCS2_CHAR*, UCHAR*, USHORT)>
|
||||
(tt->texttype_fn_mbtowc)))(tt,a,b,c);
|
||||
@ -130,8 +130,8 @@ public:
|
||||
UCHAR *d,
|
||||
USHORT e)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_contains);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_contains);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT (*)(class tdbb *,TextType,UCHAR*,USHORT,UCHAR*,USHORT)>
|
||||
(tt->texttype_fn_contains)))
|
||||
@ -144,8 +144,8 @@ public:
|
||||
SSHORT d,
|
||||
SSHORT e)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_like);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_like);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT(*)(class tdbb *,TextType,UCHAR*,short,UCHAR*,short,short)>
|
||||
(tt->texttype_fn_like)))(tdbb,tt,a,b,c,d,e);
|
||||
@ -153,8 +153,8 @@ public:
|
||||
|
||||
USHORT matches(class tdbb *tdbb, UCHAR *a, SSHORT b, UCHAR *c, SSHORT d)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_matches);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_matches);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT (*)(class tdbb *,TextType,UCHAR*,short,UCHAR*,short)>
|
||||
(tt->texttype_fn_matches)))
|
||||
@ -167,8 +167,8 @@ public:
|
||||
UCHAR *d,
|
||||
USHORT e)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_sleuth_check);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_sleuth_check);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT(*)(class tdbb *,TextType,USHORT,UCHAR*,USHORT,UCHAR*,USHORT)>
|
||||
(tt->texttype_fn_sleuth_check)))
|
||||
@ -182,8 +182,8 @@ public:
|
||||
UCHAR *e,
|
||||
USHORT f)
|
||||
{
|
||||
assert(tt);
|
||||
assert(tt->texttype_fn_sleuth_merge);
|
||||
fb_assert(tt);
|
||||
fb_assert(tt->texttype_fn_sleuth_merge);
|
||||
return (*(reinterpret_cast<
|
||||
USHORT(*)(class tdbb *,TextType,UCHAR*,USHORT,UCHAR*,USHORT,UCHAR*,USHORT)>
|
||||
(tt->texttype_fn_sleuth_merge)))
|
||||
@ -192,27 +192,27 @@ public:
|
||||
|
||||
|
||||
USHORT getType() const {
|
||||
assert(tt);
|
||||
fb_assert(tt);
|
||||
return tt->texttype_type;
|
||||
}
|
||||
|
||||
const char *getName() const {
|
||||
assert(tt);
|
||||
fb_assert(tt);
|
||||
return tt->texttype_name;
|
||||
}
|
||||
|
||||
CHARSET_ID getCharSet() const {
|
||||
assert(tt);
|
||||
fb_assert(tt);
|
||||
return tt->texttype_character_set;
|
||||
}
|
||||
|
||||
SSHORT getCountry() const {
|
||||
assert(tt);
|
||||
fb_assert(tt);
|
||||
return tt->texttype_country;
|
||||
}
|
||||
|
||||
UCHAR getBytesPerChar() const {
|
||||
assert(tt);
|
||||
fb_assert(tt);
|
||||
return tt->texttype_bytes_per_char;
|
||||
}
|
||||
|
||||
@ -243,18 +243,19 @@ public:
|
||||
SSHORT *e,
|
||||
USHORT *f)
|
||||
{
|
||||
assert(cnvt != NULL);
|
||||
fb_assert(cnvt != NULL);
|
||||
return (*(reinterpret_cast<USHORT (*)(struct csconvert*, UCHAR*,USHORT,
|
||||
UCHAR*,USHORT,short*,USHORT*)>(cnvt->csconvert_convert)))
|
||||
(cnvt,a,b,c,d,e,f);
|
||||
}
|
||||
|
||||
SSHORT getId() const { assert(cnvt); return cnvt->csconvert_id; }
|
||||
const char *getName() const { assert(cnvt); return cnvt->csconvert_name; }
|
||||
CHARSET_ID getFromCS() const { assert(cnvt); return cnvt->csconvert_from; }
|
||||
CHARSET_ID getToCS() const { assert(cnvt); return cnvt->csconvert_to; }
|
||||
SSHORT getId() const { fb_assert(cnvt); return cnvt->csconvert_id; }
|
||||
const char *getName() const { fb_assert(cnvt); return cnvt->csconvert_name; }
|
||||
CHARSET_ID getFromCS() const { fb_assert(cnvt); return cnvt->csconvert_from; }
|
||||
CHARSET_ID getToCS() const { fb_assert(cnvt); return cnvt->csconvert_to; }
|
||||
|
||||
struct csconvert *getStruct() const { return cnvt; }
|
||||
|
||||
private:
|
||||
struct csconvert *cnvt;
|
||||
};
|
||||
@ -273,18 +274,19 @@ public:
|
||||
CharSet(struct charset *_cs) : cs(_cs) {}
|
||||
CharSet(const CharSet &obj) : cs(obj.cs) {};
|
||||
|
||||
CHARSET_ID getId() const { assert(cs); return cs->charset_id; }
|
||||
const char *getName() const { assert(cs); return cs->charset_name; }
|
||||
UCHAR minBytesPerChar() const { assert(cs); return cs->charset_min_bytes_per_char; }
|
||||
UCHAR maxBytesPerChar() const { assert(cs); return cs->charset_max_bytes_per_char; }
|
||||
UCHAR getSpaceLength() const { assert(cs); return cs->charset_space_length; }
|
||||
const UCHAR *getSpace() const { assert(cs); return cs->charset_space_character; }
|
||||
CHARSET_ID getId() const { fb_assert(cs); return cs->charset_id; }
|
||||
const char *getName() const { fb_assert(cs); return cs->charset_name; }
|
||||
UCHAR minBytesPerChar() const { fb_assert(cs); return cs->charset_min_bytes_per_char; }
|
||||
UCHAR maxBytesPerChar() const { fb_assert(cs); return cs->charset_max_bytes_per_char; }
|
||||
UCHAR getSpaceLength() const { fb_assert(cs); return cs->charset_space_length; }
|
||||
const UCHAR *getSpace() const { fb_assert(cs); return cs->charset_space_character; }
|
||||
|
||||
CsConvert getConvToUnicode() { assert(cs); return &cs->charset_to_unicode; }
|
||||
CsConvert getConvToUnicode() { fb_assert(cs); return &cs->charset_to_unicode; }
|
||||
|
||||
CsConvert getConvFromUnicode() { assert(cs); return &cs->charset_from_unicode; }
|
||||
CsConvert getConvFromUnicode() { fb_assert(cs); return &cs->charset_from_unicode; }
|
||||
|
||||
struct charset *getStruct() const { return cs; }
|
||||
|
||||
private:
|
||||
struct charset *cs;
|
||||
};
|
||||
|
@ -44,9 +44,9 @@
|
||||
|
||||
#ifdef SOLARIS
|
||||
#ifndef DEV_BUILD
|
||||
#define NDEBUG // Turn off assert() macros
|
||||
#define NDEBUG // Turn off fb_assert() macros
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include "../jrd/gdsassert.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SETJMP_H
|
||||
@ -405,7 +405,7 @@ int ISC_event_wait(SSHORT count,
|
||||
we never actually make use of it. This implementation wont
|
||||
support it anyway as Solaris doesn't provide a "wait for one
|
||||
of a series of conditions" function */
|
||||
assert(count == 1);
|
||||
fb_assert(count == 1);
|
||||
|
||||
/* If we're not blocked, the rest is a gross waste of time */
|
||||
|
||||
@ -614,7 +614,7 @@ int ISC_event_post(EVENT event)
|
||||
#ifdef HP10
|
||||
|
||||
{
|
||||
assert(ret == -1);
|
||||
fb_assert(ret == -1);
|
||||
gds__log
|
||||
("ISC_event_post: pthread_cond_broadcast failed with errno = %d",
|
||||
errno);
|
||||
@ -660,7 +660,7 @@ int ISC_event_wait(
|
||||
we never actually make use of it. This implementation wont
|
||||
support it anyway as Solaris doesn't provide a "wait for one
|
||||
of a series of conditions" function */
|
||||
assert(count == 1);
|
||||
fb_assert(count == 1);
|
||||
|
||||
/* If we're not blocked, the rest is a gross waste of time */
|
||||
|
||||
@ -2391,7 +2391,7 @@ UCHAR *ISC_map_file(ISC_STATUS * status_vector,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
assert(length <= buf.shm_segsz);
|
||||
fb_assert(length <= buf.shm_segsz);
|
||||
if (length < buf.shm_segsz)
|
||||
if (length) {
|
||||
if (shmctl(shmid, IPC_RMID, &buf) == -1) {
|
||||
@ -3180,7 +3180,7 @@ int ISC_mutex_lock(MTX mutex)
|
||||
state = pthread_mutex_lock(mutex->mtx_mutex);
|
||||
if (!state)
|
||||
return 0;
|
||||
assert(state == -1); /* if state is not 0, it should be -1 */
|
||||
fb_assert(state == -1); /* if state is not 0, it should be -1 */
|
||||
return errno;
|
||||
|
||||
#else
|
||||
@ -3226,7 +3226,7 @@ int ISC_mutex_lock_cond(MTX mutex)
|
||||
if (state == 1)
|
||||
return 0;
|
||||
|
||||
assert(state == -1); /* if state is not 0 or 1, it should be -1 */
|
||||
fb_assert(state == -1); /* if state is not 0 or 1, it should be -1 */
|
||||
return errno;
|
||||
|
||||
#else
|
||||
@ -3256,7 +3256,7 @@ int ISC_mutex_unlock(MTX mutex)
|
||||
state = pthread_mutex_unlock(mutex->mtx_mutex);
|
||||
if (!state)
|
||||
return 0;
|
||||
assert(state == -1); /* if state is not 0, it should be -1 */
|
||||
fb_assert(state == -1); /* if state is not 0, it should be -1 */
|
||||
return errno;
|
||||
|
||||
#else
|
||||
|
@ -485,14 +485,14 @@ static TDBB get_thread_data()
|
||||
inline static void CHECK_DBB(DBB dbb)
|
||||
{
|
||||
#ifdef DEV_BUILD
|
||||
assert(dbb && MemoryPool::blk_type(dbb) == type_dbb);
|
||||
fb_assert(dbb && MemoryPool::blk_type(dbb) == type_dbb);
|
||||
#endif // DEV_BUILD
|
||||
}
|
||||
|
||||
inline static void check_tdbb(TDBB tdbb)
|
||||
{
|
||||
#ifdef DEV_BUILD
|
||||
assert(tdbb &&
|
||||
fb_assert(tdbb &&
|
||||
(reinterpret_cast<THDD>(tdbb)->thdd_type == THDD_TYPE_TDBB) &&
|
||||
(!tdbb->tdbb_database ||
|
||||
MemoryPool::blk_type(tdbb->tdbb_database) == type_dbb));
|
||||
@ -1568,7 +1568,7 @@ ISC_STATUS GDS_CANCEL_OPERATION(ISC_STATUS * user_status,
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
}
|
||||
|
||||
return FB_SUCCESS;
|
||||
@ -2381,7 +2381,7 @@ ISC_STATUS GDS_DETACH(ISC_STATUS * user_status, ATT * handle)
|
||||
#ifdef GOVERNOR
|
||||
if (JRD_max_users) {
|
||||
if (!(attachment_flags & ATT_security_db)) {
|
||||
assert(num_attached > 0);
|
||||
fb_assert(num_attached > 0);
|
||||
num_attached--;
|
||||
}
|
||||
}
|
||||
@ -2561,7 +2561,7 @@ ISC_STATUS GDS_DROP_DATABASE(ISC_STATUS * user_status, ATT * handle)
|
||||
|
||||
#ifdef GOVERNOR
|
||||
if (JRD_max_users) {
|
||||
assert(num_attached > 0);
|
||||
fb_assert(num_attached > 0);
|
||||
num_attached--;
|
||||
}
|
||||
#endif /* GOVERNOR */
|
||||
@ -4225,8 +4225,8 @@ USHORT JRD_getdir(TEXT * buf, USHORT len)
|
||||
**************************************/
|
||||
char* t_data = NULL;
|
||||
|
||||
assert(buf != NULL);
|
||||
assert(len > 0);
|
||||
fb_assert(buf != NULL);
|
||||
fb_assert(len > 0);
|
||||
|
||||
THD_getspecific_data((void**) &t_data);
|
||||
|
||||
@ -6361,7 +6361,7 @@ TEXT* JRD_num_attachments(TEXT* const buf, USHORT buf_len, USHORT flag,
|
||||
lbufp += dbfp->dbf_length;
|
||||
total++;
|
||||
}
|
||||
assert(total == num_dbs);
|
||||
fb_assert(total == num_dbs);
|
||||
lbufp = lbuf;
|
||||
*lbufp++ = (TEXT) total;
|
||||
*lbufp++ = total >> 8;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#ifndef JRD_JRD_H
|
||||
#define JRD_JRD_H
|
||||
|
||||
#include "../jrd/gdsassert.h"
|
||||
#include "../jrd./gdsassert.h"
|
||||
#include "../jrd/common.h"
|
||||
#include "../jrd/dsc.h"
|
||||
#include "../jrd/all.h"
|
||||
@ -1003,8 +1003,8 @@ extern TDBB gdbb;
|
||||
? (PLATFORM_GET_THREAD_DATA) \
|
||||
: (BUGCHECK (147), (PLATFORM_GET_THREAD_DATA))) \
|
||||
: (PLATFORM_GET_THREAD_DATA))
|
||||
#define CHECK_DBB(dbb) assert ((dbb) && (MemoryPool::blk_type(dbb) == type_dbb) && ((dbb)->dbb_permanent->verify_pool()))
|
||||
#define CHECK_TDBB(tdbb) assert ((tdbb) && \
|
||||
#define CHECK_DBB(dbb) fb_assert ((dbb) && (MemoryPool::blk_type(dbb) == type_dbb) && ((dbb)->dbb_permanent->verify_pool()))
|
||||
#define CHECK_TDBB(tdbb) fb_assert ((tdbb) && \
|
||||
(((THDD)(tdbb))->thdd_type == THDD_TYPE_TDBB) && \
|
||||
((!(tdbb)->tdbb_database)||MemoryPool::blk_type((tdbb)->tdbb_database) == type_dbb))
|
||||
#else
|
||||
|
@ -457,7 +457,7 @@ void JRN_make_init_data(
|
||||
|
||||
if (len = b_length) {
|
||||
*t++ = gds_dpb_wal_backup_dir;
|
||||
assert(b_length <= MAX_UCHAR);
|
||||
fb_assert(b_length <= MAX_UCHAR);
|
||||
*t++ = (UCHAR) b_length;
|
||||
q = backup_dir;
|
||||
do
|
||||
@ -467,7 +467,7 @@ void JRN_make_init_data(
|
||||
|
||||
if (len = db_len) {
|
||||
*t++ = JRNW_DB_NAME;
|
||||
assert(db_len <= MAX_UCHAR);
|
||||
fb_assert(db_len <= MAX_UCHAR);
|
||||
*t++ = (UCHAR) db_len;
|
||||
q = db_name;
|
||||
do
|
||||
@ -645,7 +645,7 @@ SLONG p_offset, USHORT mode, USHORT file_count, USHORT * dump_id, USHORT type)
|
||||
struct jrnr reply;
|
||||
int ret_val;
|
||||
|
||||
assert(type <= MAX_UCHAR);
|
||||
fb_assert(type <= MAX_UCHAR);
|
||||
|
||||
jrnwal.ltjw_header.jrnh_type = (UCHAR) type;
|
||||
jrnwal.ltjw_mode = mode;
|
||||
|
118
src/jrd/lck.cpp
118
src/jrd/lck.cpp
@ -178,7 +178,7 @@ JMB: As part of the c++ conversion I removed the check for lck block type.
|
||||
|
||||
/* The following check should be part of LCK_CHECK_LOCK, but it fails
|
||||
when the exclusive attachment to a database is changed to a shared
|
||||
attachment. When that occurs we assert all our internal locks, but
|
||||
attachment. When that occurs we fb_assert all our internal locks, but
|
||||
while we are in the process of asserting DBB_assert_locks is set, but
|
||||
we haven't gotten physical locks yet.
|
||||
|
||||
@ -213,14 +213,14 @@ void LCK_assert(TDBB tdbb, LCK lock)
|
||||
**************************************/
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
if (lock->lck_logical == lock->lck_physical ||
|
||||
lock->lck_logical == LCK_none) return;
|
||||
|
||||
if (!LCK_lock(tdbb, lock, lock->lck_logical, LCK_WAIT))
|
||||
BUGCHECK(159); /* msg 159 cannot assert logical lock */
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
BUGCHECK(159); /* msg 159 cannot fb_assert logical lock */
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
}
|
||||
|
||||
|
||||
@ -240,7 +240,7 @@ int LCK_convert(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
DBB dbb;
|
||||
int result;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
dbb = lock->lck_dbb;
|
||||
@ -262,7 +262,7 @@ int LCK_convert(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
if (!lock->lck_compatible)
|
||||
lock->lck_physical = lock->lck_logical = level;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ int LCK_convert_non_blocking(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
int result;
|
||||
DBB dbb;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
dbb = lock->lck_dbb;
|
||||
@ -332,7 +332,7 @@ int LCK_convert_non_blocking(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
if (!lock->lck_compatible)
|
||||
lock->lck_physical = lock->lck_logical = level;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -353,7 +353,7 @@ int LCK_convert_non_blocking(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
SET_TDBB(tdbb);
|
||||
return LCK_convert(tdbb, lock, level, wait);
|
||||
}
|
||||
@ -376,7 +376,7 @@ int LCK_convert_opt(TDBB tdbb, LCK lock, USHORT level)
|
||||
DBB dbb;
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
old_level = lock->lck_logical;
|
||||
lock->lck_logical = level;
|
||||
dbb = lock->lck_dbb;
|
||||
@ -386,7 +386,7 @@ int LCK_convert_opt(TDBB tdbb, LCK lock, USHORT level)
|
||||
return LCK_convert(tdbb, lock, level, LCK_NO_WAIT);
|
||||
}
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -407,12 +407,12 @@ int LCK_downgrade(TDBB tdbb, LCK lock)
|
||||
ISC_STATUS *status;
|
||||
USHORT level;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
status = tdbb->tdbb_status_vector;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
if (lock->lck_id && lock->lck_physical != LCK_none) {
|
||||
level = DOWNGRADE(lock, status);
|
||||
@ -423,7 +423,7 @@ int LCK_downgrade(TDBB tdbb, LCK lock)
|
||||
if (lock->lck_physical == LCK_none)
|
||||
lock->lck_id = lock->lck_data = 0;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
@ -586,7 +586,7 @@ int LCK_lock(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
ISC_STATUS *status;
|
||||
DBB dbb;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
dbb = lock->lck_dbb;
|
||||
@ -596,7 +596,7 @@ int LCK_lock(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
lock->lck_attachment = tdbb->tdbb_attachment;
|
||||
|
||||
ENQUEUE(lock, level, wait);
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
if (!lock->lck_id)
|
||||
if (!wait ||
|
||||
status[1] == gds_deadlock ||
|
||||
@ -612,7 +612,7 @@ int LCK_lock(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
if (!lock->lck_compatible)
|
||||
lock->lck_physical = lock->lck_logical = level;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -636,7 +636,7 @@ int LCK_lock_non_blocking(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
LCK next;
|
||||
DBB dbb;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
dbb = lock->lck_dbb;
|
||||
@ -658,7 +658,7 @@ int LCK_lock_non_blocking(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
deal of grief */
|
||||
|
||||
ENQUEUE(lock, level, LCK_NO_WAIT);
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
if (!lock->lck_id) {
|
||||
/* Save context and checkout from the scheduler */
|
||||
|
||||
@ -683,7 +683,7 @@ int LCK_lock_non_blocking(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
#endif
|
||||
AST_ENABLE;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
/* If lock was rejected, there's trouble */
|
||||
|
||||
@ -712,13 +712,13 @@ int LCK_lock_non_blocking(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
if (next = lock->lck_next)
|
||||
next->lck_prior = lock;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
return TRUE;
|
||||
|
||||
#else
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
return LCK_lock(tdbb, lock, level, wait);
|
||||
#endif
|
||||
@ -739,7 +739,7 @@ int LCK_lock_opt(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
**************************************/
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
lock->lck_logical = level;
|
||||
DBB dbb = lock->lck_dbb;
|
||||
|
||||
@ -748,7 +748,7 @@ int LCK_lock_opt(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
return LCK_lock(tdbb, lock, level, wait);
|
||||
}
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -769,7 +769,7 @@ SLONG LCK_query_data(LCK parent, enum lck_t lock_type, USHORT aggregate)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(LCK_CHECK_LOCK(parent));
|
||||
fb_assert(LCK_CHECK_LOCK(parent));
|
||||
return LOCK_query_data(parent->lck_id, lock_type, aggregate);
|
||||
}
|
||||
#endif
|
||||
@ -790,7 +790,7 @@ SLONG LCK_read_data(LCK lock)
|
||||
SLONG data;
|
||||
LCK parent;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
#ifdef VMS
|
||||
if (!LCK_lock(NULL, lock, LCK_null, LCK_NO_WAIT))
|
||||
return 0;
|
||||
@ -805,7 +805,7 @@ SLONG LCK_read_data(LCK lock)
|
||||
lock->lck_length, lock->lck_owner_handle);
|
||||
#endif
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -828,7 +828,7 @@ void LCK_release(TDBB tdbb, LCK lock)
|
||||
#endif
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
if (lock->lck_physical != LCK_none) {
|
||||
DEQUEUE(lock);
|
||||
@ -843,7 +843,7 @@ void LCK_release(TDBB tdbb, LCK lock)
|
||||
LCK prior = lock->lck_prior;
|
||||
|
||||
if (prior) {
|
||||
assert(prior->lck_next == lock);
|
||||
fb_assert(prior->lck_next == lock);
|
||||
prior->lck_next = next;
|
||||
}
|
||||
else if (attachment) {
|
||||
@ -852,7 +852,7 @@ void LCK_release(TDBB tdbb, LCK lock)
|
||||
}
|
||||
|
||||
if (next) {
|
||||
assert(next->lck_prior == lock);
|
||||
fb_assert(next->lck_prior == lock);
|
||||
next->lck_prior = prior;
|
||||
}
|
||||
|
||||
@ -863,7 +863,7 @@ void LCK_release(TDBB tdbb, LCK lock)
|
||||
JRD_unblock(&lock->lck_blocked_threads);
|
||||
#endif
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
}
|
||||
|
||||
|
||||
@ -881,7 +881,7 @@ void LCK_re_post(LCK lock)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
if (lock->lck_compatible) {
|
||||
if (lock->lck_ast) {
|
||||
(*lock->lck_ast)(lock->lck_object);
|
||||
@ -890,7 +890,7 @@ void LCK_re_post(LCK lock)
|
||||
}
|
||||
|
||||
LOCK_re_post(lock->lck_ast, lock->lck_object, lock->lck_owner_handle);
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
}
|
||||
|
||||
|
||||
@ -907,10 +907,10 @@ void LCK_write_data(LCK lock, SLONG data)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
LOCK_write_data(lock->lck_id, data);
|
||||
lock->lck_data = data;
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
}
|
||||
|
||||
|
||||
@ -952,7 +952,7 @@ static void check_lock(LCK lock, USHORT level)
|
||||
**************************************/
|
||||
LCK next;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
while (next = find_block(lock, level))
|
||||
JRD_blocked(next->lck_attachment, &next->lck_blocked_threads);
|
||||
}
|
||||
@ -974,8 +974,8 @@ static BOOLEAN compatible(LCK lock1, LCK lock2, USHORT level2)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock1));
|
||||
assert(LCK_CHECK_LOCK(lock2));
|
||||
fb_assert(LCK_CHECK_LOCK(lock1));
|
||||
fb_assert(LCK_CHECK_LOCK(lock2));
|
||||
|
||||
/* if the locks have the same compatibility block,
|
||||
they are always compatible regardless of level */
|
||||
@ -1016,7 +1016,7 @@ static void enqueue(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
lock->lck_id = LOCK_enq(lock->lck_id,
|
||||
(parent = lock->lck_parent) ? parent->lck_id : 0,
|
||||
@ -1029,7 +1029,7 @@ static void enqueue(TDBB tdbb, LCK lock, USHORT level, SSHORT wait)
|
||||
tdbb->tdbb_status_vector, lock->lck_owner_handle);
|
||||
if (!lock->lck_id)
|
||||
lock->lck_physical = lock->lck_logical = LCK_none;
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
}
|
||||
|
||||
|
||||
@ -1049,7 +1049,7 @@ static void external_ast(LCK lock)
|
||||
**************************************/
|
||||
LCK match, next;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
/* go through the list, saving the next lock in the list
|
||||
in case the current one gets deleted in the ast */
|
||||
@ -1083,7 +1083,7 @@ static LCK find_block(LCK lock, USHORT level)
|
||||
DBB dbb;
|
||||
ATT attachment;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
dbb = lock->lck_dbb;
|
||||
|
||||
@ -1159,7 +1159,7 @@ static void hash_allocate(LCK lock)
|
||||
DBB dbb;
|
||||
ATT att;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
dbb = lock->lck_dbb;
|
||||
|
||||
@ -1192,7 +1192,7 @@ static LCK hash_get_lock(LCK lock, USHORT * hash_slot, LCK ** prior)
|
||||
USHORT hash_value;
|
||||
ATT att;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
if (!(att = lock->lck_attachment))
|
||||
return NULL;
|
||||
@ -1214,9 +1214,9 @@ static LCK hash_get_lock(LCK lock, USHORT * hash_slot, LCK ** prior)
|
||||
|
||||
/* look for an identical lock */
|
||||
|
||||
assert(LCK_CHECK_LOCK(match));
|
||||
fb_assert(LCK_CHECK_LOCK(match));
|
||||
for (collision = match; collision; collision = collision->lck_collision) {
|
||||
assert(LCK_CHECK_LOCK(collision));
|
||||
fb_assert(LCK_CHECK_LOCK(collision));
|
||||
if (collision->lck_parent && lock->lck_parent &&
|
||||
collision->lck_parent->lck_id == lock->lck_parent->lck_id &&
|
||||
collision->lck_type == lock->lck_type &&
|
||||
@ -1257,7 +1257,7 @@ static void hash_insert_lock(LCK lock)
|
||||
USHORT hash_slot;
|
||||
ATT att;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
if (!(att = lock->lck_attachment))
|
||||
return;
|
||||
@ -1295,7 +1295,7 @@ static BOOLEAN hash_remove_lock(LCK lock, LCK * match)
|
||||
**************************************/
|
||||
LCK next, last, *prior;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
if (!(next = hash_get_lock(lock, 0, &prior))) {
|
||||
/* set lck_compatible to NULL to make sure we don't
|
||||
@ -1355,7 +1355,7 @@ static void internal_ast(LCK lock)
|
||||
**************************************/
|
||||
LCK match, next;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
/* go through the list, saving the next lock in the list
|
||||
in case the current one gets deleted in the ast */
|
||||
@ -1393,8 +1393,8 @@ static BOOLEAN internal_compatible(LCK match, LCK lock, USHORT level)
|
||||
**************************************/
|
||||
LCK next;
|
||||
|
||||
assert(LCK_CHECK_LOCK(match));
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(match));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
/* first check if there are any locks which are
|
||||
incompatible which do not have blocking asts;
|
||||
@ -1437,8 +1437,8 @@ static void internal_dequeue(TDBB tdbb, LCK lock)
|
||||
LCK match;
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
assert(lock->lck_compatible);
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(lock->lck_compatible);
|
||||
|
||||
/* if this is the last identical lock in the hash table, release it */
|
||||
|
||||
@ -1475,8 +1475,8 @@ static USHORT internal_downgrade(TDBB tdbb, LCK first)
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
assert(LCK_CHECK_LOCK(first));
|
||||
assert(first->lck_compatible);
|
||||
fb_assert(LCK_CHECK_LOCK(first));
|
||||
fb_assert(first->lck_compatible);
|
||||
|
||||
/* find the highest required lock level */
|
||||
|
||||
@ -1526,8 +1526,8 @@ static BOOLEAN internal_enqueue(
|
||||
LCK match, update;
|
||||
ISC_STATUS *status;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
assert(lock->lck_compatible);
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(lock->lck_compatible);
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
status = tdbb->tdbb_status_vector;
|
||||
@ -1600,14 +1600,14 @@ static BOOLEAN internal_enqueue(
|
||||
if (lock->lck_id == 0)
|
||||
lock->lck_physical = lock->lck_logical = LCK_none;
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
if (lock->lck_id) {
|
||||
hash_insert_lock(lock);
|
||||
lock->lck_logical = lock->lck_physical = level;
|
||||
}
|
||||
|
||||
assert(LCK_CHECK_LOCK(lock));
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
return lock->lck_id ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
$Id: met.epp,v 1.74 2003-11-03 21:33:10 skidder Exp $
|
||||
$Id: met.epp,v 1.75 2003-11-03 23:53:50 brodsom Exp $
|
||||
*/
|
||||
// This MUST be at the top of the file
|
||||
#ifdef DARWIN
|
||||
@ -239,7 +239,7 @@ void MET_verify_cache(TDBB tdbb) {
|
||||
if ( (procedure = JRD_PRC(*ptr)) && procedure->prc_request /*&&
|
||||
!(procedure->prc_flags & PRC_obsolete)*/ )
|
||||
{
|
||||
assert(procedure->prc_int_use_count == 0);
|
||||
fb_assert(procedure->prc_int_use_count == 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ void MET_verify_cache(TDBB tdbb) {
|
||||
resource = resource->rsc_next)
|
||||
{
|
||||
if (resource->rsc_type == rsc_procedure) {
|
||||
assert(resource->rsc_prc->prc_int_use_count >= 0);
|
||||
fb_assert(resource->rsc_prc->prc_int_use_count >= 0);
|
||||
resource->rsc_prc->prc_int_use_count++;
|
||||
}
|
||||
}
|
||||
@ -290,7 +290,7 @@ void MET_verify_cache(TDBB tdbb) {
|
||||
}
|
||||
}
|
||||
gds__log(buffer);
|
||||
assert(false);
|
||||
fb_assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -860,8 +860,8 @@ BOOLEAN MET_get_char_subtype(TDBB tdbb,
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
assert(id != NULL);
|
||||
assert(name != NULL);
|
||||
fb_assert(id != NULL);
|
||||
fb_assert(name != NULL);
|
||||
|
||||
end_name = name + length;
|
||||
|
||||
@ -2300,7 +2300,7 @@ JRD_REL MET_lookup_relation_id(TDBB tdbb, SLONG id, BOOLEAN return_deleted)
|
||||
|
||||
if (id < (int) rel_MAX)
|
||||
{
|
||||
assert((USHORT)id < MAX_USHORT);
|
||||
fb_assert((USHORT)id < MAX_USHORT);
|
||||
return MET_relation(tdbb, (USHORT) id);
|
||||
}
|
||||
|
||||
@ -2644,7 +2644,7 @@ JRD_PRC MET_procedure(TDBB tdbb, int id, BOOLEAN noscan, USHORT flags)
|
||||
/* Make sure PRC_being_scanned and PRC_scanned
|
||||
are not set at the same time
|
||||
*/
|
||||
assert(!(procedure->prc_flags & PRC_being_scanned) ||
|
||||
fb_assert(!(procedure->prc_flags & PRC_being_scanned) ||
|
||||
!(procedure->prc_flags & PRC_scanned));
|
||||
|
||||
/* To avoid scanning recursive procedure's blr recursively let's
|
||||
@ -2840,7 +2840,7 @@ JRD_PRC MET_procedure(TDBB tdbb, int id, BOOLEAN noscan, USHORT flags)
|
||||
} /* if !noscan */
|
||||
|
||||
/* Make sure that it is really being Scanned ! */
|
||||
assert(procedure->prc_flags & PRC_being_scanned);
|
||||
fb_assert(procedure->prc_flags & PRC_being_scanned);
|
||||
|
||||
procedure->prc_flags &= ~PRC_being_scanned;
|
||||
|
||||
@ -3852,9 +3852,9 @@ static BOOLEAN get_type( TDBB tdbb, SSHORT * id, UCHAR * name, UCHAR * field)
|
||||
SET_TDBB(tdbb);
|
||||
dbb = tdbb->tdbb_database;
|
||||
|
||||
assert(id != NULL);
|
||||
assert(name != NULL);
|
||||
assert(field != NULL);
|
||||
fb_assert(id != NULL);
|
||||
fb_assert(name != NULL);
|
||||
fb_assert(field != NULL);
|
||||
|
||||
/* Force key to uppercase, following C locale rules for uppercase */
|
||||
|
||||
@ -4199,7 +4199,7 @@ static BOOLEAN resolve_charset_and_collation(
|
||||
SET_TDBB(tdbb);
|
||||
dbb = tdbb->tdbb_database;
|
||||
|
||||
assert(id != NULL);
|
||||
fb_assert(id != NULL);
|
||||
|
||||
handle = NULL;
|
||||
|
||||
@ -4516,7 +4516,7 @@ static void terminate(TEXT * str, USHORT len)
|
||||
*
|
||||
**************************************************************/
|
||||
SSHORT i;
|
||||
assert(len > 0);
|
||||
fb_assert(len > 0);
|
||||
|
||||
for (i = len - 1; i >= 0 && ((isspace(str[i])) || (str[i] == 0)); i--)
|
||||
/* do nothing */ ;
|
||||
|
@ -104,7 +104,7 @@ void MOV_double_to_date2(double real, dsc* desc)
|
||||
((SLONG *) desc->dsc_address)[0] = fixed[0];
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -188,8 +188,8 @@ void MOV_faster(const SLONG* from, SLONG* to, ULONG length)
|
||||
ULONG l;
|
||||
UCHAR *p, *q;
|
||||
|
||||
assert(!((U_IPTR) to & (sizeof(ULONG) - 1))); /* ULONG alignment required */
|
||||
assert(!((U_IPTR) from & (sizeof(ULONG) - 1))); /* ULONG alignment required */
|
||||
fb_assert(!((U_IPTR) to & (sizeof(ULONG) - 1))); /* ULONG alignment required */
|
||||
fb_assert(!((U_IPTR) from & (sizeof(ULONG) - 1))); /* ULONG alignment required */
|
||||
|
||||
/* copy by chunks of 8 longwords == 32 bytes == 2**5 bytes */
|
||||
if (l = (length >> 5)) {
|
||||
@ -250,7 +250,7 @@ void MOV_fill(SLONG* to, ULONG length)
|
||||
while (l--)
|
||||
*p++ = 0;
|
||||
to = (SLONG *) p;
|
||||
assert(!(((U_IPTR) to) & (sizeof(ULONG) - 1)) /* We're now aligned ULONG */
|
||||
fb_assert(!(((U_IPTR) to) & (sizeof(ULONG) - 1)) /* We're now aligned ULONG */
|
||||
||!length); /* Or already completed */
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* $Id: nbak.cpp,v 1.12 2003-10-29 00:30:57 brodsom Exp $
|
||||
* $Id: nbak.cpp,v 1.13 2003-11-03 23:53:50 brodsom Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -114,7 +114,7 @@ void BackupManager::release_sw_database_lock() throw() {
|
||||
database_lock->endRead();
|
||||
#else
|
||||
NBAK_TRACE(("release_sw_database_lock %d", database_use_count));
|
||||
assert(database_use_count > 0);
|
||||
fb_assert(database_use_count > 0);
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
database_use_count--;
|
||||
if (ast_flags & NBAK_database_blocking) {
|
||||
@ -130,7 +130,7 @@ void BackupManager::lock_state_write(bool thread_exit) {
|
||||
state_lock->beginWrite();
|
||||
if (thread_exit) THREAD_ENTER;
|
||||
#else
|
||||
assert(!(flags & NBAK_state_in_use));
|
||||
fb_assert(!(flags & NBAK_state_in_use));
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
flags |= NBAK_state_in_use;
|
||||
bool locked = false;
|
||||
@ -162,7 +162,7 @@ bool BackupManager::try_lock_state_write() {
|
||||
if (!state_lock->tryBeginWrite())
|
||||
return false;
|
||||
#else
|
||||
assert(!(flags & NBAK_state_in_use));
|
||||
fb_assert(!(flags & NBAK_state_in_use));
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
flags |= NBAK_state_in_use;
|
||||
bool result;
|
||||
@ -193,7 +193,7 @@ void BackupManager::unlock_state_write() throw() {
|
||||
#ifdef SUPERSERVER
|
||||
state_lock->endWrite();
|
||||
#else
|
||||
assert(flags & NBAK_state_in_use);
|
||||
fb_assert(flags & NBAK_state_in_use);
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
// ASTs are going to be reposted after CONVERT
|
||||
ast_flags &= ~NBAK_state_blocking;
|
||||
@ -213,7 +213,7 @@ bool BackupManager::lock_alloc_write(bool thread_exit) throw() {
|
||||
alloc_lock->beginWrite();
|
||||
if (thread_exit) THREAD_ENTER;
|
||||
#else
|
||||
assert(!(flags & NBAK_alloc_in_use));
|
||||
fb_assert(!(flags & NBAK_alloc_in_use));
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
flags |= NBAK_alloc_in_use;
|
||||
// Release shared lock to prevent possible deadlocks
|
||||
@ -243,7 +243,7 @@ void BackupManager::unlock_alloc_write() throw() {
|
||||
#ifdef SUPERSERVER
|
||||
alloc_lock->endWrite();
|
||||
#else
|
||||
assert(flags & NBAK_alloc_in_use);
|
||||
fb_assert(flags & NBAK_alloc_in_use);
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
// ASTs are going to be reposted after CONVERT
|
||||
ast_flags &= ~NBAK_alloc_blocking;
|
||||
@ -266,7 +266,7 @@ bool BackupManager::lock_state(bool thread_exit) throw() {
|
||||
state_lock->beginRead();
|
||||
if (thread_exit) THREAD_ENTER;
|
||||
#else
|
||||
assert(!(flags & NBAK_state_in_use));
|
||||
fb_assert(!(flags & NBAK_state_in_use));
|
||||
flags |= NBAK_state_in_use;
|
||||
if (state_lock->lck_physical < LCK_SR) {
|
||||
if (!LCK_lock(tdbb, state_lock, LCK_SR, LCK_WAIT)) {
|
||||
@ -290,7 +290,7 @@ void BackupManager::unlock_state() throw() {
|
||||
#ifdef SUPERSERVER
|
||||
state_lock->endRead();
|
||||
#else
|
||||
assert(flags & NBAK_state_in_use);
|
||||
fb_assert(flags & NBAK_state_in_use);
|
||||
flags &= ~NBAK_state_in_use;
|
||||
if (ast_flags & NBAK_state_blocking) {
|
||||
LCK_release(tdbb, state_lock);
|
||||
@ -306,7 +306,7 @@ bool BackupManager::lock_alloc(bool thread_exit) throw() {
|
||||
alloc_lock->beginRead();
|
||||
if (thread_exit) THREAD_ENTER;
|
||||
#else
|
||||
assert(!(flags & NBAK_alloc_in_use));
|
||||
fb_assert(!(flags & NBAK_alloc_in_use));
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
flags |= NBAK_alloc_in_use;
|
||||
if (alloc_lock->lck_physical < LCK_SR) {
|
||||
@ -328,7 +328,7 @@ void BackupManager::unlock_alloc() throw() {
|
||||
#ifdef SUPERSERVER
|
||||
alloc_lock->endRead();
|
||||
#else
|
||||
assert(flags & NBAK_alloc_in_use);
|
||||
fb_assert(flags & NBAK_alloc_in_use);
|
||||
TDBB tdbb = GET_THREAD_DATA;
|
||||
flags &= ~NBAK_alloc_in_use;
|
||||
if (ast_flags & NBAK_alloc_blocking) {
|
||||
@ -851,7 +851,7 @@ ULONG BackupManager::get_page_index(ULONG db_page) const throw() {
|
||||
|
||||
// Mark next difference page as used by some database page
|
||||
ULONG BackupManager::allocate_difference_page(ULONG db_page) throw() {
|
||||
assert(last_allocated_page % (database->dbb_page_size/sizeof(ULONG)) == alloc_buffer[0]);
|
||||
fb_assert(last_allocated_page % (database->dbb_page_size/sizeof(ULONG)) == alloc_buffer[0]);
|
||||
|
||||
ISC_STATUS* status = GET_THREAD_DATA->tdbb_status_vector;
|
||||
// Grow file first. This is done in such order to keep difference
|
||||
|
@ -385,8 +385,8 @@ RSB OPT_compile(TDBB tdbb,
|
||||
if (node->nod_type != nod_rse)
|
||||
{
|
||||
stream = (USHORT)(ULONG) node->nod_arg[STREAM_INDEX(node)];
|
||||
assert(stream <= MAX_UCHAR);
|
||||
assert(beds[0] < MAX_STREAMS && beds[0] < MAX_UCHAR);
|
||||
fb_assert(stream <= MAX_UCHAR);
|
||||
fb_assert(beds[0] < MAX_STREAMS && beds[0] < MAX_UCHAR);
|
||||
beds[++beds[0]] = (UCHAR) stream;
|
||||
}
|
||||
|
||||
@ -402,21 +402,21 @@ RSB OPT_compile(TDBB tdbb,
|
||||
rsb =
|
||||
gen_union(tdbb, opt_, node, key_streams + i + 1,
|
||||
(USHORT) (key_streams[0] - i));
|
||||
assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
|
||||
fb_assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
|
||||
local_streams[++local_streams[0]] =
|
||||
(UCHAR)(ULONG) node->nod_arg[e_uni_stream];
|
||||
}
|
||||
else if (node->nod_type == nod_aggregate) {
|
||||
assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
|
||||
assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
|
||||
fb_assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
|
||||
fb_assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
|
||||
rsb = gen_aggregate(tdbb, opt_, node);
|
||||
assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
|
||||
fb_assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
|
||||
local_streams[++local_streams[0]] =
|
||||
(UCHAR)(ULONG) node->nod_arg[e_agg_stream];
|
||||
}
|
||||
else if (node->nod_type == nod_procedure) {
|
||||
rsb = gen_procedure(tdbb, opt_, node);
|
||||
assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
|
||||
fb_assert(local_streams[0] < MAX_STREAMS && local_streams[0] < MAX_UCHAR);
|
||||
local_streams[++local_streams[0]] =
|
||||
(UCHAR)(ULONG) node->nod_arg[e_prc_stream];
|
||||
}
|
||||
@ -481,14 +481,14 @@ RSB OPT_compile(TDBB tdbb,
|
||||
|
||||
// TMN: Is the intention really to allow streams[0] to overflow?
|
||||
// I must assume that is indeed not the intention (not to mention
|
||||
// it would make code later on fail), so I added the following assert.
|
||||
assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
|
||||
// it would make code later on fail), so I added the following fb_assert.
|
||||
fb_assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
|
||||
|
||||
++streams[0];
|
||||
*p++ = (UCHAR) stream;
|
||||
|
||||
if (rse->rse_jointype == blr_left) {
|
||||
assert(outer_streams[0] < MAX_STREAMS && outer_streams[0] < MAX_UCHAR);
|
||||
fb_assert(outer_streams[0] < MAX_STREAMS && outer_streams[0] < MAX_UCHAR);
|
||||
outer_streams[++outer_streams[0]] = stream;
|
||||
}
|
||||
|
||||
@ -631,7 +631,7 @@ RSB OPT_compile(TDBB tdbb,
|
||||
}
|
||||
|
||||
// attempt to form joins in decreasing order of desirability
|
||||
assert(streams[0] != 1 || csb->csb_rpt[streams[1]].csb_relation != 0);
|
||||
fb_assert(streams[0] != 1 || csb->csb_rpt[streams[1]].csb_relation != 0);
|
||||
gen_join(tdbb, opt_, streams, &rivers_stack, &sort, &project,
|
||||
rse->rse_plan);
|
||||
|
||||
@ -1853,7 +1853,7 @@ static void compute_dbkey_streams(CSB csb, JRD_NOD node, UCHAR * streams)
|
||||
DEV_BLKCHK(node, type_nod);
|
||||
|
||||
if (node->nod_type == nod_relation) {
|
||||
assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
|
||||
fb_assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
|
||||
streams[++streams[0]] = (UCHAR)(ULONG) node->nod_arg[e_rel_stream];
|
||||
}
|
||||
else if (node->nod_type == nod_union) {
|
||||
@ -1893,7 +1893,7 @@ static void compute_rse_streams(CSB csb, RSE rse, UCHAR * streams)
|
||||
for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++) {
|
||||
node = *ptr;
|
||||
if (node->nod_type != nod_rse) {
|
||||
assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
|
||||
fb_assert(streams[0] < MAX_STREAMS && streams[0] < MAX_UCHAR);
|
||||
streams[++streams[0]] = (UCHAR)(ULONG) node->nod_arg[STREAM_INDEX(node)];
|
||||
}
|
||||
else {
|
||||
@ -3443,8 +3443,8 @@ static RSB gen_aggregate(TDBB tdbb, OPT opt, JRD_NOD node)
|
||||
|
||||
RSB rsb = FB_NEW_RPT(*tdbb->tdbb_default, 1) Rsb();
|
||||
rsb->rsb_type = rsb_aggregate;
|
||||
assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
|
||||
assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
|
||||
fb_assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
|
||||
fb_assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_UCHAR);
|
||||
rsb->rsb_stream = (UCHAR)(ULONG) node->nod_arg[e_agg_stream];
|
||||
rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format;
|
||||
rsb->rsb_next = OPT_compile(tdbb, csb, rse, NULL);
|
||||
@ -3499,15 +3499,15 @@ static RSB gen_aggregate(TDBB tdbb, OPT opt, JRD_NOD node)
|
||||
SKD* sort_key = asb->asb_key_desc = (SKD*) asb->asb_key_data;
|
||||
sort_key->skd_offset = 0;
|
||||
// UCHAR desc->dsc_dtype is always >=0
|
||||
// assert(desc->dsc_dtype >= 0)
|
||||
assert(desc->dsc_dtype < FB_NELEM(sort_dtypes));
|
||||
// fb_assert(desc->dsc_dtype >= 0)
|
||||
fb_assert(desc->dsc_dtype < FB_NELEM(sort_dtypes));
|
||||
sort_key->skd_dtype = sort_dtypes[desc->dsc_dtype];
|
||||
/* as it is legal to have skd_dtype = 0
|
||||
I have removed these asserts, to avoid
|
||||
server restarts in debug mode.
|
||||
FSG 18.Dec.2000
|
||||
*/
|
||||
/*assert (sort_key->skd_dtype != 0); */
|
||||
/*fb_assert (sort_key->skd_dtype != 0); */
|
||||
sort_key->skd_length = desc->dsc_length;
|
||||
sort_key->skd_flags = SKD_ascending;
|
||||
asb->nod_impure = CMP_impure(csb, sizeof(struct iasb));
|
||||
@ -3625,12 +3625,12 @@ static void gen_join(TDBB tdbb,
|
||||
// need it to optimize retrieval.
|
||||
|
||||
csb_repeat* csb_tail = &csb->csb_rpt[streams[1]];
|
||||
assert(csb_tail);
|
||||
fb_assert(csb_tail);
|
||||
if (csb_tail->csb_flags & csb_compute) {
|
||||
JRD_REL relation = csb_tail->csb_relation;
|
||||
assert(relation);
|
||||
fb_assert(relation);
|
||||
FMT format = CMP_format(tdbb, csb, streams[1]);
|
||||
assert(format);
|
||||
fb_assert(format);
|
||||
csb_tail->csb_cardinality =
|
||||
(float) DPM_data_pages(tdbb, relation) *
|
||||
dbb->dbb_page_size / format->fmt_length;
|
||||
@ -3639,7 +3639,7 @@ static void gen_join(TDBB tdbb,
|
||||
RIV river = FB_NEW_RPT(*tdbb->tdbb_default, 1) riv();
|
||||
river->riv_count = 1;
|
||||
|
||||
assert(csb->csb_rpt[streams[1]].csb_relation);
|
||||
fb_assert(csb->csb_rpt[streams[1]].csb_relation);
|
||||
|
||||
river->riv_rsb =
|
||||
gen_retrieval(tdbb, opt, streams[1], sort_clause, project_clause,
|
||||
@ -3653,9 +3653,9 @@ static void gen_join(TDBB tdbb,
|
||||
const UCHAR* end_stream = streams + 1 + streams[0];
|
||||
for (UCHAR* stream = streams + 1; stream < end_stream; stream++) {
|
||||
csb_repeat* csb_tail = &csb->csb_rpt[*stream];
|
||||
assert(csb_tail);
|
||||
fb_assert(csb_tail);
|
||||
JRD_REL relation = csb_tail->csb_relation;
|
||||
assert(relation);
|
||||
fb_assert(relation);
|
||||
FMT format = CMP_format(tdbb, csb, *stream);
|
||||
// if this is an external file, set an arbitrary cardinality;
|
||||
// if a plan was specified, don't bother computing cardinality;
|
||||
@ -3670,7 +3670,7 @@ static void gen_join(TDBB tdbb,
|
||||
csb_tail->csb_cardinality = (float) 0;
|
||||
}
|
||||
else {
|
||||
assert(format);
|
||||
fb_assert(format);
|
||||
csb_tail->csb_cardinality =
|
||||
(float) DPM_data_pages(tdbb, relation) *
|
||||
dbb->dbb_page_size / format->fmt_length;
|
||||
@ -4155,7 +4155,7 @@ static RSB gen_retrieval(TDBB tdbb,
|
||||
csb_repeat* csb_tail = &csb->csb_rpt[stream];
|
||||
JRD_REL relation = csb_tail->csb_relation;
|
||||
|
||||
assert(relation);
|
||||
fb_assert(relation);
|
||||
|
||||
STR alias = make_alias(tdbb, csb, csb_tail);
|
||||
csb_tail->csb_flags |= csb_active;
|
||||
@ -4745,10 +4745,10 @@ static RSB gen_sort(TDBB tdbb,
|
||||
if (*(node_ptr + sort->nod_count))
|
||||
sort_key->skd_flags |= SKD_descending;
|
||||
// UCHAR desc->dsc_dtype is always >=0
|
||||
// assert(desc->dsc_dtype >= 0);
|
||||
assert(desc->dsc_dtype < FB_NELEM(sort_dtypes));
|
||||
// fb_assert(desc->dsc_dtype >= 0);
|
||||
fb_assert(desc->dsc_dtype < FB_NELEM(sort_dtypes));
|
||||
sort_key->skd_dtype = sort_dtypes[desc->dsc_dtype];
|
||||
/*assert (sort_key->skd_dtype != 0); */
|
||||
/*fb_assert (sort_key->skd_dtype != 0); */
|
||||
if (sort_key->skd_dtype == SKD_varying ||
|
||||
sort_key->skd_dtype == SKD_cstring) {
|
||||
if (desc->dsc_ttype == ttype_binary)
|
||||
@ -4834,7 +4834,7 @@ static RSB gen_sort(TDBB tdbb,
|
||||
|
||||
end_key = sort_key;
|
||||
for (sort_key = map->smb_key_desc; sort_key < end_key; sort_key++) {
|
||||
/* assert (sort_key->skd_dtype != 0); */
|
||||
/* fb_assert (sort_key->skd_dtype != 0); */
|
||||
if (sort_key->skd_dtype == SKD_varying ||
|
||||
sort_key->skd_dtype == SKD_cstring) {
|
||||
sort_key->skd_vary_offset = (USHORT) map_length;
|
||||
@ -5452,7 +5452,7 @@ static JRD_NOD make_inference_node(CSB csb, JRD_NOD boolean, JRD_NOD arg1, JRD_N
|
||||
DEV_BLKCHK(boolean, type_nod);
|
||||
DEV_BLKCHK(arg1, type_nod);
|
||||
DEV_BLKCHK(arg2, type_nod);
|
||||
assert(boolean->nod_count >= 2); /* must be a conjunction boolean */
|
||||
fb_assert(boolean->nod_count >= 2); /* must be a conjunction boolean */
|
||||
/* Clone the input predicate */
|
||||
node = PAR_make_node(tdbb, boolean->nod_count);
|
||||
node->nod_type = boolean->nod_type;
|
||||
|
@ -36,12 +36,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $Id: isc_ipc.cpp,v 1.4 2003-10-16 08:51:03 robocop Exp $ */
|
||||
/* $Id: isc_ipc.cpp,v 1.5 2003-11-03 23:54:55 brodsom Exp $ */
|
||||
|
||||
#include "firebird.h"
|
||||
#include "../jrd/ib_stdio.h"
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include "../jrd/gdsassert.h"
|
||||
#include "../jrd/common.h"
|
||||
#include "gen/codes.h"
|
||||
#include "../jrd/isc.h"
|
||||
@ -207,7 +207,7 @@ void ISC_enable() throw()
|
||||
* Enable signal processing. Re-post any pending signals.
|
||||
*
|
||||
**************************************/
|
||||
assert(inhibit_counter > 0);
|
||||
fb_assert(inhibit_counter > 0);
|
||||
inhibit_counter--;
|
||||
if (inhibit_counter == 0) {
|
||||
// Return to the mask as it were before the first recursive
|
||||
|
@ -155,7 +155,7 @@ SLONG EVENT_create_session(ISC_STATUS status_vector)
|
||||
|
||||
session = (SES) alloc(sizeof(struct ses));
|
||||
if (!session) {
|
||||
assert(false); /* No error handling */
|
||||
fb_assert(false); /* No error handling */
|
||||
return 0L;
|
||||
}
|
||||
session->ses_next = sessions;
|
||||
@ -676,7 +676,7 @@ static void deliver_request(VMS_REQ request)
|
||||
if (end < p + event->evnt_length + 5) {
|
||||
UCHAR *new_buffer;
|
||||
/* Running out of space - allocate some more and copy it over */
|
||||
assert(event_buffer == buffer); /* we're in this block only once */
|
||||
fb_assert(event_buffer == buffer); /* we're in this block only once */
|
||||
new_buffer = gds__alloc((SLONG) MAX_EVENT_BUFFER);
|
||||
/* FREE: at procedure return */
|
||||
if (!new_buffer) { /* NOMEM: */
|
||||
|
@ -518,8 +518,8 @@ int PAG_add_header_entry(HDR header, USHORT type, SSHORT len, UCHAR * entry)
|
||||
free_space = dbb->dbb_page_size - header->hdr_end;
|
||||
|
||||
if (free_space > (2 + len)) {
|
||||
assert(type <= MAX_UCHAR);
|
||||
assert(len <= MAX_UCHAR);
|
||||
fb_assert(type <= MAX_UCHAR);
|
||||
fb_assert(len <= MAX_UCHAR);
|
||||
*p++ = static_cast < UCHAR > (type);
|
||||
*p++ = static_cast < UCHAR > (len);
|
||||
|
||||
@ -1955,8 +1955,8 @@ SSHORT len, UCHAR * entry, USHORT must_write)
|
||||
else
|
||||
CCH_MARK(tdbb, window);
|
||||
|
||||
assert(type <= MAX_UCHAR);
|
||||
assert(len <= MAX_UCHAR);
|
||||
fb_assert(type <= MAX_UCHAR);
|
||||
fb_assert(len <= MAX_UCHAR);
|
||||
*p++ = static_cast < UCHAR > (type);
|
||||
*p++ = static_cast < UCHAR > (len);
|
||||
|
||||
@ -2011,8 +2011,8 @@ SSHORT len, UCHAR * entry, USHORT must_write)
|
||||
p = new_logp->log_data;
|
||||
}
|
||||
|
||||
assert(type <= MAX_UCHAR);
|
||||
assert(len <= MAX_UCHAR);
|
||||
fb_assert(type <= MAX_UCHAR);
|
||||
fb_assert(len <= MAX_UCHAR);
|
||||
*p++ = static_cast < UCHAR > (type);
|
||||
*p++ = static_cast < UCHAR > (len);
|
||||
|
||||
|
@ -660,7 +660,7 @@ static void error(CSB csb, ...)
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
case gds_arg_vms:
|
||||
case gds_arg_unix:
|
||||
case gds_arg_win32:
|
||||
@ -839,7 +839,7 @@ static XCP par_condition(TDBB tdbb, CSB csb)
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -914,7 +914,7 @@ static XCP par_conditions(TDBB tdbb, CSB csb)
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -946,7 +946,7 @@ static SSHORT par_context(CSB csb, SSHORT* context_ptr)
|
||||
/// don't have such an error (yet).
|
||||
error(csb, gds_too_many_contexts, 0);
|
||||
}
|
||||
assert(stream <= MAX_STREAMS);
|
||||
fb_assert(stream <= MAX_STREAMS);
|
||||
SSHORT context = (unsigned int) BLR_BYTE;
|
||||
CMP_csb_element(csb, stream);
|
||||
csb_repeat* tail = CMP_csb_element(csb, context);
|
||||
@ -1397,7 +1397,7 @@ static JRD_NOD par_literal(TDBB tdbb, CSB csb)
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
case dtype_text:
|
||||
if ( (count = l) )
|
||||
do
|
||||
@ -2025,7 +2025,7 @@ static JRD_NOD par_relation(
|
||||
|
||||
if (parse_context) {
|
||||
stream = par_context(csb, &context);
|
||||
assert(stream <= MAX_STREAMS);
|
||||
fb_assert(stream <= MAX_STREAMS);
|
||||
node->nod_arg[e_rel_stream] = (JRD_NOD) (SLONG) stream;
|
||||
node->nod_arg[e_rel_context] = (JRD_NOD) (SLONG) context;
|
||||
|
||||
@ -2573,7 +2573,7 @@ static JRD_NOD parse(TDBB tdbb, CSB csb, USHORT expected, USHORT expected_option
|
||||
|
||||
case blr_aggregate:
|
||||
node->nod_arg[e_agg_stream] = (JRD_NOD) (SLONG) par_context(csb, 0);
|
||||
assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
|
||||
fb_assert((int)(SLONG)node->nod_arg[e_agg_stream] <= MAX_STREAMS);
|
||||
node->nod_arg[e_agg_rse] = parse(tdbb, csb, TYPE_RSE);
|
||||
node->nod_arg[e_agg_group] = parse(tdbb, csb, OTHER);
|
||||
node->nod_arg[e_agg_map] =
|
||||
@ -3071,7 +3071,7 @@ static void warning(CSB csb, ...)
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
fb_assert(FALSE);
|
||||
case gds_arg_vms:
|
||||
case gds_arg_unix:
|
||||
case gds_arg_win32:
|
||||
|
@ -306,7 +306,7 @@ void API_ROUTINE perf_get_info(FRBRD **handle, PERF * perf)
|
||||
perf->perf_max_memory = 0;
|
||||
{
|
||||
SLONG temp = isc_vax_integer(p, 2);
|
||||
assert(temp <= MAX_SSHORT);
|
||||
fb_assert(temp <= MAX_SSHORT);
|
||||
l = (SSHORT) temp;
|
||||
}
|
||||
p += l + 2;
|
||||
|
@ -274,7 +274,7 @@ bool SecurityDatabase::prepare()
|
||||
isc_attach_database(status, 0, user_info_name, &lookup_db, 0, 0);
|
||||
}
|
||||
|
||||
assert(ihandle->ihndl_object == &lookup_db);
|
||||
fb_assert(ihandle->ihndl_object == &lookup_db);
|
||||
ihandle->ihndl_object = NULL;
|
||||
|
||||
isc_compile_request(status, &lookup_db, &lookup_req, sizeof(PWD_REQUEST),
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "../jrd/rpb_chain.h"
|
||||
|
||||
#ifdef GDS_ALLOC_DEBUG
|
||||
#define ExecAssert(x) assert(x)
|
||||
#define ExecAssert(x) fb_assert(x)
|
||||
#else //GDS_ALLOC_DEBUG
|
||||
#define ExecAssert(x) x
|
||||
#endif //GDS_ALLOC_DEBUG
|
||||
@ -42,8 +42,8 @@ int traRpbList::PushRpb(struct rpb *value) {
|
||||
prev.lr_rpb->rpb_number == value->rpb_number) {
|
||||
// we got the same record once more - mark for refetch
|
||||
level = prev.level;
|
||||
assert(pos >= level);
|
||||
assert((*this)[pos - level].level == 0);
|
||||
fb_assert(pos >= level);
|
||||
fb_assert((*this)[pos - level].level == 0);
|
||||
prev.lr_rpb->rpb_stream_flags |= RPB_s_refetch;
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
#ifndef RPB_CHAIN_H
|
||||
#define RPB_CHAIN_H
|
||||
|
||||
#include <assert.h>
|
||||
#include "../jrd/gdsassert.h"
|
||||
#include <string.h>
|
||||
|
||||
#include "../common/classes/array.h"
|
||||
|
@ -20,7 +20,7 @@
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*
|
||||
* $Id: rse.cpp,v 1.39 2003-11-02 11:54:49 dimitr Exp $
|
||||
* $Id: rse.cpp,v 1.40 2003-11-03 23:53:50 brodsom Exp $
|
||||
*
|
||||
* 2001.07.28: John Bellardo: Implemented rse_skip and made rse_first work with
|
||||
* seekable streams.
|
||||
@ -1461,7 +1461,7 @@ static UCHAR *get_merge_data(TDBB tdbb, MFB mfb, SLONG record)
|
||||
**************************************/
|
||||
ULONG merge_block, merge_offset;
|
||||
|
||||
assert(record >= 0 && record < (SLONG) mfb->mfb_equal_records);
|
||||
fb_assert(record >= 0 && record < (SLONG) mfb->mfb_equal_records);
|
||||
|
||||
merge_block = record / mfb->mfb_blocking_factor;
|
||||
if (merge_block != mfb->mfb_current_block) {
|
||||
@ -3582,7 +3582,7 @@ static ULONG read_merge_block(TDBB tdbb, MFB mfb, ULONG block)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
assert(mfb->mfb_sfb && mfb->mfb_sfb->sfb_file_name);
|
||||
fb_assert(mfb->mfb_sfb && mfb->mfb_sfb->sfb_file_name);
|
||||
|
||||
mfb->mfb_sfb->sfb_mem->read(tdbb->tdbb_status_vector,
|
||||
mfb->mfb_block_size * block,
|
||||
|
@ -280,7 +280,7 @@ typedef irl *IRL;
|
||||
#define MAX_CONJUNCTS 32000
|
||||
|
||||
// Note that MAX_STREAMS currently MUST be <= MAX_UCHAR.
|
||||
// Here we should really have a compile-time assert, since this hard-coded
|
||||
// Here we should really have a compile-time fb_assert, since this hard-coded
|
||||
// limit is NOT negotiable so long as we use an array of UCHAR, where index 0
|
||||
// tells how many streams are in the array (and the streams themselves are
|
||||
// identified by a UCHAR).
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user