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

Remove trailing spaces (.cpp files)

This commit is contained in:
asfernandes 2008-12-05 01:20:14 +00:00
parent d41d1b40d1
commit 8fbf0e8e8c
231 changed files with 7278 additions and 7278 deletions

View File

@ -83,20 +83,20 @@ int EXE_action(const TEXT* database, const ULONG switches)
buildDpb(dpb, switches);
FB_API_HANDLE handle = 0;
isc_attach_database(tdgbl->status, 0, database, &handle,
dpb.getBufferLength(),
isc_attach_database(tdgbl->status, 0, database, &handle,
dpb.getBufferLength(),
reinterpret_cast<const SCHAR*>(dpb.getBuffer()));
tdgbl->uSvc->started();
if (tdgbl->status[1] &&
if (tdgbl->status[1] &&
// Ignore isc_shutdown error produced when we switch to full shutdown mode. It is expected.
(tdgbl->status[1] != isc_shutdown || !(switches & sw_shut) || tdgbl->ALICE_data.ua_shutdown_mode != SHUT_FULL)
)
{
error = true;
}
if (tdgbl->status[2] == isc_arg_warning)
{
tdgbl->uSvc->makePermanentVector(tdgbl->status);
@ -107,7 +107,7 @@ int EXE_action(const TEXT* database, const ULONG switches)
tdgbl->uSvc->makePermanentVector(tdgbl->status);
}
if (handle != 0)
if (handle != 0)
{
UCHAR error_string[128];
if ((switches & sw_validate) && (tdgbl->status[1] != isc_bug_check))
@ -156,7 +156,7 @@ int EXE_two_phase(const TEXT* database, const ULONG switches)
FB_API_HANDLE handle = 0;
isc_attach_database(tdgbl->status, 0, database, &handle,
dpb.getBufferLength(),
dpb.getBufferLength(),
reinterpret_cast<const SCHAR*>(dpb.getBuffer()));
tdgbl->uSvc->started();
@ -223,13 +223,13 @@ static void buildDpb(Firebird::ClumpletWriter& dpb, const ULONG switches)
dpb.insertByte(isc_dpb_verify, b);
}
else if (switches & sw_housekeeping) {
dpb.insertInt(isc_dpb_sweep_interval,
dpb.insertInt(isc_dpb_sweep_interval,
tdgbl->ALICE_data.ua_sweep_interval);
}
/*
else if (switches & sw_begin_log) {
dpb.insertString(isc_dpb_begin_log,
tdgbl->ALICE_data.ua_log_file,
dpb.insertString(isc_dpb_begin_log,
tdgbl->ALICE_data.ua_log_file,
strlen(tdgbl->ALICE_data.ua_log_file));
}
else if (switches & sw_quit_log) {
@ -237,18 +237,18 @@ static void buildDpb(Firebird::ClumpletWriter& dpb, const ULONG switches)
}
*/
else if (switches & sw_buffers) {
dpb.insertInt(isc_dpb_set_page_buffers,
dpb.insertInt(isc_dpb_set_page_buffers,
tdgbl->ALICE_data.ua_page_buffers);
}
else if (switches & sw_kill) {
dpb.insertTag(isc_dpb_delete_shadow);
}
else if (switches & sw_write) {
dpb.insertByte(isc_dpb_force_write,
dpb.insertByte(isc_dpb_force_write,
tdgbl->ALICE_data.ua_force ? 1 : 0);
}
else if (switches & sw_no_reserve) {
dpb.insertByte(isc_dpb_no_reserve,
dpb.insertByte(isc_dpb_no_reserve,
tdgbl->ALICE_data.ua_no_reserve ? 1 : 0);
}
else if (switches & sw_mode) {
@ -278,7 +278,7 @@ static void buildDpb(Firebird::ClumpletWriter& dpb, const ULONG switches)
case SHUT_FULL:
b |= isc_dpb_shut_full;
break;
default:
default:
break;
}
dpb.insertByte(isc_dpb_shutdown, b);
@ -318,24 +318,24 @@ static void buildDpb(Firebird::ClumpletWriter& dpb, const ULONG switches)
dpb.insertTag(isc_dpb_no_garbage_collect);
}
else if (switches & sw_set_db_dialect) {
dpb.insertInt(isc_dpb_set_db_sql_dialect,
dpb.insertInt(isc_dpb_set_db_sql_dialect,
tdgbl->ALICE_data.ua_db_SQL_dialect);
}
if (tdgbl->ALICE_data.ua_user) {
dpb.insertString(isc_dpb_user_name,
dpb.insertString(isc_dpb_user_name,
tdgbl->ALICE_data.ua_user,
strlen(tdgbl->ALICE_data.ua_user));
}
if (tdgbl->ALICE_data.ua_password) {
dpb.insertString(tdgbl->uSvc->isService() ? isc_dpb_password_enc :
isc_dpb_password,
tdgbl->ALICE_data.ua_password,
tdgbl->ALICE_data.ua_password,
strlen(tdgbl->ALICE_data.ua_password));
}
if (tdgbl->ALICE_data.ua_tr_user) {
tdgbl->uSvc->checkService();
dpb.insertString(isc_dpb_trusted_auth,
dpb.insertString(isc_dpb_trusted_auth,
tdgbl->ALICE_data.ua_tr_user,
strlen(tdgbl->ALICE_data.ua_tr_user));
}
@ -371,9 +371,9 @@ static void extract_db_info(const UCHAR* db_info_buffer, size_t buf_size)
const SLONG length = gds__vax_integer(p, 2);
p += 2;
// TMN: Here we should really have the following assert
// TMN: Here we should really have the following assert
// fb_assert(length <= MAX_SSHORT);
// for all cases that use 'length' as input to 'gds__vax_integer'
// for all cases that use 'length' as input to 'gds__vax_integer'
// Remember to keep this list in sync with the val_errors array.
switch (item)
{

View File

@ -195,19 +195,19 @@ bool TDR_attach_database(ISC_STATUS* status_vector,
dpb.insertTag(isc_dpb_gfix_attach);
tdgbl->uSvc->getAddressPath(dpb);
if (tdgbl->ALICE_data.ua_user) {
dpb.insertString(isc_dpb_user_name,
dpb.insertString(isc_dpb_user_name,
tdgbl->ALICE_data.ua_user,
strlen(tdgbl->ALICE_data.ua_user));
}
if (tdgbl->ALICE_data.ua_password) {
dpb.insertString(tdgbl->uSvc->isService() ? isc_dpb_password_enc :
isc_dpb_password,
tdgbl->ALICE_data.ua_password,
tdgbl->ALICE_data.ua_password,
strlen(tdgbl->ALICE_data.ua_password));
}
if (tdgbl->ALICE_data.ua_tr_user) {
tdgbl->uSvc->checkService();
dpb.insertString(isc_dpb_trusted_auth,
dpb.insertString(isc_dpb_trusted_auth,
tdgbl->ALICE_data.ua_tr_user,
strlen(reinterpret_cast<const char*>(tdgbl->ALICE_data.ua_tr_user)));
}
@ -323,7 +323,7 @@ void TDR_list_limbo(FB_API_HANDLE handle, const TEXT* name, const ULONG switches
ALICE_print(71, SafeArg() << id);
// msg 71: Transaction %d is in limbo.
}
if (trans = MET_get_transaction(status_vector, handle, id))
if (trans = MET_get_transaction(status_vector, handle, id))
{
tdgbl->uSvc->putSLong(isc_spb_multi_tra_id, id);
reattach_databases(trans);
@ -331,7 +331,7 @@ void TDR_list_limbo(FB_API_HANDLE handle, const TEXT* name, const ULONG switches
TDR_shutdown_databases(trans);
print_description(trans);
}
else
else
{
tdgbl->uSvc->putSLong(isc_spb_single_tra_id, id);
}
@ -770,7 +770,7 @@ static void reattach_database(TDR trans)
ALICE_exit(FINI_ERROR, tdgbl);
}
for (;;)
for (;;)
{
ALICE_print(88); // msg 88: Enter a valid path:
char* p = buffer;

View File

@ -1,7 +1,7 @@
/*
* PROGRAM: JRD Backup and Restore Program
* MODULE: canonical.cpp
* DESCRIPTION:
* DESCRIPTION:
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
@ -200,7 +200,7 @@ ULONG CAN_encode_decode(burp_rel* relation,
}
}
// Next, get null flags
// Next, get null flags
for (field = relation->rel_fields; field; field = field->fld_next)
{
@ -442,7 +442,7 @@ static bool_t expand_buffer(XDR* xdrs)
*
* Functional description
* Allocate a new, larger buffer, copy
* everything we've got, and release the
* everything we've got, and release the
* old one.
*
**************************************/
@ -654,7 +654,7 @@ static bool_t xdr_slice(XDR* xdrs,
if (!xdr_long(xdrs, reinterpret_cast<SLONG*>(&slice->lstr_length)))
return FALSE;
// Handle operation specific stuff, particularly memory allocation/deallocation
// Handle operation specific stuff, particularly memory allocation/deallocation
switch (xdrs->x_op)
{
@ -692,7 +692,7 @@ static bool_t xdr_slice(XDR* xdrs,
return FALSE;
}
// Get descriptor of array element
// Get descriptor of array element
ISC_STATUS_ARRAY status_vector;
sdl_info info;

View File

@ -48,7 +48,7 @@ UCHAR *MISC_alloc_burp(ULONG size)
BurpGlobals* tdgbl = BurpGlobals::getSpecific();
// Add some header space to store a list of blocks allocated for this gbak
// Add some header space to store a list of blocks allocated for this gbak
size += ROUNDUP(sizeof(UCHAR *), FB_ALIGNMENT);
UCHAR* block = (UCHAR*)gds__alloc(size);
@ -57,14 +57,14 @@ UCHAR *MISC_alloc_burp(ULONG size)
/* NOMEM: message & abort FREE: all items freed at gbak exit */
{
BURP_error(238, true);
// msg 238: System memory exhaused
// msg 238: System memory exhaused
return NULL;
}
memset(block, 0, size);
/* FREE: We keep a linked list of all gbak memory allocations, which
* are then freed when gbak exits. This is important for
* are then freed when gbak exits. This is important for
* NETWARE in particular.
*/
*((UCHAR **) block) = tdgbl->head_of_mem_list;
@ -89,26 +89,26 @@ void MISC_free_burp( void *free)
BurpGlobals* tdgbl = BurpGlobals::getSpecific();
if (free != NULL) {
// Point at the head of the allocated block
// Point at the head of the allocated block
UCHAR **block =
(UCHAR **) ((UCHAR *) free - ROUNDUP(sizeof(UCHAR *), FB_ALIGNMENT));
// Scan for this block in the list of blocks
// Scan for this block in the list of blocks
for (UCHAR **ptr = &tdgbl->head_of_mem_list; *ptr; ptr = (UCHAR **) *ptr)
{
if (*ptr == (UCHAR *) block) {
// Found it - remove it from the list
// Found it - remove it from the list
*ptr = *block;
// and free it
// and free it
gds__free((SLONG *) block);
return;
}
}
// We should always find the block in the list
// We should always find the block in the list
BURP_error(238, true);
// msg 238: System memory exhausted
// msg 238: System memory exhausted
// (too lazy to add a better message)
}
}

View File

@ -1,7 +1,7 @@
/*
* PROGRAM: JRD Backup and Restore Program
* MODULE: multivol.cpp
* DESCRIPTION:
* DESCRIPTION:
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
@ -84,7 +84,7 @@ static inline void put(BurpGlobals* tdgbl, UCHAR c)
}
#ifdef DEBUG
static UCHAR debug_on = 0; // able to turn this on in debug mode
static UCHAR debug_on = 0; // able to turn this on in debug mode
#endif
const int burp_msg_fac = 12;
@ -253,7 +253,7 @@ void MVOL_init_write(const char* database_name, // unused?
if (tdgbl->action->act_action == ACT_backup_split)
{
BURP_error(269, true, tdgbl->action->act_file->fil_name.c_str());
// msg 269 can't write a header record to file %s
// msg 269 can't write a header record to file %s
}
tdgbl->file_desc = next_volume(tdgbl->file_desc, MODE_WRITE, false);
}
@ -299,12 +299,12 @@ int MVOL_read(int* cnt, UCHAR** ptr)
if (cnt)
{
BURP_error_redirect(0, 220);
// msg 220 Unexpected I/O error while reading from backup file
// msg 220 Unexpected I/O error while reading from backup file
}
else
{
BURP_error_redirect(0, 50);
// msg 50 unexpected end of file on backup file
// msg 50 unexpected end of file on backup file
}
}
}
@ -349,10 +349,10 @@ int MVOL_read(int* cnt, UCHAR** ptr)
{
if (cnt)
BURP_error_redirect(NULL, 220);
// msg 220 Unexpected I/O error while reading from backup file
// msg 220 Unexpected I/O error while reading from backup file
else
BURP_error_redirect(NULL, 50);
// msg 50 unexpected end of file on backup file
// msg 50 unexpected end of file on backup file
}
}
@ -364,7 +364,7 @@ int MVOL_read(int* cnt, UCHAR** ptr)
return *(tdgbl->mvol_io_ptr);
}
#endif // !WIN_NT
#endif // !WIN_NT
//____________________________________________________________
@ -380,23 +380,23 @@ UCHAR* MVOL_read_block(BurpGlobals* tdgbl, UCHAR* ptr, ULONG count)
while (count)
{
// If buffer empty, reload it
// If buffer empty, reload it
if (tdgbl->io_cnt <= 0)
{
*ptr++ = MVOL_read(&tdgbl->io_cnt, &tdgbl->io_ptr);
// One byte was "read" by MVOL_read
// One byte was "read" by MVOL_read
count--;
}
const ULONG n = MIN(count, (ULONG) tdgbl->io_cnt);
// Copy data from the IO buffer
// Copy data from the IO buffer
memcpy(ptr, tdgbl->io_ptr, n);
ptr += n;
// Skip ahead in current buffer
// Skip ahead in current buffer
count -= n;
tdgbl->io_cnt -= n;
@ -420,18 +420,18 @@ void MVOL_skip_block( BurpGlobals* tdgbl, ULONG count)
while (count)
{
// If buffer empty, reload it
// If buffer empty, reload it
if (tdgbl->io_cnt <= 0)
{
MVOL_read(&tdgbl->io_cnt, &tdgbl->io_ptr);
// One byte was "read" by MVOL_read
// One byte was "read" by MVOL_read
count--;
}
const ULONG n = MIN(count, (ULONG) tdgbl->io_cnt);
// Skip ahead in current buffer
// Skip ahead in current buffer
count -= n;
tdgbl->io_cnt -= n;
@ -462,11 +462,11 @@ DESC MVOL_open(const char* name, ULONG mode, ULONG create)
}
else
{
// it's a tape device
// it's a tape device
// Note: we *want* to open the tape in Read-only mode or in
// write-only mode, but it turns out that on NT SetTapePosition
// will fail (thereby not rewinding the tape) if the tape is
// opened write-only, so we will make sure that we always have
// write-only mode, but it turns out that on NT SetTapePosition
// will fail (thereby not rewinding the tape) if the tape is
// opened write-only, so we will make sure that we always have
// read access. So much for standards!
// Ain't Windows wonderful???
//
@ -482,16 +482,16 @@ DESC MVOL_open(const char* name, ULONG mode, ULONG create)
{
// emulate UNIX rewinding the tape on open:
// This MUST be done since Windows does NOT have anything
// like mt to allow the user to do tape management. The
// like mt to allow the user to do tape management. The
// implication here is that we will be able to write ONLY
// one (1) database per tape. This is bad if the user wishes to
// backup several small databases.
// Note: We are intentionally NOT trapping for errors during
// rewind, since if we can not rewind, we are either a non-rewind
// device (then it is user controlled) or we have a problem with
// the physical media. In the latter case I would rather wait for
// the write to fail so that we can loop and prompt the user for
// a different file/device.
// the physical media. In the latter case I would rather wait for
// the write to fail so that we can loop and prompt the user for
// a different file/device.
//
SetTapePosition(handle, TAPE_REWIND, 0, 0, 0, FALSE);
if (GetTapeParameters(handle, GET_TAPE_MEDIA_INFORMATION, &size,
@ -503,7 +503,7 @@ DESC MVOL_open(const char* name, ULONG mode, ULONG create)
}
return handle;
}
#endif // WIN_NT
#endif // WIN_NT
//____________________________________________________________
@ -558,7 +558,7 @@ UCHAR MVOL_write(const UCHAR c, int* io_cnt, UCHAR** io_ptr)
(tdgbl->action->act_action == ACT_backup_split &&
(tdgbl->action->act_file->fil_length < left) ?
tdgbl->action->act_file->fil_length : left);
DWORD err = 0;
// Assumes DWORD <==> ULONG
if (!WriteFile(tdgbl->file_desc, ptr, nBytesToWrite,
@ -566,7 +566,7 @@ UCHAR MVOL_write(const UCHAR c, int* io_cnt, UCHAR** io_ptr)
{
err = GetLastError();
}
#endif // !WIN_NT
#endif // !WIN_NT
tdgbl->mvol_io_buffer = tdgbl->mvol_io_data;
if (cnt > 0)
{
@ -588,7 +588,7 @@ UCHAR MVOL_write(const UCHAR c, int* io_cnt, UCHAR** io_ptr)
errno == EFBIG)
#else
err == ERROR_DISK_FULL || err == ERROR_HANDLE_DISK_FULL)
#endif // !WIN_NT
#endif // !WIN_NT
{
if (tdgbl->action->act_action == ACT_backup_split)
{
@ -604,7 +604,7 @@ UCHAR MVOL_write(const UCHAR c, int* io_cnt, UCHAR** io_ptr)
if (file->fil_fd == tdgbl->file_desc)
file->fil_fd = INVALID_HANDLE_VALUE;
}
tdgbl->action->act_file->fil_fd = INVALID_HANDLE_VALUE;
BURP_print(272, SafeArg() <<
tdgbl->action->act_file->fil_name.c_str() <<
@ -621,7 +621,7 @@ UCHAR MVOL_write(const UCHAR c, int* io_cnt, UCHAR** io_ptr)
else
{
BURP_error(270, true);
// msg 270 free disk space exhausted
// msg 270 free disk space exhausted
}
cnt = 0;
continue;
@ -639,7 +639,7 @@ UCHAR MVOL_write(const UCHAR c, int* io_cnt, UCHAR** io_ptr)
if (left != size_to_write)
{
// Wrote some, move remainder up in buffer.
// Wrote some, move remainder up in buffer.
// NOTE: We should NOT use memcpy here. We're moving overlapped
// data and memcpy does not guanantee the order the data
@ -652,7 +652,7 @@ UCHAR MVOL_write(const UCHAR c, int* io_cnt, UCHAR** io_ptr)
full_buffer = true;
else
full_buffer = false;
tdgbl->file_desc = next_volume(tdgbl->file_desc, MODE_WRITE,
tdgbl->file_desc = next_volume(tdgbl->file_desc, MODE_WRITE,
full_buffer);
if (full_buffer)
{
@ -670,7 +670,7 @@ UCHAR MVOL_write(const UCHAR c, int* io_cnt, UCHAR** io_ptr)
else if (!SYSCALL_INTERRUPTED(errno))
{
BURP_error_redirect(0, 221);
// msg 221 Unexpected I/O error while writing to backup file
// msg 221 Unexpected I/O error while writing to backup file
}
}
if (left < cnt) { // this is impossible, but...
@ -755,7 +755,7 @@ static void bad_attribute(int attribute, USHORT type)
static const SafeArg dummy;
fb_msg_format(NULL, burp_msg_fac, type, sizeof(name), name, dummy);
BURP_print(80, SafeArg() << name << attribute);
// msg 80 don't recognize %s attribute %ld -- continuing
// msg 80 don't recognize %s attribute %ld -- continuing
for (int l = get(tdgbl); l; --l)
get(tdgbl);
}
@ -832,7 +832,7 @@ static DESC next_volume( DESC handle, ULONG mode, bool full_buffer)
if (handle != INVALID_HANDLE_VALUE)
#else
if (handle > -1)
#endif // WIN_NT
#endif // WIN_NT
{
close_platf(handle);
}
@ -858,20 +858,20 @@ static DESC next_volume( DESC handle, ULONG mode, bool full_buffer)
tdgbl->mvol_empty_file = TRUE;
// Loop until we have opened a file successfully
// Loop until we have opened a file successfully
SCHAR new_file[MAX_FILE_NAME_SIZE];
DESC new_desc = INVALID_HANDLE_VALUE;
for (;;)
{
// We aim to keep our descriptors clean
// We aim to keep our descriptors clean
if (new_desc != INVALID_HANDLE_VALUE) {
close_platf(new_desc);
new_desc = INVALID_HANDLE_VALUE;
}
// Get file name to try
// Get file name to try
prompt_for_name(new_file, sizeof(new_file));
@ -881,20 +881,20 @@ static DESC next_volume( DESC handle, ULONG mode, bool full_buffer)
#else
new_desc = open(new_file, mode, open_mask);
if (new_desc < 0)
#endif // WIN_NT
#endif // WIN_NT
{
BURP_print(222, new_file);
// msg 222 \n\nCould not open file name \"%s\"\n
// msg 222 \n\nCould not open file name \"%s\"\n
continue;
}
// If the file is to be writable, probe it, and make sure it is...
// If the file is to be writable, probe it, and make sure it is...
#ifdef WIN_NT
if (mode == MODE_WRITE)
#else
if ((O_WRONLY == (mode & O_WRONLY)) || (O_RDWR == (mode & O_RDWR)))
#endif // WIN_NT
#endif // WIN_NT
{
if (!write_header(new_desc, 0L, full_buffer))
{
@ -905,13 +905,13 @@ static DESC next_volume( DESC handle, ULONG mode, bool full_buffer)
else
{
BURP_msg_put(261, SafeArg() << tdgbl->mvol_volume_count << new_file);
// Starting with volume #vol_count, new_file
// Starting with volume #vol_count, new_file
BURP_verbose(75, new_file); // msg 75 creating file %s
}
}
else
{
// File is open for read only. Read the header.
// File is open for read only. Read the header.
ULONG temp_buffer_size;
USHORT format;
@ -923,7 +923,7 @@ static DESC next_volume( DESC handle, ULONG mode, bool full_buffer)
else
{
BURP_msg_put(261, SafeArg() << tdgbl->mvol_volume_count << new_file);
// Starting with volume #vol_count, new_file
// Starting with volume #vol_count, new_file
BURP_verbose(100, new_file); // msg 100 opened file %s
}
}
@ -961,11 +961,11 @@ static void prompt_for_name(SCHAR* name, int length)
term_in = stdin;
}
// Loop until we have a file name to try
// Loop until we have a file name to try
for (;;)
{
// If there was an old file name, use that prompt
// If there was an old file name, use that prompt
if (strlen(tdgbl->mvol_old_file) > 0)
{
@ -973,14 +973,14 @@ static void prompt_for_name(SCHAR* name, int length)
tdgbl->mvol_old_file);
fprintf(term_out, msg);
BURP_msg_get(226, msg);
// \tPress return to reopen that file, or type a new\n\tname
// \tPress return to reopen that file, or type a new\n\tname
// followed by return to open a different file.\n
fprintf(term_out, msg);
}
else // First volume
else // First volume
{
BURP_msg_get(227, msg);
// Type a file name to open and hit return
// Type a file name to open and hit return
fprintf(term_out, msg);
}
BURP_msg_get(228, msg); // " Name: "
@ -1005,11 +1005,11 @@ static void prompt_for_name(SCHAR* name, int length)
strcpy(name, tdgbl->mvol_old_file);
break;
}
else // reprompt
else // reprompt
continue;
}
// OK, its a file name, strip the carriage return
// OK, its a file name, strip the carriage return
SCHAR* name_ptr = name;
while (*name_ptr && *name_ptr != '\n')
@ -1089,12 +1089,12 @@ static bool read_header(DESC handle,
BurpGlobals* tdgbl = BurpGlobals::getSpecific();
// Headers are a version number, and a volume number
// Headers are a version number, and a volume number
// CVC: Nobody does an explicit check for the read operation, assuming
// that GET_ATTRIBUTE() != rec_burp will provide an implicit test.
#ifndef WIN_NT
tdgbl->mvol_io_cnt = read(handle, tdgbl->mvol_io_buffer,
tdgbl->mvol_io_cnt = read(handle, tdgbl->mvol_io_buffer,
tdgbl->mvol_actual_buffer_size);
#else
ReadFile(handle, tdgbl->mvol_io_buffer, tdgbl->mvol_actual_buffer_size,
@ -1105,7 +1105,7 @@ static bool read_header(DESC handle,
int attribute = get(tdgbl);
if (attribute != rec_burp)
BURP_error_redirect(0, 45);
// msg 45 expected backup description record
// msg 45 expected backup description record
int l, maxlen;
int temp;
@ -1294,7 +1294,7 @@ static bool write_header(DESC handle,
#else
ULONG bytes_written = write(handle, tdgbl->mvol_io_header,
tdgbl->mvol_io_buffer_size);
#endif // WIN_NT
#endif // WIN_NT
if (bytes_written != tdgbl->mvol_io_buffer_size)
{
@ -1349,7 +1349,7 @@ bool MVOL_split_hdr_write(void)
#else
ULONG bytes_written =
write(tdgbl->action->act_file->fil_fd, buffer, HDR_SPLIT_SIZE);
#endif // WIN_NT
#endif // WIN_NT
if (bytes_written != HDR_SPLIT_SIZE) {
return false;

View File

@ -62,7 +62,7 @@ StatusVector::ImplStatusVector::ImplStatusVector(const ISC_STATUS* s) throw() :
StatusVector::StatusVector(ISC_STATUS k, ISC_STATUS c) :
Base(FB_NEW(*getDefaultMemoryPool()) ImplStatusVector(k, c))
{
{
operator<<(*(static_cast<Base*>(this)));
}
@ -71,7 +71,7 @@ StatusVector::StatusVector(const ISC_STATUS* s) :
{
}
StatusVector::StatusVector() :
StatusVector::StatusVector() :
Base(FB_NEW(*getDefaultMemoryPool()) ImplStatusVector(0, 0))
{
}
@ -95,21 +95,21 @@ void StatusVector::ImplStatusVector::append(const StatusVector& v) throw()
newVector.appendWarnings(v.implementation);
}
}
*this = newVector;
}
bool StatusVector::ImplStatusVector::appendErrors(const ImplBase* const v) throw()
{
return append(v->value(), v->firstWarning() ? v->firstWarning() : v->length());
}
}
bool StatusVector::ImplStatusVector::appendWarnings(const ImplBase* const v) throw()
{
if (! v->firstWarning())
return true;
return append(v->value() + v->firstWarning(), v->length() - v->firstWarning());
}
}
bool StatusVector::ImplStatusVector::append(const ISC_STATUS* const from, const int count) throw()
{
@ -193,43 +193,43 @@ ISC_STATUS StatusVector::ImplStatusVector::copyTo(ISC_STATUS* dest) const throw(
return dest[1];
}
Gds::Gds(ISC_STATUS s) throw() :
Gds::Gds(ISC_STATUS s) throw() :
StatusVector(isc_arg_gds, s) { }
Num::Num(ISC_STATUS s) throw() :
Num::Num(ISC_STATUS s) throw() :
Base(isc_arg_number, s) { }
Interpreted::Interpreted(const char* text) throw() :
Interpreted::Interpreted(const char* text) throw() :
StatusVector(isc_arg_interpreted, (ISC_STATUS)(IPTR) text) { }
Interpreted::Interpreted(const AbstractString& text) throw() :
Interpreted::Interpreted(const AbstractString& text) throw() :
StatusVector(isc_arg_interpreted, (ISC_STATUS)(IPTR) text.c_str()) { }
Unix::Unix(ISC_STATUS s) throw() :
Unix::Unix(ISC_STATUS s) throw() :
Base(isc_arg_unix, s) { }
Windows::Windows(ISC_STATUS s) throw() :
Windows::Windows(ISC_STATUS s) throw() :
Base(isc_arg_win32, s) { }
Warning::Warning(ISC_STATUS s) throw() :
Warning::Warning(ISC_STATUS s) throw() :
StatusVector(isc_arg_warning, s) { }
Str::Str(const char* text) throw() :
Str::Str(const char* text) throw() :
Base(isc_arg_string, (ISC_STATUS)(IPTR) text) { }
Str::Str(const AbstractString& text) throw() :
Str::Str(const AbstractString& text) throw() :
Base(isc_arg_string, (ISC_STATUS)(IPTR) text.c_str()) { }
Str::Str(const MetaName& text) throw() :
Str::Str(const MetaName& text) throw() :
Base(isc_arg_string, (ISC_STATUS)(IPTR) text.c_str()) { }
SqlState::SqlState(const char* text) throw() :
SqlState::SqlState(const char* text) throw() :
Base(isc_arg_sql_state, (ISC_STATUS)(IPTR) text) { }
SqlState::SqlState(const AbstractString& text) throw() :
SqlState::SqlState(const AbstractString& text) throw() :
Base(isc_arg_sql_state, (ISC_STATUS)(IPTR) text.c_str()) { }
OsError::OsError() throw() :
OsError::OsError() throw() :
#ifdef WIN_NT
Base(isc_arg_win32, GetLastError()) { }
#else

View File

@ -1,7 +1,7 @@
/*
* PROGRAM: Firebird exceptions classes
* MODULE: StatusHolder.cpp
* DESCRIPTION: Firebird's exception classes
* DESCRIPTION: Firebird's exception classes
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
@ -42,14 +42,14 @@ ISC_STATUS StatusHolder::save(const ISC_STATUS* status)
const ISC_STATUS *from = status;
ISC_STATUS *to = m_status_vector;
while (true)
while (true)
{
const ISC_STATUS type = *to++ = *from++;
if (type == isc_arg_end)
break;
switch (type) {
case isc_arg_cstring:
case isc_arg_cstring:
{
const size_t len = *to++ = *from++;
char *string = FB_NEW(*getDefaultMemoryPool()) char[len];
@ -64,7 +64,7 @@ ISC_STATUS StatusHolder::save(const ISC_STATUS* status)
case isc_arg_sql_state:
{
const char* temp = reinterpret_cast<const char*>(*from++);
const size_t len = strlen(temp);
char* string = FB_NEW(*getDefaultMemoryPool()) char[len + 1];
memcpy(string, temp, len + 1);
@ -84,7 +84,7 @@ ISC_STATUS StatusHolder::save(const ISC_STATUS* status)
void StatusHolder::clear()
{
ISC_STATUS *ptr = m_status_vector;
while (true)
while (true)
{
const ISC_STATUS type = *ptr++;
if (type == isc_arg_end)
@ -105,18 +105,18 @@ void StatusHolder::clear()
default:
ptr++;
break;
}
}
}
memset(m_status_vector, 0, sizeof(m_status_vector));
m_raised = false;
}
void StatusHolder::raise()
{
if (getError())
{
if (getError())
{
m_raised = true;
throw status_exception(m_status_vector, true);
throw status_exception(m_status_vector, true);
}
}

View File

@ -1,7 +1,7 @@
/*
* PROGRAM: Firebird utilities interface
* MODULE: UtilSvc.cpp
* DESCRIPTION: Interface making it possible to use same code
* DESCRIPTION: Interface making it possible to use same code
* as both utility or service
*
* The contents of this file are subject to the Initial
@ -49,7 +49,7 @@ public:
}
}
virtual void printf(const SCHAR* format, ...)
virtual void printf(const SCHAR* format, ...)
{
va_list arglist;
va_start(arglist, format);
@ -90,7 +90,7 @@ public:
{
StringsBuffer::makeEnginePermanentVector(s);
}
// do nothing for non-service
virtual void finish() { }
virtual void started() { }

View File

@ -92,9 +92,9 @@ int StringStream::write(const void* str, unsigned int n)
}
else
m_current_pos += avail;
m_current_pos[0] = 0;
return avail;
}

View File

@ -58,12 +58,12 @@ public:
return t2;
}
protected:
virtual void usage_mistake(const char* what) const
virtual void usage_mistake(const char* what) const
{
fatal_exception::raiseFmt(
"Internal error when using clumplet API: %s", what);
}
virtual void invalid_structure(const char* what) const
virtual void invalid_structure(const char* what) const
{
fatal_exception::raiseFmt(
"Invalid clumplet buffer structure: %s", what);
@ -80,7 +80,7 @@ void ClumpletReader::dump() const
return;
}
dmp++;
try {
ClumpletDump d(kind, getBuffer(), getBufferLength());
int t = (kind == SpbStart || kind == UnTagged || kind == WideUnTagged) ? -1 : d.getBufferTag();
@ -107,13 +107,13 @@ void ClumpletReader::dump() const
namespace Firebird {
ClumpletReader::ClumpletReader(Kind k, const UCHAR* buffer, size_t buffLen) :
kind(k), static_buffer(buffer), static_buffer_end(buffer + buffLen)
kind(k), static_buffer(buffer), static_buffer_end(buffer + buffLen)
{
rewind(); // this will set cur_offset and spbState
}
ClumpletReader::ClumpletReader(MemoryPool& pool, Kind k, const UCHAR* buffer, size_t buffLen) :
AutoStorage(pool), kind(k), static_buffer(buffer), static_buffer_end(buffer + buffLen)
AutoStorage(pool), kind(k), static_buffer(buffer), static_buffer_end(buffer + buffLen)
{
rewind(); // this will set cur_offset and spbState
}
@ -140,13 +140,13 @@ UCHAR ClumpletReader::getBufferTag() const
{
const UCHAR* const buffer_end = getBufferEnd();
const UCHAR* buffer_start = getBuffer();
switch (kind)
switch (kind)
{
case Tpb:
case Tagged:
case WideTagged:
if (buffer_end - buffer_start == 0)
if (buffer_end - buffer_start == 0)
{
invalid_structure("empty buffer");
return 0;
@ -159,7 +159,7 @@ UCHAR ClumpletReader::getBufferTag() const
usage_mistake("buffer is not tagged");
return 0;
case SpbAttach:
if (buffer_end - buffer_start == 0)
if (buffer_end - buffer_start == 0)
{
invalid_structure("empty buffer");
return 0;
@ -167,12 +167,12 @@ UCHAR ClumpletReader::getBufferTag() const
switch (buffer_start[0])
{
case isc_spb_version1:
// This is old SPB format, it's almost like DPB -
// This is old SPB format, it's almost like DPB -
// buffer's tag is the first byte.
return buffer_start[0];
case isc_spb_version:
// Buffer's tag is the second byte
if (buffer_end - buffer_start == 1)
if (buffer_end - buffer_start == 1)
{
invalid_structure("buffer too short (1 byte)");
return 0;
@ -215,7 +215,7 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const
return SingleTpb;
case isc_action_svc_backup:
case isc_action_svc_restore:
switch (tag)
switch (tag)
{
case isc_spb_bkp_file:
case isc_spb_dbname:
@ -235,7 +235,7 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const
invalid_structure("unknown parameter for backup/restore");
break;
case isc_action_svc_repair:
switch (tag)
switch (tag)
{
case isc_spb_dbname:
return StringSpb;
@ -247,11 +247,11 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const
}
invalid_structure("unknown parameter for repair");
break;
case isc_action_svc_add_user:
case isc_action_svc_add_user:
case isc_action_svc_delete_user:
case isc_action_svc_modify_user:
case isc_action_svc_display_user:
switch (tag)
switch (tag)
{
case isc_spb_dbname:
case isc_spb_sql_role_name:
@ -269,7 +269,7 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const
invalid_structure("unknown parameter for security database operation");
break;
case isc_action_svc_properties:
switch (tag)
switch (tag)
{
case isc_spb_dbname:
return StringSpb;
@ -296,7 +296,7 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const
// case isc_action_svc_add_license:
// case isc_action_svc_remove_license:
case isc_action_svc_db_stats:
switch (tag)
switch (tag)
{
case isc_spb_dbname:
case isc_spb_command_line:
@ -311,7 +311,7 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const
break;
case isc_action_svc_nbak:
case isc_action_svc_nrest:
switch (tag)
switch (tag)
{
case isc_spb_nbk_file:
case isc_spb_dbname:
@ -358,7 +358,7 @@ size_t ClumpletReader::getClumpletSize(bool wTag, bool wLength, bool wData) cons
size_t rc = wTag ? 1 : 0;
size_t lengthSize = 0;
size_t dataSize = 0;
switch (getClumpletType(clumplet[0]))
{
@ -455,7 +455,7 @@ void ClumpletReader::rewind()
}
if (kind == UnTagged || kind == WideUnTagged || kind == SpbStart || kind == SpbItems)
cur_offset = 0;
else if (kind == SpbAttach && getBufferLength() > 0
else if (kind == SpbAttach && getBufferLength() > 0
&& getBuffer()[0] != isc_spb_version1)
cur_offset = 2;
else

View File

@ -36,20 +36,20 @@
namespace Firebird {
ClumpletWriter::ClumpletWriter(Kind k, size_t limit, UCHAR tag) :
ClumpletReader(k, NULL, 0), sizeLimit(limit), dynamic_buffer(getPool())
ClumpletWriter::ClumpletWriter(Kind k, size_t limit, UCHAR tag) :
ClumpletReader(k, NULL, 0), sizeLimit(limit), dynamic_buffer(getPool())
{
initNewBuffer(tag);
rewind();
}
ClumpletWriter::ClumpletWriter(MemoryPool& given_pool, Kind k, size_t limit, UCHAR tag) :
ClumpletReader(given_pool, k, NULL, 0), sizeLimit(limit), dynamic_buffer(getPool())
ClumpletWriter::ClumpletWriter(MemoryPool& given_pool, Kind k, size_t limit, UCHAR tag) :
ClumpletReader(given_pool, k, NULL, 0), sizeLimit(limit), dynamic_buffer(getPool())
{
initNewBuffer(tag);
rewind();
}
void ClumpletWriter::initNewBuffer(UCHAR tag)
{
switch (kind)
@ -72,7 +72,7 @@ void ClumpletWriter::initNewBuffer(UCHAR tag)
}
ClumpletWriter::ClumpletWriter(Kind k, size_t limit, const UCHAR* buffer, size_t buffLen, UCHAR tag) :
ClumpletReader(k, NULL, 0), sizeLimit(limit), dynamic_buffer(getPool())
ClumpletReader(k, NULL, 0), sizeLimit(limit), dynamic_buffer(getPool())
{
if (buffer && buffLen) {
dynamic_buffer.push(buffer, buffLen);
@ -85,7 +85,7 @@ ClumpletWriter::ClumpletWriter(Kind k, size_t limit, const UCHAR* buffer, size_t
ClumpletWriter::ClumpletWriter(MemoryPool& given_pool, Kind k, size_t limit,
const UCHAR* buffer, size_t buffLen, UCHAR tag) :
ClumpletReader(given_pool, k, NULL, 0), sizeLimit(limit), dynamic_buffer(getPool())
ClumpletReader(given_pool, k, NULL, 0), sizeLimit(limit), dynamic_buffer(getPool())
{
if (buffer && buffLen) {
dynamic_buffer.push(buffer, buffLen);
@ -203,7 +203,7 @@ void ClumpletWriter::insertBytesLengthCheck(UCHAR tag, const UCHAR* bytes, const
usage_mistake("write past EOF");
return;
}
// Check length according to clumplet type
const ClumpletType t = getClumpletType(tag);
UCHAR lenSize = 0;
@ -344,7 +344,7 @@ void ClumpletWriter::deleteClumplet()
if (buffer_end - clumplet < 2) {
// It appears we're erasing EOF marker
dynamic_buffer.shrink(cur_offset);
}
}
else {
dynamic_buffer.removeCount(cur_offset, getClumpletSize(true, true, true));
}

View File

@ -25,7 +25,7 @@
*
*
*/
#include "firebird.h"
#include <stdarg.h>
@ -49,7 +49,7 @@ namespace Firebird {
return *this;
}
int MetaName::compare(const char* s, size_t l) const
int MetaName::compare(const char* s, size_t l) const
{
if (s)
{
@ -83,7 +83,7 @@ namespace Firebird {
void MetaName::upper7()
{
for (char* p = data; *p; p++)
for (char* p = data; *p; p++)
{
*p = UPPER7(*p);
}
@ -91,7 +91,7 @@ namespace Firebird {
void MetaName::lower7()
{
for (char* p = data; *p; p++)
for (char* p = data; *p; p++)
{
*p = LOWWER7(*p);
}

View File

@ -216,7 +216,7 @@ int MsgPrintHelper(BaseStream& out_stream, const safe_cell& item)
size_t n = strlen(s);
if (n > MAX_STRING)
n = MAX_STRING;
return out_stream.write(s, n);
}
case safe_cell::at_ptr:
@ -293,7 +293,7 @@ int MsgPrint(const char* format, const SafeArg& arg)
int MsgPrint(const char* format)
{
static const SafeArg dummy;
StdioStream st(stdout);
return MsgPrint(st, format, dummy);
}

View File

@ -25,7 +25,7 @@
*
*/
// Localized messages type-safe printing facility.
#include "firebird.h"
@ -311,10 +311,10 @@ void SafeArg::dump(const TEXT* target[], size_t v_size) const
const safe_cell& SafeArg::getCell(size_t index) const
{
static safe_cell aux_cell = {safe_cell::at_none, {0}};
if (index < m_count)
return m_arguments[index];
return aux_cell;
}

View File

@ -52,7 +52,7 @@
// Const definitions
static const char* ENV_VAR = "FIREBIRD_TMP";
static const char* DEFAULT_PATH =
static const char* DEFAULT_PATH =
#if defined(UNIX)
"/tmp/";
#elif defined(WIN_NT)
@ -234,7 +234,7 @@ void TempFile::seek(const offset_t offset)
{
if (position == offset)
return;
#if defined(WIN_NT)
LARGE_INTEGER liOffset;
liOffset.QuadPart = offset;

View File

@ -53,7 +53,7 @@
#define FREE_PATTERN 0xDEADBEEF
#define ALLOC_PATTERN 0xFEEDABED
#ifdef DEBUG_GDS_ALLOC
inline void PATTERN_FILL(void* ptr, size_t size, unsigned int pattern)
inline void PATTERN_FILL(void* ptr, size_t size, unsigned int pattern)
{
for (size_t i = 0; i < size / sizeof(unsigned int); i++)
{
@ -90,13 +90,13 @@ inline static void mem_assert(bool value)
// Returns redirect list for given memory block
inline MemoryRedirectList* block_list_small(MemoryBlock* block)
{
return (MemoryRedirectList*)((char*)block + MEM_ALIGN(sizeof(MemoryBlock)) +
return (MemoryRedirectList*)((char*)block + MEM_ALIGN(sizeof(MemoryBlock)) +
block->mbk_small.mbk_length - MEM_ALIGN(sizeof(MemoryRedirectList)));
}
inline MemoryRedirectList* block_list_large(MemoryBlock* block)
{
return (MemoryRedirectList*)((char*)block + MEM_ALIGN(sizeof(MemoryBlock)) +
return (MemoryRedirectList*)((char*)block + MEM_ALIGN(sizeof(MemoryBlock)) +
block->mbk_large_length - MEM_ALIGN(sizeof(MemoryRedirectList)));
}
@ -167,7 +167,7 @@ int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */
#if defined(WIN_NT) || defined(HAVE_MMAP)
// Extents cache is not used when DEBUG_GDS_ALLOC or USE_VALGRIND is enabled.
// This slows down things a little due to frequent syscalls mapping/unmapping
// This slows down things a little due to frequent syscalls mapping/unmapping
// memory but allows to detect more allocation errors
Vector<void*, MAP_CACHE_SIZE> extents_cache;
Mutex* cache_mutex; // Will be initialized manually in MemoryPool::init
@ -177,7 +177,7 @@ size_t map_page_size = 0;
inline size_t get_map_page_size()
{
if (! map_page_size)
if (! map_page_size)
{
map_page_size = get_page_size();
}
@ -258,7 +258,7 @@ MemoryPool* MemoryPool::setContextPool(MemoryPool* newPool)
TLS_SET(contextPool, newPool);
return old;
}
MemoryPool* MemoryPool::getContextPool()
{
return TLS_GET(contextPool);
@ -269,7 +269,7 @@ MemoryStats* MemoryPool::default_stats_group = NULL;
MemoryPool* MemoryPool::processMemoryPool = NULL;
// Initialize process memory pool (called from InstanceControl).
// At this point also set contextMemoryPool for main thread
// At this point also set contextMemoryPool for main thread
// (or all process in case of no threading).
void MemoryPool::init()
@ -311,7 +311,7 @@ void MemoryPool::setStatsGroup(MemoryStats& statsL)
// to be safe
if (parent)
parent->lock.enter();
lock.enter();
const size_t sav_used_memory = used_memory.value();
const size_t sav_mapped_memory = mapped_memory;
@ -319,18 +319,18 @@ void MemoryPool::setStatsGroup(MemoryStats& statsL)
decrement_usage(sav_used_memory);
this->stats = &statsL;
increment_mapping(sav_mapped_memory);
increment_usage(sav_used_memory);
increment_usage(sav_used_memory);
lock.leave();
if (parent)
parent->lock.leave();
}
MemoryPool::MemoryPool(MemoryPool* parentL,
MemoryPool::MemoryPool(MemoryPool* parentL,
MemoryStats &statsL, void *first_extent, void *root_page
) :
parent_redirect(parentL != NULL),
freeBlocks((InternalAllocator*)this, root_page),
extents((MemoryExtent *)first_extent),
extents((MemoryExtent *)first_extent),
needSpare(false),
pendingFree(NULL),
used_memory(0),
@ -379,7 +379,7 @@ void MemoryPool::updateSpare()
// Blocks added with tree_deallocate may require merging with nearby ones
// This is why we do internal_deallocate
internal_deallocate(temp); // Note that this method may change pendingFree!
if (needSpare)
break; // New pages were added to tree. Loop again
}
@ -394,7 +394,7 @@ void* MemoryPool::external_alloc(size_t &size)
{
// This method is assumed to return NULL in case it cannot alloc
size = FB_ALIGN(size, get_map_page_size());
void *result = mmap(NULL, size, PROT_READ | PROT_WRITE,
void *result = mmap(NULL, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
// Let Valgrind forget that block was zero-initialized
VALGRIND_DISCARD(
@ -478,7 +478,7 @@ void* MemoryPool::external_alloc(size_t &size)
# endif
# if defined WIN_NT
size = FB_ALIGN(size, get_map_page_size());
return VirtualAlloc(NULL, size, MEM_COMMIT,
return VirtualAlloc(NULL, size, MEM_COMMIT,
PAGE_READWRITE);
# elif defined (HAVE_MMAP) && !defined(SOLARIS)
@ -489,16 +489,16 @@ void* MemoryPool::external_alloc(size_t &size)
size = FB_ALIGN(size, get_map_page_size());
void* result = NULL;
# ifdef MAP_ANONYMOUS
result = mmap(NULL, size, PROT_READ | PROT_WRITE,
result = mmap(NULL, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
# else
# else
// This code is needed for Solaris 2.6, AFAIK (only?)
if (dev_zero_fd < 0)
dev_zero_fd = open("/dev/zero", O_RDWR);
result = mmap(NULL, size, PROT_READ | PROT_WRITE,
result = mmap(NULL, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE, dev_zero_fd, 0);
# endif //MAP_ANONYMOUS
return result == MAP_FAILED ? NULL : result;
return result == MAP_FAILED ? NULL : result;
# elif defined(SOLARIS)
// No successful return from mmap() will return the value MAP_FAILED.
@ -510,33 +510,33 @@ void* MemoryPool::external_alloc(size_t &size)
void *result = NULL;
# ifdef MAP_ANONYMOUS
result = mmap(0, size, PROT_READ | PROT_WRITE,
result = mmap(0, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON , -1, 0);
if (result == MAP_FAILED) {
// failure happens!
return NULL;
}
}
else {
return result;
}
# else
return result;
}
# else
// This code is needed for Solaris 2.6, AFAIK
if (dev_zero_fd < 0)
dev_zero_fd = open("/dev/zero", O_RDWR);
result = mmap(NULL, size, PROT_READ | PROT_WRITE,
result = mmap(NULL, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE, dev_zero_fd, 0);
if (result == MAP_FAILED) {
return NULL;
}
}
else {
return result;
}
return result;
}
# endif //MAP_ANONYMOUS
# else
return malloc(size);
# endif
}
void MemoryPool::external_free(void *blk, size_t &size, bool pool_destroying)
{
# if !defined(DEBUG_GDS_ALLOC) && (defined(WIN_NT) || defined(HAVE_MMAP))
@ -558,7 +558,7 @@ void MemoryPool::external_free(void *blk, size_t &size, bool pool_destroying)
if (munmap((caddr_t) blk, size))
system_call_failed::raise("munmap");
# else
# else
if (munmap(blk, size))
system_call_failed::raise("munmap");
# endif /*Solaris*/
@ -573,8 +573,8 @@ void* MemoryPool::tree_alloc(size_t size)
{
if (size == sizeof(FreeBlocksTree::ItemList))
// This condition is to handle case when nodelist and itemlist have equal size
if (sizeof(FreeBlocksTree::ItemList) != sizeof(FreeBlocksTree::NodeList) ||
spareLeafs.getCount())
if (sizeof(FreeBlocksTree::ItemList) != sizeof(FreeBlocksTree::NodeList) ||
spareLeafs.getCount())
{
if (!spareLeafs.getCount())
Firebird::BadAlloc::raise();
@ -623,7 +623,7 @@ void* MemoryPool::allocate_nothrow(size_t size
if (parent_redirect)
{
// We do not synchronize redirect_amount here. In the worst case we redirect slightly
// We do not synchronize redirect_amount here. In the worst case we redirect slightly
// more allocations to parent than we wanted. This shouldn't cause problems
if (redirect_amount + size < REDIRECT_THRESHOLD)
{
@ -667,7 +667,7 @@ void* MemoryPool::allocate_nothrow(size_t size
{ // It may have changed while we were taking the lock
parent_redirect = false;
// Do some hard manual work to initialize first extent
// This is the exact initial layout of memory pool in the first extent //
// MemoryExtent
// MemoryBlock
@ -726,7 +726,7 @@ void* MemoryPool::allocate_nothrow(size_t size
lock.enter();
// If block cannot fit into extent then allocate it from OS directly
if (size > EXTENT_SIZE - MEM_ALIGN(sizeof(MemoryBlock)) - MEM_ALIGN(sizeof(MemoryExtent))) {
size_t ext_size = MEM_ALIGN(sizeof(MemoryBlock)) + size +
size_t ext_size = MEM_ALIGN(sizeof(MemoryBlock)) + size +
MEM_ALIGN(sizeof(MemoryRedirectList));
MemoryBlock *blk = (MemoryBlock*) external_alloc(ext_size);
if (!blk) {
@ -759,7 +759,7 @@ void* MemoryPool::allocate_nothrow(size_t size
//VALGRIND_MAKE_NOACCESS((char*)result - VALGRIND_REDZONE, VALGRIND_REDZONE);
//VALGRIND_MAKE_WRITABLE(result, requested_size);
//VALGRIND_MAKE_NOACCESS((char*)result + requested_size, VALGRIND_REDZONE);
#endif
#endif
return result;
}
// Otherwise use conventional allocator
@ -780,7 +780,7 @@ void* MemoryPool::allocate_nothrow(size_t size
//VALGRIND_MAKE_NOACCESS((char*)result - VALGRIND_REDZONE, VALGRIND_REDZONE);
//VALGRIND_MAKE_WRITABLE(result, requested_size);
//VALGRIND_MAKE_NOACCESS((char*)result + requested_size, VALGRIND_REDZONE);
#endif
#endif
return result;
}
@ -802,22 +802,22 @@ void* MemoryPool::allocate(size_t size
bool MemoryPool::verify_pool(bool fast_checks_only)
{
lock.enter();
mem_assert(!pendingFree || needSpare); // needSpare flag should be set if we are in
mem_assert(!pendingFree || needSpare); // needSpare flag should be set if we are in
// a critically low memory condition
size_t blk_used_memory = 0;
size_t blk_mapped_memory = 0;
// Verify that free blocks tree is consistent and indeed contains free memory blocks
if (freeBlocks.getFirst())
if (freeBlocks.getFirst())
do {
BlockInfo *current = &freeBlocks.current();
// Verify that head of free blocks list set correctly
mem_assert(current->bli_fragments);
mem_assert(ptrToBlock(current->bli_fragments)->mbk_prev_fragment == NULL);
// Look over all blocks in list checking that things look kosher
for (FreeMemoryBlock *fragment = current->bli_fragments;
for (FreeMemoryBlock *fragment = current->bli_fragments;
fragment; fragment = fragment->fbk_next_fragment)
{
// Make sure that list is actually doubly linked
@ -847,11 +847,11 @@ bool MemoryPool::verify_pool(bool fast_checks_only)
blk_mapped_memory += EXTENT_SIZE;
USHORT prev_length = 0;
for (MemoryBlock *blk = (MemoryBlock *)((char*)extent + MEM_ALIGN(sizeof(MemoryExtent)));
;
;
blk = next_block(blk))
{
// Verify block flags, large blocks are not allowed here
mem_assert(!(blk->mbk_flags &
mem_assert(!(blk->mbk_flags &
~(MBK_USED | MBK_LAST | MBK_PARENT | MBK_DELAYED)));
// Check that if block is marked as delayed free it is still accounted as used
@ -866,8 +866,8 @@ bool MemoryPool::verify_pool(bool fast_checks_only)
}
// Calculate memory usage
if ((blk->mbk_flags & MBK_USED) && !(blk->mbk_flags & MBK_PARENT) &&
!(blk->mbk_flags & MBK_DELAYED) && (blk->mbk_type >= 0))
if ((blk->mbk_flags & MBK_USED) && !(blk->mbk_flags & MBK_PARENT) &&
!(blk->mbk_flags & MBK_DELAYED) && (blk->mbk_type >= 0))
{
blk_used_memory += blk->mbk_small.mbk_length;
}
@ -897,7 +897,7 @@ bool MemoryPool::verify_pool(bool fast_checks_only)
mem_assert(foundPending || ptrToBlock(freeBlocks.current().bli_fragments) == blk);
}
// See if next fragment seems kosher
// See if next fragment seems kosher
// (note that FreeMemoryBlock has the same structure as PendingFreeBlock so we can do this check)
FreeMemoryBlock *next_fragment = blockToPtr<FreeMemoryBlock*>(blk)->fbk_next_fragment;
if (next_fragment) {
@ -909,9 +909,9 @@ bool MemoryPool::verify_pool(bool fast_checks_only)
}
if (fast_checks_only) {
foundTree = !(blk->mbk_flags & MBK_USED) &&
foundTree = !(blk->mbk_flags & MBK_USED) &&
(blk->mbk_prev_fragment || ptrToBlock(freeBlocks.current().bli_fragments) == blk);
}
}
else {
for (FreeMemoryBlock* freeBlk = freeBlocks.current().bli_fragments; freeBlk; freeBlk = freeBlk->fbk_next_fragment)
{
@ -1009,7 +1009,7 @@ bool MemoryPool::verify_pool(bool fast_checks_only)
else {
mem_assert(blk_used_memory == (size_t) used_memory.value());
}
return true;
}
@ -1017,8 +1017,8 @@ static void print_block(FILE *file, MemoryBlock *blk, bool used_only,
const char* filter_path, const size_t filter_len)
{
void *mem = blockToPtr<void*>(blk);
if (((blk->mbk_flags & MBK_USED) &&
!(blk->mbk_flags & MBK_DELAYED) && blk->mbk_type >= 0) || !used_only)
if (((blk->mbk_flags & MBK_USED) &&
!(blk->mbk_flags & MBK_DELAYED) && blk->mbk_type >= 0) || !used_only)
{
char flags[100];
flags[0] = 0;
@ -1068,7 +1068,7 @@ void MemoryPool::print_contents(FILE *file, bool used_only,
const char* filter_path)
{
lock.enter();
fprintf(file, "********* Printing contents of pool %p used=%ld mapped=%ld:\n",
fprintf(file, "********* Printing contents of pool %p used=%ld mapped=%ld:\n",
this, (long)used_memory.value(), (long)mapped_memory);
const size_t filter_len = filter_path ? strlen(filter_path) : 0;
@ -1077,7 +1077,7 @@ void MemoryPool::print_contents(FILE *file, bool used_only,
if (!used_only)
fprintf(file, "EXTENT %p:\n", extent);
for (MemoryBlock *blk = (MemoryBlock *)((char*)extent + MEM_ALIGN(sizeof(MemoryExtent)));
;
;
blk = next_block(blk))
{
print_block(file, blk, used_only, filter_path, filter_len);
@ -1103,12 +1103,12 @@ void MemoryPool::print_contents(FILE *file, bool used_only,
fprintf(file, "********* End of output for pool %p.\n", this);
}
MemoryPool* MemoryPool::createPool(MemoryPool* parent, MemoryStats &stats)
MemoryPool* MemoryPool::createPool(MemoryPool* parent, MemoryStats &stats)
{
MemoryPool *pool;
#ifndef USE_VALGRIND
// If pool has a parent things are simplified.
// Note we do not use parent redirection when using Valgrind because it is
// Note we do not use parent redirection when using Valgrind because it is
// difficult to make memory pass through any delayed free list in this case
if (parent) {
parent->lock.enter();
@ -1130,7 +1130,7 @@ MemoryPool* MemoryPool::createPool(MemoryPool* parent, MemoryStats &stats)
pool->parent_redirected = blk;
parent->lock.leave();
}
}
else
#endif
{
@ -1157,11 +1157,11 @@ MemoryPool* MemoryPool::createPool(MemoryPool* parent, MemoryStats &stats)
pool = new(mem +
MEM_ALIGN(sizeof(MemoryExtent)) +
MEM_ALIGN(sizeof(MemoryBlock)))
MemoryPool(NULL, stats, mem, mem +
MEM_ALIGN(sizeof(MemoryExtent)) +
MEM_ALIGN(sizeof(MemoryBlock)) +
MEM_ALIGN(sizeof(MemoryPool)) +
MEM_ALIGN(sizeof(MemoryBlock)))
MemoryPool(NULL, stats, mem, mem +
MEM_ALIGN(sizeof(MemoryExtent)) +
MEM_ALIGN(sizeof(MemoryBlock)) +
MEM_ALIGN(sizeof(MemoryPool)) +
MEM_ALIGN(sizeof(MemoryBlock)));
pool->increment_mapping(EXTENT_SIZE);
@ -1257,13 +1257,13 @@ void MemoryPool::deletePool(MemoryPool* pool)
MemoryExtent *next = extent->mxt_next;
size_t ext_size = EXTENT_SIZE;
external_free(extent, ext_size, true);
fb_assert(ext_size == EXTENT_SIZE); // Make sure exent size is a multiply of page size
fb_assert(ext_size == EXTENT_SIZE); // Make sure exent size is a multiply of page size
extent = next;
}
// Deallocate blocks redirected to parent
// IF parent is set then pool was allocated from it and is not deleted at this point yet
if (parent) {
if (parent) {
parent->lock.enter();
MemoryBlock *redirected = pool->parent_redirected;
while (redirected) {
@ -1276,10 +1276,10 @@ void MemoryPool::deletePool(MemoryPool* pool)
// Remove protection from red zones of memory block or block as whole if it is
// in delayed free queue. Since this code makes pointers to deallocated memory
// immediately valid we disable parent redirection in USE_VALGRIND mode. Code is
// immediately valid we disable parent redirection in USE_VALGRIND mode. Code is
// here for case if you want to debug something with parent redirection enabled.
VALGRIND_DISCARD(
VALGRIND_MAKE_WRITABLE((char*)redirected + MEM_ALIGN(sizeof(MemoryBlock)) - VALGRIND_REDZONE,
VALGRIND_MAKE_WRITABLE((char*)redirected + MEM_ALIGN(sizeof(MemoryBlock)) - VALGRIND_REDZONE,
(redirected->mbk_flags & MBK_LARGE ? redirected->mbk_large_length: redirected->mbk_small.mbk_length) -
(redirected->mbk_flags & (MBK_LARGE | MBK_PARENT) ? MEM_ALIGN(sizeof(MemoryRedirectList)) : 0) +
VALGRIND_REDZONE)
@ -1352,20 +1352,20 @@ void* MemoryPool::internal_alloc(size_t size, SSHORT type
FreeMemoryBlock *next_free = current->bli_fragments->fbk_next_fragment;
if (next_free) {
// Moderately cheap case. Quite possibly we only need to tweak doubly
// Moderately cheap case. Quite possibly we only need to tweak doubly
// linked lists a little
ptrToBlock(next_free)->mbk_prev_fragment = NULL;
current->bli_fragments = next_free;
addFreeBlock(current_block);
}
}
else {
// This is special handling of case when we have single large fragment and
// cut off small pieces from it. This is common and we avoid modification
// cut off small pieces from it. This is common and we avoid modification
// of free blocks tree in this case.
bool get_prev_succeeded = freeBlocks.getPrev();
if (!get_prev_succeeded || freeBlocks.current().bli_length < current_block->mbk_small.mbk_length) {
current->bli_length = current_block->mbk_small.mbk_length;
}
}
else {
// Moderately expensive case. We need to modify tree for sure
if (get_prev_succeeded) {
@ -1406,7 +1406,7 @@ void* MemoryPool::internal_alloc(size_t size, SSHORT type
if (prev)
prev->next = itr->next;
else
pendingFree = itr->next;
pendingFree = itr->next;
PATTERN_FILL(itr, size, ALLOC_PATTERN);
return itr;
@ -1460,8 +1460,8 @@ void* MemoryPool::internal_alloc(size_t size, SSHORT type
blk->mbk_line = line;
#endif
blk->mbk_small.mbk_prev_length = 0;
if (EXTENT_SIZE - size - MEM_ALIGN(sizeof(MemoryExtent)) - MEM_ALIGN(sizeof(MemoryBlock))
< MEM_ALIGN(sizeof(MemoryBlock)) + ALLOC_ALIGNMENT)
if (EXTENT_SIZE - size - MEM_ALIGN(sizeof(MemoryExtent)) - MEM_ALIGN(sizeof(MemoryBlock))
< MEM_ALIGN(sizeof(MemoryBlock)) + ALLOC_ALIGNMENT)
{
// Block is small enough to be returned AS IS
blk->mbk_flags |= MBK_LAST;
@ -1475,7 +1475,7 @@ void* MemoryPool::internal_alloc(size_t size, SSHORT type
// Will be initialized (to NULL) by addFreeBlock code
// rest->mbk_pool = this;
rest->mbk_flags = MBK_LAST;
rest->mbk_small.mbk_length = EXTENT_SIZE - MEM_ALIGN(sizeof(MemoryExtent)) -
rest->mbk_small.mbk_length = EXTENT_SIZE - MEM_ALIGN(sizeof(MemoryExtent)) -
MEM_ALIGN(sizeof(MemoryBlock)) - size - MEM_ALIGN(sizeof(MemoryBlock));
rest->mbk_small.mbk_prev_length = blk->mbk_small.mbk_length;
addFreeBlock(rest);
@ -1516,10 +1516,10 @@ inline void MemoryPool::addFreeBlock(MemoryBlock *blk)
// NOTE! Items placed into pendingFree queue have mbk_prev_fragment equal to ZERO.
}
}
void MemoryPool::removeFreeBlock(MemoryBlock *blk)
{
// NOTE! We signal items placed into pendingFree queue via setting their
// NOTE! We signal items placed into pendingFree queue via setting their
// mbk_prev_fragment to ZERO.
FreeMemoryBlock *fragmentToRemove = blockToPtr<FreeMemoryBlock*>(blk);
@ -1527,7 +1527,7 @@ void MemoryPool::removeFreeBlock(MemoryBlock *blk)
FreeMemoryBlock *next = fragmentToRemove->fbk_next_fragment;
if (prev) {
// Cheapest case. There is no need to touch B+ tree at all.
// Simply remove item from a middle or end of doubly linked list
// Simply remove item from a middle or end of doubly linked list
prev->fbk_next_fragment = next;
if (next)
ptrToBlock(next)->mbk_prev_fragment = prev;
@ -1536,8 +1536,8 @@ void MemoryPool::removeFreeBlock(MemoryBlock *blk)
// Need to locate item in tree
BlockInfo* current;
if (freeBlocks.locate(blk->mbk_small.mbk_length) &&
(current = &freeBlocks.current())->bli_fragments == fragmentToRemove)
if (freeBlocks.locate(blk->mbk_small.mbk_length) &&
(current = &freeBlocks.current())->bli_fragments == fragmentToRemove)
{
if (next) {
// Still moderately fast case. All we need is to replace the head of fragments list
@ -1550,10 +1550,10 @@ void MemoryPool::removeFreeBlock(MemoryBlock *blk)
}
}
else {
// Our block could be in the pending free blocks list if we are in a
// critically-low memory condition or if tree_free placed it there.
// Our block could be in the pending free blocks list if we are in a
// critically-low memory condition or if tree_free placed it there.
// Find and remove it from there.
PendingFreeBlock *itr = pendingFree,
PendingFreeBlock *itr = pendingFree,
*temp = blockToPtr<PendingFreeBlock*>(blk);
if (itr == temp)
pendingFree = itr->next;
@ -1584,12 +1584,12 @@ void MemoryPool::free_blk_extent(MemoryBlock *blk)
if (extent->mxt_next)
extent->mxt_next->mxt_prev = extent->mxt_prev;
fb_assert(blk->mbk_small.mbk_length + MEM_ALIGN(sizeof(MemoryBlock)) +
fb_assert(blk->mbk_small.mbk_length + MEM_ALIGN(sizeof(MemoryBlock)) +
MEM_ALIGN(sizeof(MemoryExtent)) == EXTENT_SIZE);
size_t ext_size = EXTENT_SIZE;
external_free(extent, ext_size, false);
fb_assert(ext_size == EXTENT_SIZE); // Make sure exent size is a multiply of page size
fb_assert(ext_size == EXTENT_SIZE); // Make sure exent size is a multiply of page size
decrement_mapping(EXTENT_SIZE);
}
@ -1598,11 +1598,11 @@ void MemoryPool::internal_deallocate(void *block)
MemoryBlock *blk = ptrToBlock(block);
// This method is normally called for used blocks from our pool. Also it may
// be called for free blocks in pendingFree list by updateSpare routine.
// be called for free blocks in pendingFree list by updateSpare routine.
// Such blocks must have mbk_prev_fragment equal to NULL.
fb_assert(
blk->mbk_flags & MBK_USED ?
blk->mbk_flags & MBK_USED ?
blk->mbk_pool == this :
blk->mbk_prev_fragment == NULL);
@ -1643,8 +1643,8 @@ void MemoryPool::internal_deallocate(void *block)
// Mark block as free
blk->mbk_flags &= ~MBK_USED;
// Try to merge block with next free block
if (!(blk->mbk_flags & MBK_LAST) &&
!((next = next_block(blk))->mbk_flags & MBK_USED))
if (!(blk->mbk_flags & MBK_LAST) &&
!((next = next_block(blk))->mbk_flags & MBK_USED))
{
removeFreeBlock(next);
blk->mbk_small.mbk_length += next->mbk_small.mbk_length + MEM_ALIGN(sizeof(MemoryBlock));
@ -1694,12 +1694,12 @@ void MemoryPool::deallocate(void *block)
VALGRIND_MEMPOOL_FREE(this, block);
// Make it read and write protected
int handle =
VALGRIND_MAKE_NOACCESS((char*)block - VALGRIND_REDZONE,
int handle =
VALGRIND_MAKE_NOACCESS((char*)block - VALGRIND_REDZONE,
(blk->mbk_flags & MBK_LARGE ? blk->mbk_large_length: blk->mbk_small.mbk_length) -
(blk->mbk_flags & (MBK_LARGE | MBK_PARENT) ? MEM_ALIGN(sizeof(MemoryRedirectList)) : 0) +
VALGRIND_REDZONE);
// Extend circular buffer if possible
if (delayedFreeCount < FB_NELEM(delayedFree)) {
delayedFree[delayedFreeCount] = block;
@ -1723,7 +1723,7 @@ void MemoryPool::deallocate(void *block)
// Remove protection from memory block
VALGRIND_DISCARD(
VALGRIND_MAKE_WRITABLE((char*)block - VALGRIND_REDZONE,
VALGRIND_MAKE_WRITABLE((char*)block - VALGRIND_REDZONE,
(blk->mbk_flags & MBK_LARGE ? blk->mbk_large_length: blk->mbk_small.mbk_length) -
(blk->mbk_flags & (MBK_LARGE | MBK_PARENT) ? MEM_ALIGN(sizeof(MemoryRedirectList)) : 0) +
VALGRIND_REDZONE)
@ -1804,7 +1804,7 @@ void MemoryPool::deallocate(void *block)
}
MemoryPool& AutoStorage::getAutoMemoryPool()
{
{
#ifndef SUPERCLIENT
MemoryPool* p = MemoryPool::getContextPool();
if (! p)
@ -1815,15 +1815,15 @@ MemoryPool& AutoStorage::getAutoMemoryPool()
MemoryPool* p = getDefaultMemoryPool();
#endif //SUPERCLIENT
fb_assert(p);
return *p;
return *p;
}
#if defined(DEV_BUILD)
void AutoStorage::ProbeStack() const
{
//
// AutoStorage() default constructor can be used only
// for objects on the stack. ProbeStack() uses the
// AutoStorage() default constructor can be used only
// for objects on the stack. ProbeStack() uses the
// following assumptions to check it:
// 1. One and only one stack is used for all kind of variables.
// 2. Objects don't grow > 64K.

View File

@ -22,7 +22,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
*
*
*/
@ -43,7 +43,7 @@ const int TEST_ITEMS = 5000000;
void report(int scaleNode, int scaleTree) {
clock_t d = clock();
printf("Add+remove %d elements from tree of scale %d/%d took %d milliseconds. \n",
printf("Add+remove %d elements from tree of scale %d/%d took %d milliseconds. \n",
TEST_ITEMS, scaleNode, scaleTree, (int)(d-t)*1000/CLOCKS_PER_SEC);
}
@ -61,9 +61,9 @@ static void testTree() {
}
printf(" DONE\n");
MallocAllocator temp;
start();
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
DefaultComparator<int>, 30, 30> tree30(NULL);
for (i=0; i<TEST_ITEMS;i++)
tree30.add((*v)[i]);
@ -74,7 +74,7 @@ static void testTree() {
report(30, 30);
start();
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
DefaultComparator<int>, 50, 50> tree50(NULL);
for (i=0; i<TEST_ITEMS;i++)
tree50.add((*v)[i]);
@ -83,9 +83,9 @@ static void testTree() {
tree50.fastRemove();
}
report(50, 50);
start();
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
DefaultComparator<int>, 75, 75> tree75(NULL);
for (i=0; i<TEST_ITEMS;i++)
tree75.add((*v)[i]);
@ -94,9 +94,9 @@ static void testTree() {
tree75.fastRemove();
}
report(75, 75);
start();
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
DefaultComparator<int>, 100, 100> tree100(NULL);
for (i=0; i<TEST_ITEMS;i++)
tree100.add((*v)[i]);
@ -107,7 +107,7 @@ static void testTree() {
report(100, 100);
start();
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
DefaultComparator<int>, 100, 250> tree100_250(NULL);
for (i=0; i<TEST_ITEMS;i++)
tree100_250.add((*v)[i]);
@ -116,9 +116,9 @@ static void testTree() {
tree100_250.fastRemove();
}
report(100, 250);
start();
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
BePlusTree<int, int, MallocAllocator, DefaultKeyValue<int>,
DefaultComparator<int>, 200, 200> tree200(NULL);
for (i=0; i<TEST_ITEMS;i++)
tree200.add((*v)[i]);
@ -127,7 +127,7 @@ static void testTree() {
tree200.fastRemove();
}
report(250, 250);
std::set<int> stlTree;
start();
for (i=0; i<TEST_ITEMS;i++)
@ -135,7 +135,7 @@ static void testTree() {
for (i=0; i<TEST_ITEMS;i++)
stlTree.erase((*v)[i]);
clock_t d = clock();
printf("Just a reference: add+remove %d elements from STL tree took %d milliseconds. \n",
printf("Just a reference: add+remove %d elements from STL tree took %d milliseconds. \n",
TEST_ITEMS, (int)(d-t)*1000/CLOCKS_PER_SEC);
}
@ -177,7 +177,7 @@ static void testAllocatorOverhead() {
if (items.getFirst()) do {
items.current();
n++;
} while (n < ALLOC_ITEMS / 2 && items.getNext());
} while (n < ALLOC_ITEMS / 2 && items.getNext());
// Allocate big items
for (i=0;i<BIG_ITEMS;i++) {
n = n * 47163 - 57412;
@ -194,16 +194,16 @@ static void testAllocatorOverhead() {
} while (bigItems.getNext());
report();
}
static void testAllocatorMemoryPool() {
printf("Test run for Firebird::MemoryPool...\n");
start();
Firebird::MemoryPool* pool = Firebird::MemoryPool::createPool();
Firebird::MemoryPool* pool = Firebird::MemoryPool::createPool();
MallocAllocator allocator;
BePlusTree<AllocItem, AllocItem, MallocAllocator, DefaultKeyValue<AllocItem>, AllocItem> items(&allocator),
bigItems(&allocator);
// Allocate small items
int i, n = 0;
int i, n = 0;
for (i=0;i<ALLOC_ITEMS;i++) {
n = n * 47163 - 57412;
AllocItem temp = {n, pool->allocate((n % MAX_ITEM_SIZE + MAX_ITEM_SIZE) / 2 + 1)};
@ -214,7 +214,7 @@ static void testAllocatorMemoryPool() {
if (items.getFirst()) do {
pool->deallocate(items.current().item);
n++;
} while (n < ALLOC_ITEMS / 2 && items.getNext());
} while (n < ALLOC_ITEMS / 2 && items.getNext());
// Allocate big items
for (i=0;i<BIG_ITEMS;i++) {
n = n * 47163 - 57412;
@ -251,7 +251,7 @@ static void testAllocatorMalloc() {
if (items.getFirst()) do {
free(items.current().item);
n++;
} while (n < ALLOC_ITEMS / 2 && items.getNext());
} while (n < ALLOC_ITEMS / 2 && items.getNext());
// Allocate big items
for (i=0;i<BIG_ITEMS;i++) {
n = n * 47163 - 57412;
@ -289,7 +289,7 @@ static void testAllocatorMalloc() {
if (items.getFirst()) do {
pool->deallocate(items.current().item);
n++;
} while (n < ALLOC_ITEMS / 2 && items.getNext());
} while (n < ALLOC_ITEMS / 2 && items.getNext());
// Allocate big items
for (i=0;i<BIG_ITEMS;i++) {
n = n * 47163 - 57412;

View File

@ -22,7 +22,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
*
*
*
*/
@ -111,16 +111,16 @@ void testBitmap() {
printf(" DONE\n");
printf("Verify CLEAR(V) operation for correctness");
for (i = 0; i < BITMAP_ITEMS; i++) {
for (i = 0; i < BITMAP_ITEMS; i++) {
if (tree.locate(v1[i])) {
bool result = bitmap.clear(v1[i]);
tree.fastRemove();
fb_assert(result == true);
}
}
else {
bool result = bitmap.clear(v1[i]);
fb_assert(result == false);
}
}
}
printf(" DONE\n");
@ -143,7 +143,7 @@ void testBitmap() {
else
if (!tree2.getNext()) break;
}
SparseBitmap<ULONG> *and_res = SparseBitmap<ULONG>::bit_and(&bitmap, &bitmap2);
bool has1 = tree2.getFirst(), has2 = and_res->getFirst();
@ -154,9 +154,9 @@ void testBitmap() {
has2 = and_res->getNext();
fb_assert(has1 == has2);
fb_assert((ULONG)tree2.current() == and_res->current());
}
}
printf(" DONE\n");
printf("Verify OR operation for correctness (and backwards iterator)");
tree.clear();
@ -199,7 +199,7 @@ struct Test {
void testBePlusTree() {
MallocAllocator temp;
printf("Test Firebird::BePlusTree\n");
printf("Fill array with test data (%d items)...", (int)TEST_ITEMS);
Vector<int, TEST_ITEMS> v;
int n = 0;
@ -210,11 +210,11 @@ void testBePlusTree() {
v.add(((i + n) % TEST_ITEMS + TEST_ITEMS) / 2);
}
printf(" DONE\n");
printf("Create two trees one with factor 2 and one with factor 13 and fill them with test data: ");
BePlusTree<Test, int, MallocAllocator, Test,
BePlusTree<Test, int, MallocAllocator, Test,
DefaultComparator<int>, 2, 2> tree1(&temp);
BePlusTree<Test, int, MallocAllocator, Test,
BePlusTree<Test, int, MallocAllocator, Test,
DefaultComparator<int>, 13, 13> tree2(&temp);
int cnt1 = 0, cnt2 = 0;
for (i = 0; i < v.getCount(); i++) {
@ -237,10 +237,10 @@ void testBePlusTree() {
if (!tree2.add(t))
fb_assert(false);
cnt2++;
}
}
}
printf(" DONE\n");
bool passed = true;
printf("Empty trees verifying fastRemove() result: ");
@ -277,7 +277,7 @@ void testBePlusTree() {
passed = false;
printf(passed ? "PASSED\n" : "FAILED\n");
passed = true;
printf("Fill trees with data again: ");
cnt1 = 0; cnt2 = 0;
for (i = 0; i < v.getCount(); i++) {
@ -300,10 +300,10 @@ void testBePlusTree() {
if (!tree2.add(t))
fb_assert(false);
cnt2++;
}
}
}
printf(" DONE\n");
printf("Check that tree(2) contains test data: ");
for (i = 0; i < v.getCount(); i++) {
if (!tree1.locate(locEqual, v[i]))
@ -311,27 +311,27 @@ void testBePlusTree() {
}
printf(passed ? "PASSED\n" : "FAILED\n");
passed = true;
printf("Check that tree(13) contains test data: ");
for (i = 0; i < v.getCount(); i++) {
if (!tree2.locate(locEqual, v[i]))
passed = false;
}
printf(passed ? "PASSED\n" : "FAILED\n");
passed = true;
printf("Check that tree(2) contains data from the tree(13) and its count is correct: ");
n = 0;
if (tree1.getFirst()) do {
n++;
if (!tree2.locate(locEqual, tree1.current().value))
if (!tree2.locate(locEqual, tree1.current().value))
passed = false;
} while (tree1.getNext());
if (n != cnt1 || cnt1 != cnt2)
if (n != cnt1 || cnt1 != cnt2)
passed = false;
printf(passed ? "PASSED\n" : "FAILED\n");
printf("Check that tree(13) contains data from the tree(2) "\
"and its count is correct (check in reverse order): ");
n = 0;
@ -343,13 +343,13 @@ void testBePlusTree() {
if (n != cnt2)
passed = false;
printf(passed ? "PASSED\n" : "FAILED\n");
printf("Remove half of data from the trees: ");
passed = true;
while (v.getCount() > TEST_ITEMS / 2) {
if (!tree1.locate(locEqual, v[v.getCount() - 1]))
fb_assert(false);
if (tree1.current().count > 1)
if (tree1.current().count > 1)
tree1.current().count--;
else {
int nextValue = -1;
@ -360,7 +360,7 @@ void testBePlusTree() {
if (tree1.fastRemove()) {
if (tree1.current().value != nextValue)
passed = false;
}
}
else {
if (nextValue >= 0)
passed = false;
@ -369,7 +369,7 @@ void testBePlusTree() {
}
if (!tree2.locate(locEqual, v[v.getCount() - 1]))
fb_assert(false);
if (tree2.current().count > 1)
if (tree2.current().count > 1)
tree2.current().count--;
else {
int nextValue = -1;
@ -380,7 +380,7 @@ void testBePlusTree() {
if (tree2.fastRemove()) {
if (tree2.current().value != nextValue)
passed = false;
}
}
else {
if (nextValue >= 0)
passed = false;
@ -390,26 +390,26 @@ void testBePlusTree() {
v.shrink(v.getCount() - 1);
}
printf(passed ? "PASSED\n" : "FAILED\n");
passed = true;
printf("Check that tree(2) contains test data: ");
for (i = 0; i < v.getCount(); i++) {
if (!tree1.locate(locEqual, v[i]))
passed = false;
}
}
printf(passed ? "PASSED\n" : "FAILED\n");
passed = true;
printf("Check that tree(13) contains test data: ");
for (i = 0; i < v.getCount(); i++) {
if (!tree2.locate(locEqual, v[i]))
passed = false;
}
}
printf(passed ? "PASSED\n" : "FAILED\n");
passed = true;
printf("Check that tree(2) contains data from the tree(13) and its count is correct: ");
n = 0;
if (tree1.getFirst()) do {
@ -417,12 +417,12 @@ void testBePlusTree() {
if (!tree2.locate(locEqual, tree1.current().value))
passed = false;
} while (tree1.getNext());
if (n != cnt1 || cnt1 != cnt2)
if (n != cnt1 || cnt1 != cnt2)
passed = false;
printf(passed ? "PASSED\n" : "FAILED\n");
passed = true;
printf("Check that tree(13) contains data from the tree(2) "\
"and its count is correct (check in reverse order): ");
n = 0;
@ -431,17 +431,17 @@ void testBePlusTree() {
if (!tree1.locate(locEqual, tree2.current().value))
passed = false;
} while (tree2.getPrev());
if (n != cnt2)
if (n != cnt2)
passed = false;
printf(passed ? "PASSED\n" : "FAILED\n");
passed = true;
printf("Remove the rest of data from the trees: ");
for (i = 0;i < v.getCount(); i++) {
if (!tree1.locate(locEqual, v[i]))
fb_assert(false);
if (tree1.current().count > 1)
if (tree1.current().count > 1)
tree1.current().count--;
else {
int nextValue = -1;
@ -452,7 +452,7 @@ void testBePlusTree() {
if (tree1.fastRemove()) {
if (tree1.current().value != nextValue)
passed = false;
}
}
else {
if (nextValue >= 0)
passed = false;
@ -472,7 +472,7 @@ void testBePlusTree() {
if (tree2.fastRemove()) {
if (tree2.current().value != nextValue)
passed = false;
}
}
else {
if (nextValue >= 0)
passed = false;
@ -515,11 +515,11 @@ void testAllocator() {
printf("Test Firebird::MemoryPool\n");
MemoryPool* parent = getDefaultMemoryPool();
MemoryPool* pool = MemoryPool::createPool(parent);
MallocAllocator allocator;
BePlusTree<AllocItem, AllocItem, MallocAllocator, DefaultKeyValue<AllocItem>, AllocItem> items(&allocator),
bigItems(&allocator);
Vector<void*, LARGE_ITEMS> la;
printf("Allocate %d large items: ", LARGE_ITEMS);
int i;
@ -529,7 +529,7 @@ void testAllocator() {
}
VERIFY_POOL(pool);
printf(" DONE\n");
printf("Allocate %d items: ", ALLOC_ITEMS);
int n = 0;
VERIFY_POOL(pool);
@ -542,7 +542,7 @@ void testAllocator() {
printf(" DONE\n");
VERIFY_POOL(pool);
VERIFY_POOL(parent);
printf("Deallocate half of items in quasi-random order: ");
n = 0;
if (items.getFirst()) do {
@ -552,7 +552,7 @@ void testAllocator() {
printf(" DONE\n");
VERIFY_POOL(pool);
VERIFY_POOL(parent);
printf("Allocate %d big items: ", BIG_ITEMS);
n = 0;
VERIFY_POOL(pool);
@ -565,7 +565,7 @@ void testAllocator() {
printf(" DONE\n");
VERIFY_POOL(pool);
VERIFY_POOL(parent);
printf("Deallocate the rest of small items in quasi-random order: ");
while (items.getNext()) {
pool->deallocate(items.current().item);
@ -573,26 +573,26 @@ void testAllocator() {
printf(" DONE\n");
VERIFY_POOL(pool);
VERIFY_POOL(parent);
printf("Deallocate big items in quasi-random order: ");
if (bigItems.getFirst()) do {
pool->deallocate(bigItems.current().item);
} while (bigItems.getNext());
printf(" DONE\n");
printf("Deallocate %d large items: ", LARGE_ITEMS/2);
for (i = 0; i<LARGE_ITEMS/2; i++)
pool->deallocate(la[i]);
VERIFY_POOL(pool);
printf(" DONE\n");
// pool->verify_pool();
// parent->verify_pool();
pool->print_contents(stdout, false);
parent->print_contents(stdout, false);
MemoryPool::deletePool(pool);
// parent->verify_pool();
// parent->verify_pool();
// TODO:
// Test critically low memory conditions
// Test that tree correctly recovers in low-memory conditions

View File

@ -2,7 +2,7 @@
* PROGRAM: string class definition
* MODULE: fb_string.cpp
* DESCRIPTION: Provides almost that same functionality,
* that STL::basic_string<char> does,
* that STL::basic_string<char> does,
* but behaves MemoryPools friendly.
*
* The contents of this file are subject to the Initial
@ -115,7 +115,7 @@ namespace Firebird {
initialize(sizeL);
memset(stringBuffer, c, sizeL);
}
void AbstractString::adjustRange(const size_type length, size_type& pos, size_type& n)
{
if (pos == npos) {
@ -153,7 +153,7 @@ namespace Firebird {
return baseAppend(n);
}
reserveBuffer(stringLength + n);
memmove(stringBuffer + p0 + n, stringBuffer + p0,
memmove(stringBuffer + p0 + n, stringBuffer + p0,
stringLength - p0 + 1); // Do not forget to move null terminator too
stringLength += n;
return stringBuffer + p0;
@ -162,7 +162,7 @@ namespace Firebird {
void AbstractString::baseErase(size_type p0, size_type n)
{
adjustRange(length(), p0, n);
memmove(stringBuffer + p0,
memmove(stringBuffer + p0,
stringBuffer + p0 + n, stringLength - (p0 + n) + 1);
stringLength -= n;
shrinkBuffer();
@ -295,7 +295,7 @@ namespace Firebird {
baseErase(0, length());
if (! file)
return false;
bool rc = false;
int c;
while ((c = getc(file)) != EOF) {
@ -423,7 +423,7 @@ extern "C" {
}
}
resize(l);
return;
return;
}
temp[tempsize - 1] = 0;
if (l < tempsize) {

View File

@ -1,7 +1,7 @@
/*
* PROGRAM: Client/Server Common Code
* MODULE: locks.cpp
* DESCRIPTION: Win32 Mutex support compatible with
* DESCRIPTION: Win32 Mutex support compatible with
* old OS versions (like Windows 95)
*
* The contents of this file are subject to the Initial
@ -46,7 +46,7 @@ TryEnterCS::TryEnterCS()
{
HMODULE kernel32 = GetModuleHandle("kernel32.dll");
if (kernel32) {
m_funct = (tTryEnterCriticalSection*)
m_funct = (tTryEnterCriticalSection*)
GetProcAddress(kernel32, "TryEnterCriticalSection");
}
}
@ -68,7 +68,7 @@ void Spinlock::init()
SetCriticalSectionSpinCount = MISS_SPIN_COUNT;
return;
}
SetCriticalSectionSpinCount =
SetCriticalSectionSpinCount =
(tSetCriticalSectionSpinCount *) GetProcAddress(
kernel32, "SetCriticalSectionSpinCount");
if (!SetCriticalSectionSpinCount) {

View File

@ -33,7 +33,7 @@
/*
There is a problem with values returned by sem_open() in MacOS 10.5 and earlier.
They are not pointers. They are handles, in format of file handle (0,1,2,3,...),
and worse - they share same space with actual file handles. And when we close
and worse - they share same space with actual file handles. And when we close
unneeded file handles in divorce_terminal(), we kill all global semaphores.
MIXED_SEMAPHORE_AND_FILE_HANDLE exists to avoid it.
*/

View File

@ -2,7 +2,7 @@ char lbl[] = "0123456789";
//#define CHECK_FATAL_RANGE_EXCEPTION
//Don't modify 3 lines upper from this - they are used in file read test
//If you plan to check range exception, you may uncomment it -
//If you plan to check range exception, you may uncomment it -
//anyway file test should not happen
/*
@ -184,7 +184,7 @@ void test(void) {
}
{
string a, b, c;
a = "uuu";
b = lbl;
c = a + b;
@ -254,19 +254,19 @@ void test(void) {
{
string a, b;
b = lbl;
a.assign(3, 'u');
validate(a, "uuu");
a.assign(lbl);
validate(a, lbl);
a.assign(lbl, 2);
validate(a, "01");
a.assign(b, 3, 3);
validate(a, "345");
a.assign(b);
validate(a, lbl);
@ -287,15 +287,15 @@ void test(void) {
a = lbl;
a.insert(3, lbl);
validate(a, "01201234567893456789");
a = lbl;
a.insert(4, lbl, 2);
validate(a, "012301456789");
a = lbl;
a.insert(5, b, 3, 3);
validate(a, "0123434556789");
a = lbl;
a.insert(5, b);
validate(a, "01234012345678956789");
@ -313,8 +313,8 @@ void test(void) {
a = lbl;
x = a.begin();
x += 2;
string::iterator f = b.begin();
string::iterator t = b.end();
string::iterator f = b.begin();
string::iterator t = b.end();
f++; t--;
a.insert(x, f, t);
validate(a, "011234567823456789");
@ -368,27 +368,27 @@ void test(void) {
a = lbl;
a.replace(3, 3, lbl);
validate(a, "01201234567896789");
a = lbl;
f0 = a.begin() + 3;
t0 = f0 + 3;
a.replace(f0, t0, lbl);
validate(a, "01201234567896789");
a = lbl;
a.replace(4, 4, lbl, 2);
validate(a, "01230189");
a = lbl;
f0 = a.begin() + 4;
t0 = f0 + 4;
a.replace(f0, t0, lbl, 2);
validate(a, "01230189");
a = lbl;
a.replace(5, 10, b, 3, 3);
validate(a, "01234345");
a = lbl;
f0 = a.begin() + 5;
t0 = f0 + 10;
@ -396,7 +396,7 @@ void test(void) {
t = f + 3;
a.replace(f0, t0, f, t);
validate(a, "01234345");
a = lbl;
a.replace(5, 0, b);
validate(a, "01234012345678956789");
@ -406,7 +406,7 @@ void test(void) {
t0 = f0;
a.replace(f0, t0, b);
validate(a, "01234012345678956789");
a = lbl;
a.replace(2, 1, "Something reaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaally long");
validate(a, "01Something reaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaally long3456789");
@ -428,7 +428,7 @@ void test(void) {
// a.swap(b);
// validate(b, "3456789");
// validate(a, lbl);
// validate(a, lbl);
}
#ifdef DEV_BUILD
@ -441,7 +441,7 @@ void test(void) {
string a = "012345uuu345678";
// 9
string b = "345";
check(a.find(b), 3);
check(a.find("45"), 4);
check(a.find('5'), 5);
@ -561,7 +561,7 @@ void test(void) {
check(c.compare(d), 1);
check(c.compare(e), 1);
check(a.compare(1, 10, b), 1);
check(a.compare(1, 10, b, 1, 10), 0);
check(a.compare(lbl), 0);
@ -570,7 +570,7 @@ void test(void) {
#ifdef FULL_FIRE
{
string a = " 011100 ", b;
b = a;
b.ltrim();
validate(b, "011100 ");
@ -631,7 +631,7 @@ void start() {
void report() {
clock_t d = clock();
printf("Test of %d iterations with %s took %d milliseconds.\n",
printf("Test of %d iterations with %s took %d milliseconds.\n",
TEST_ITEMS, NAME, (int)(d-t)*1000/CLOCKS_PER_SEC);
}

View File

@ -53,7 +53,7 @@ TimeStamp TimeStamp::getCurrentTimeStamp()
// NS: We round generated timestamps to whole millisecond.
// Not many applications can deal with fractional milliseconds properly and
// we do not use high resolution timers either so actual time granularity
// is going to to be somewhere in range between 1 ms (like on UNIX/Risc)
// is going to to be somewhere in range between 1 ms (like on UNIX/Risc)
// and 53 ms (such as Win9X)
time_t seconds; // UTC time
@ -71,7 +71,7 @@ TimeStamp TimeStamp::getCurrentTimeStamp()
milliseconds = time_buffer.millitm;
#endif
// NS: Current FB behavior of using server time zone is not appropriate for
// NS: Current FB behavior of using server time zone is not appropriate for
// distributed applications. We should be storing UTC times everywhere and
// convert timestamps to client timezone as necessary. Replace localtime stuff
// with these lines as soon as the appropriate functionality is implemented
@ -255,12 +255,12 @@ void TimeStamp::round_time(ISC_TIME &ntime, const int precision)
{
const int scale = -ISC_TIME_SECONDS_PRECISION_SCALE - precision;
// for the moment, if greater precision was requested than we can
// for the moment, if greater precision was requested than we can
// provide return what we have.
if (scale <= 0)
return;
static const ISC_TIME pow10table[] =
static const ISC_TIME pow10table[] =
{1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
fb_assert(scale < FB_NELEM(pow10table));

View File

@ -135,7 +135,7 @@ static Firebird::InitInstance<ConfigImpl> sysConfig;
* Implementation interface
*/
ConfigImpl::ConfigImpl(MemoryPool& p) : ConfigRoot(p)
ConfigImpl::ConfigImpl(MemoryPool& p) : ConfigRoot(p)
{
/* Prepare some stuff */
@ -244,7 +244,7 @@ static Firebird::PathName* rootFromCommandLine = 0;
void Config::setRootDirectoryFromCommandLine(const Firebird::PathName& newRoot)
{
delete rootFromCommandLine;
rootFromCommandLine = FB_NEW(*getDefaultMemoryPool())
rootFromCommandLine = FB_NEW(*getDefaultMemoryPool())
Firebird::PathName(*getDefaultMemoryPool(), newRoot);
}

View File

@ -179,7 +179,7 @@ string ConfigFile::parseValueFrom(string inputLine, string::size_type initialPos
{
return inputLine.substr(startPos + 1, inputLine.length() - startPos - 2);
}
return inputLine.substr(startPos);
}

View File

@ -28,7 +28,7 @@
namespace Firebird {
void ParsedPath::parse(const PathName& path)
void ParsedPath::parse(const PathName& path)
{
clear();
@ -46,7 +46,7 @@ void ParsedPath::parse(const PathName& path)
} while (oldpath.length() > 0);
}
PathName ParsedPath::subPath(size_t n) const
PathName ParsedPath::subPath(size_t n) const
{
PathName rc = (*this)[0];
if (PathUtils::isRelative(rc + PathUtils::dir_sep))
@ -59,14 +59,14 @@ PathName ParsedPath::subPath(size_t n) const
return rc;
}
ParsedPath::operator PathName() const
ParsedPath::operator PathName() const
{
if (!getCount())
return "";
return subPath(getCount());
}
bool ParsedPath::contains(const ParsedPath& pPath) const
bool ParsedPath::contains(const ParsedPath& pPath) const
{
size_t nFullElem = getCount();
if (nFullElem > 1 && (*this)[nFullElem - 1].length() == 0)
@ -75,7 +75,7 @@ bool ParsedPath::contains(const ParsedPath& pPath) const
if (pPath.getCount() < nFullElem) {
return false;
}
size_t i;
for (i = 0; i < nFullElem; i++) {
if (pPath[i] != (*this)[i]) {
@ -92,10 +92,10 @@ bool ParsedPath::contains(const ParsedPath& pPath) const
}
bool DirectoryList::keyword(
const ListMode keyMode,
PathName& value,
PathName key,
PathName next)
const ListMode keyMode,
PathName& value,
PathName key,
PathName next)
{
if (value.length() < key.length()) {
return false;
@ -128,7 +128,7 @@ bool DirectoryList::keyword(
return true;
}
void DirectoryList::initialize(bool simple_mode)
void DirectoryList::initialize(bool simple_mode)
{
if (mode != NotInitialized)
return;
@ -141,7 +141,7 @@ void DirectoryList::initialize(bool simple_mode)
mode = SimpleList;
}
else {
if (keyword(None, val, "None", "") ||
if (keyword(None, val, "None", "") ||
keyword(Full, val, "Full", "")) {
return;
}
@ -185,7 +185,7 @@ void DirectoryList::initialize(bool simple_mode)
add(ParsedPath(dir));
}
bool DirectoryList::isPathInList(const PathName& path) const
bool DirectoryList::isPathInList(const PathName& path) const
{
#ifdef BOOT_BUILD
return true;
@ -211,7 +211,7 @@ bool DirectoryList::isPathInList(const PathName& path) const
PathName varpath(path);
if (PathUtils::isRelative(path)) {
PathUtils::concatPath(varpath,
PathUtils::concatPath(varpath,
PathName(Config::getRootDirectory()), path);
}
@ -227,7 +227,7 @@ bool DirectoryList::isPathInList(const PathName& path) const
#endif //BOOT_BUILD
}
bool DirectoryList::expandFileName(PathName& path, const PathName& name) const
bool DirectoryList::expandFileName(PathName& path, const PathName& name) const
{
fb_assert(mode != NotInitialized);
for (size_t i = 0; i < getCount(); i++) {

View File

@ -297,7 +297,7 @@ static void integer_to_text(const dsc* from, dsc* to, Callbacks* cb)
**************************************
*
* Functional description
* Convert your basic binary number to
* Convert your basic binary number to
* nice, formatted text.
*
**************************************/
@ -455,9 +455,9 @@ static void string_to_datetime(const dsc* desc,
* "today" Today's date 0:0:0.0 time
* "tomorrow" Tomorrow's date 0:0:0.0 time
* "yesterday" Yesterday's date 0:0:0.0 time
* YYYY-MM-DD [HH:[Min:[SS.[Thou]]]]]
* MM:DD[:YY [HH:[Min:[SS.[Thou]]]]]
* DD.MM[:YY [HH:[Min:[SS.[Thou]]]]]
* YYYY-MM-DD [HH:[Min:[SS.[Thou]]]]]
* MM:DD[:YY [HH:[Min:[SS.[Thou]]]]]
* DD.MM[:YY [HH:[Min:[SS.[Thou]]]]]
* Where:
* DD = 1 .. 31 (Day of month)
* YY = 00 .. 99 2-digit years are converted to the nearest year
@ -476,7 +476,7 @@ static void string_to_datetime(const dsc* desc,
* 95 ==> 1995
* If the current year is 1997, then 46 is converted
* to 2046 (etc).
* = 100.. 5200 (Year)
* = 100.. 5200 (Year)
* MM = 1 .. 12 (Month of year)
* = "JANUARY"... (etc)
* HH = 0 .. 23 (Hour of day)
@ -512,7 +512,7 @@ static void string_to_datetime(const dsc* desc,
const char* p = NULL;
const USHORT length =
CVT_make_string(desc, ttype_ascii, &p, (vary*) buffer, sizeof(buffer), err);
const char* const end = p + length;
USHORT n, components[7];
@ -526,7 +526,7 @@ static void string_to_datetime(const dsc* desc,
const int start_component = (expect_type == expect_sql_time) ? 3 : 0;
int i;
for (i = start_component; i < 7; i++)
for (i = start_component; i < 7; i++)
{
// Skip leading blanks. If we run out of characters, we're done
@ -927,7 +927,7 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, ErrorFunction err)
else
d -= 0.5 + eps;
/* make sure the cast will succeed - different machines
/* make sure the cast will succeed - different machines
do different things if the value is larger than a long
can hold */
/* If rounding would yield a legitimate value, permit it */
@ -1129,7 +1129,7 @@ double CVT_get_double(const dsc* desc, ErrorFunction err)
exp = exp * 10 + *p - '0';
/* The following is a 'safe' test to prevent overflow of
exp here and of scale below. A more precise test occurs
exp here and of scale below. A more precise test occurs
later in this routine. */
if (exp >= SHORT_LIMIT)
@ -1237,7 +1237,7 @@ void CVT_move_common(const dsc* from, dsc* to, Callbacks* cb)
const UCHAR* q = from->dsc_address;
/* If the datatypes and lengths are identical, just move the
stuff byte by byte. Although this may seem slower than
stuff byte by byte. Although this may seem slower than
optimal, it would cost more to find the fast move than the
fast move would gain. */
@ -1358,7 +1358,7 @@ void CVT_move_common(const dsc* from, dsc* to, Callbacks* cb)
case dtype_cstring:
case dtype_text:
{
/* If we are within the engine, INTL_convert_string
/* If we are within the engine, INTL_convert_string
* will convert the string between character sets
* (or die trying).
* This module, however, can be called from outside
@ -1371,7 +1371,7 @@ void CVT_move_common(const dsc* from, dsc* to, Callbacks* cb)
*
* a charset type binary is compatible with all other types.
* if a charset involved is ttype_dynamic, we must look up
* the charset of the attachment (only if we are in the
* the charset of the attachment (only if we are in the
* engine). If we are outside the engine, the
* assume that the engine has converted the values
* previously in the request.
@ -1383,7 +1383,7 @@ void CVT_move_common(const dsc* from, dsc* to, Callbacks* cb)
CHARSET_ID charset2;
if (cb->transliterate(from, to, charset2, cb->err))
return;
{ // scope
USHORT strtype_unused;
UCHAR *ptr;
@ -1756,7 +1756,7 @@ USHORT CVT_make_string(const dsc* desc,
{
/**************************************
*
* C V T _ m a k e _ s t r i n g
* C V T _ m a k e _ s t r i n g
*
**************************************
*
@ -2198,7 +2198,7 @@ SQUAD CVT_get_quad(const dsc* desc, SSHORT scale, ErrorFunction err)
else
d -= 0.5;
/* make sure the cast will succeed - different machines
/* make sure the cast will succeed - different machines
do different things if the value is larger than a quad
can hold */
@ -2343,7 +2343,7 @@ SINT64 CVT_get_int64(const dsc* desc, SSHORT scale, ErrorFunction err)
else
d -= 0.5 + eps;
/* make sure the cast will succeed - different machines
/* make sure the cast will succeed - different machines
do different things if the value is larger than a quad
can hold.
@ -2524,7 +2524,7 @@ void CVT_move(const dsc* from, dsc* to, ErrorFunction err)
* Move (and possible convert) something to something else.
*
**************************************/
Callbacks toCommon = {transliterate, getChid, err, getToCharset,
Callbacks toCommon = {transliterate, getChid, err, getToCharset,
validateData, validateLength, getCurDate, isVersion4};
CVT_move_common(from, to, &toCommon);

View File

@ -22,7 +22,7 @@ class InterlockedStringsBuffer : public CircularBuffer
public:
explicit InterlockedStringsBuffer(Firebird::MemoryPool&)
: CircularBuffer() { }
virtual const char* alloc(const char* string, size_t& length)
virtual const char* alloc(const char* string, size_t& length)
{
Firebird::MutexLockGuard guard(buffer_lock);
return CircularBuffer::alloc(string, length);
@ -47,15 +47,15 @@ ISC_STATUS dupStringTemp(const char* s)
void fill_status(ISC_STATUS* ptr, const ISC_STATUS* orig_status)
{
// Move in status and clone transient strings
while (true)
while (true)
{
const ISC_STATUS type = *ptr++ = *orig_status++;
if (type == isc_arg_end)
if (type == isc_arg_end)
break;
switch (type) {
case isc_arg_cstring:
{
case isc_arg_cstring:
{
const size_t len = *ptr++ = *orig_status++;
char *string = FB_NEW(*getDefaultMemoryPool()) char[len];
const char *temp = reinterpret_cast<char*>(*orig_status++);
@ -74,7 +74,7 @@ void fill_status(ISC_STATUS* ptr, const ISC_STATUS* orig_status)
*ptr++ = *orig_status++;
break;
}
}
}
}
Firebird::GlobalPtr<InterlockedStringsBuffer> engine_failures;
@ -87,15 +87,15 @@ namespace Firebird {
void StringsBuffer::makePermanentVector(ISC_STATUS* perm, const ISC_STATUS* trans)
{
while (true)
while (true)
{
const ISC_STATUS type = *perm++ = *trans++;
switch (type) {
case isc_arg_end:
return;
case isc_arg_cstring:
{
case isc_arg_cstring:
{
size_t len = *perm++ = *trans++;
const char* temp = reinterpret_cast<char*>(*trans++);
*perm++ = (ISC_STATUS)(IPTR) (alloc(temp, len));
@ -125,7 +125,7 @@ void StringsBuffer::makeEnginePermanentVector(ISC_STATUS* v)
/********************************* status_exception *******************************/
status_exception::status_exception() throw() :
status_exception::status_exception() throw() :
m_strings_permanent(true)
{
memset(m_status_vector, 0, sizeof(m_status_vector));
@ -138,10 +138,10 @@ status_exception::status_exception(const ISC_STATUS *status_vector, bool permane
if (status_vector)
{
set_status(status_vector, permanent);
set_status(status_vector, permanent);
}
}
void status_exception::set_status(const ISC_STATUS *new_vector, bool permanent) throw()
{
fb_assert(new_vector != 0);
@ -151,7 +151,7 @@ void status_exception::set_status(const ISC_STATUS *new_vector, bool permanent)
m_strings_permanent = permanent;
ISC_STATUS *ptr = m_status_vector;
while (true)
while (true)
{
const ISC_STATUS type = *ptr++ = *new_vector++;
if (type == isc_arg_end)
@ -166,10 +166,10 @@ void status_exception::release_vector() throw()
{
if (m_strings_permanent)
return;
// Free owned strings
ISC_STATUS *ptr = m_status_vector;
while (true)
while (true)
{
const ISC_STATUS type = *ptr++;
if (type == isc_arg_end)
@ -188,18 +188,18 @@ void status_exception::release_vector() throw()
default:
ptr++;
break;
}
}
}
}
status_exception::~status_exception() throw()
status_exception::~status_exception() throw()
{
release_vector();
}
/********************************* fatal_exception *******************************/
void fatal_exception::raiseFmt(const char* format, ...)
void fatal_exception::raiseFmt(const char* format, ...)
{
va_list args;
va_start(args, format);
@ -210,11 +210,11 @@ void fatal_exception::raiseFmt(const char* format, ...)
throw fatal_exception(buffer);
}
void status_exception::raise(const ISC_STATUS *status_vector)
void status_exception::raise(const ISC_STATUS *status_vector)
{
throw status_exception(status_vector, true);
}
void status_exception::raise(const Arg::StatusVector& statusVector)
{
ISC_STATUS_ARRAY temp;
@ -231,10 +231,10 @@ ISC_STATUS status_exception::stuff_exception(ISC_STATUS* const status_vector, St
sb = &engine_failures;
}
if (strings_permanent())
if (strings_permanent())
{
// Copy status vector
while (true)
while (true)
{
const ISC_STATUS type = *sv++ = *ptr++;
if (type == isc_arg_end)
@ -280,7 +280,7 @@ void LongJump::raise()
ISC_STATUS LongJump::stuff_exception(ISC_STATUS* const status_vector, StringsBuffer* sb) const throw()
{
/*
* Do nothing for a while - not all utilities are ready,
* Do nothing for a while - not all utilities are ready,
* status_vector is passed in them by other means.
* Ideally status_exception should be always used for it,
* and we should activate the following code:
@ -290,7 +290,7 @@ ISC_STATUS LongJump::stuff_exception(ISC_STATUS* const status_vector, StringsBuf
{
sb = &engine_failures;
}
const char *temp = "Unexpected Firebird::LongJump";
*sv++ = isc_arg_gds;
@ -299,14 +299,14 @@ ISC_STATUS LongJump::stuff_exception(ISC_STATUS* const status_vector, StringsBuf
*sv++ = (ISC_STATUS)(IPTR) (sb->alloc(temp, strlen(temp)));
*sv++ = isc_arg_end;
*/
return status_vector[1];
}
/********************************* system_error ****************************/
system_error::system_error(const char* syscall, int error_code) :
system_error::system_error(const char* syscall, int error_code) :
status_exception(0, false), errorCode(error_code)
{
Arg::Gds temp(isc_sys_request);
@ -336,11 +336,11 @@ int system_error::getSystemError()
/********************************* system_call_failed ****************************/
system_call_failed::system_call_failed(const char* syscall, int error_code) :
system_call_failed::system_call_failed(const char* syscall, int error_code) :
system_error(syscall, error_code)
{
#ifdef DEV_BUILD
// raised failed system call exception in DEV_BUILD in 99.99% means
// raised failed system call exception in DEV_BUILD in 99.99% means
// problems with the code - let's create memory dump now
abort();
#endif
@ -361,9 +361,9 @@ void system_call_failed::raise(const char* syscall)
fatal_exception::fatal_exception(const char* message) :
status_exception(0, false)
{
ISC_STATUS temp[] = {isc_arg_gds,
isc_random,
isc_arg_string, dupStringTemp(message),
ISC_STATUS temp[] = {isc_arg_gds,
isc_random,
isc_arg_string, dupStringTemp(message),
isc_arg_end};
set_status(temp, false);
}

View File

@ -123,12 +123,12 @@ void THD_yield(void)
*
**************************************/
#ifdef USE_POSIX_THREADS
/* use sched_yield() instead of pthread_yield(). Because pthread_yield()
is not part of the (final) POSIX 1003.1c standard. Several drafts of
the standard contained pthread_yield(), but then the POSIX guys
discovered it was redundant with sched_yield() and dropped it.
So, just use sched_yield() instead. POSIX systems on which
sched_yield() is available define _POSIX_PRIORITY_SCHEDULING
/* use sched_yield() instead of pthread_yield(). Because pthread_yield()
is not part of the (final) POSIX 1003.1c standard. Several drafts of
the standard contained pthread_yield(), but then the POSIX guys
discovered it was redundant with sched_yield() and dropped it.
So, just use sched_yield() instead. POSIX systems on which
sched_yield() is available define _POSIX_PRIORITY_SCHEDULING
in <unistd.h>. Darwin defined _POSIX_THREAD_PRIORITY_SCHEDULING
instead of _POSIX_PRIORITY_SCHEDULING.
*/

View File

@ -722,7 +722,7 @@ namespace {
flagEcho = GetConsoleMode(handle, &dwMode) && (dwMode & ENABLE_ECHO_INPUT);
if (flagEcho)
SetConsoleMode(handle, dwMode & ~ENABLE_ECHO_INPUT);
#endif
#endif
}
}
~InputFile()
@ -738,7 +738,7 @@ namespace {
DWORD dwMode;
if (GetConsoleMode(handle, &dwMode))
SetConsoleMode(handle, dwMode | ENABLE_ECHO_INPUT);
#endif
#endif
}
if (f && f != stdin) {
fclose(f);

View File

@ -1,19 +1,19 @@
/*
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/idpl.html.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/idpl.html.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The contents of this file or any work derived from this file
* may not be distributed under any other license whatsoever
* without the express prior written permission of the original
* may not be distributed under any other license whatsoever
* without the express prior written permission of the original
* author.
*
*

View File

@ -1,19 +1,19 @@
/*
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/idpl.html.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/idpl.html.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The contents of this file or any work derived from this file
* may not be distributed under any other license whatsoever
* without the express prior written permission of the original
* may not be distributed under any other license whatsoever
* without the express prior written permission of the original
* author.
*
*

View File

@ -1,19 +1,19 @@
/*
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/idpl.html.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/idpl.html.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The contents of this file or any work derived from this file
* may not be distributed under any other license whatsoever
* without the express prior written permission of the original
* may not be distributed under any other license whatsoever
* without the express prior written permission of the original
* author.
*
*
@ -53,7 +53,7 @@ ConfObject* Configuration::findObject(const char* objectType, const char* object
{
if (!configFile)
loadConfigFile();
return configFile->findObject (objectType, objectName);
}
@ -61,7 +61,7 @@ const char* Configuration::getRootDirectory()
{
if (!configFile)
loadConfigFile();
return configFile->getRootDirectory();
}
@ -81,16 +81,16 @@ ConfObject* Configuration::getObject(const char* objectType)
{
if (!configFile)
loadConfigFile();
return configFile->getObject (objectType);
}
ConfObject* Configuration::getObject(const char* objectType, const char* objectName)
{
ConfObject* object = findObject (objectType, objectName);
if (!object)
object = getObject (objectType);
return object;
}

View File

@ -24,20 +24,20 @@ FileName::FileName(const Firebird::PathName& name) :
else if (*p == '.')
dot = p;
}
if (slash)
{
directory.assign (start, (int) (slash - rootName));
rootName = slash + 1;
}
if (dot)
{
extension = dot + 1;
root.assign (rootName, (int) (dot - rootName));
}
else
root = rootName;
root = rootName;
}
FileName::~FileName()

View File

@ -1,19 +1,19 @@
/*
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/idpl.html.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/idpl.html.
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The contents of this file or any work derived from this file
* may not be distributed under any other license whatsoever
* without the express prior written permission of the original
* may not be distributed under any other license whatsoever
* without the express prior written permission of the original
* author.
*
*

View File

@ -181,7 +181,7 @@ void Stream::setMinSegment(int length)
Stream::Segment* Stream::allocSegment(int tail)
{
fb_assert(tail >= 0);
Segment *segment;
int length = tail;

View File

@ -97,7 +97,7 @@ void StreamSegment::advance(int size)
char* StreamSegment::copy(void *target, int length)
{
char* targ = static_cast<char*>(target);
for (int len = length; len;)
{
const int l = MIN (len, available);

View File

@ -161,7 +161,7 @@ jrd_nod* InAutonomousTransactionNode::execute(thread_db* tdbb, jrd_req* request)
EXE_execute_db_triggers(tdbb, request->req_transaction,
jrd_req::req_trigger_trans_commit);
}
{ // scope
Firebird::AutoSetRestore2<jrd_req*, thread_db> autoNullifyRequest(
tdbb, &thread_db::getRequest, &thread_db::setRequest, NULL);

View File

@ -142,11 +142,11 @@ dsql_dbb::~dsql_dbb()
/**
DSQL_allocate_statement
@brief Allocate a statement handle.
@param tdbb
@param attachment
@ -160,7 +160,7 @@ dsql_req* DSQL_allocate_statement(thread_db* tdbb,
dsql_dbb* const database = init(attachment);
Jrd::ContextPoolHolder context(tdbb, database->createPool());
// allocate the request block
// allocate the request block
MemoryPool& pool = *tdbb->getDefaultPool();
dsql_req* const request = FB_NEW(pool) dsql_req(pool);
@ -171,11 +171,11 @@ dsql_req* DSQL_allocate_statement(thread_db* tdbb,
/**
DSQL_execute
@brief Execute a non-SELECT dynamic SQL statement.
@param tdbb
@param tra_handle
@ -204,7 +204,7 @@ void DSQL_execute(thread_db* tdbb,
Jrd::ContextPoolHolder context(tdbb, &request->req_pool);
if (request->req_flags & REQ_orphan)
if (request->req_flags & REQ_orphan)
{
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-901) <<
Arg::Gds(isc_bad_req_handle));
@ -214,7 +214,7 @@ void DSQL_execute(thread_db* tdbb,
request->req_type = REQ_EMBED_SELECT;
}
// Only allow NULL trans_handle if we're starting a transaction
// Only allow NULL trans_handle if we're starting a transaction
if (!*tra_handle && request->req_type != REQ_START_TRANS)
{
@ -226,7 +226,7 @@ void DSQL_execute(thread_db* tdbb,
Make sure the cursor is not already open. */
if (request->req_type == REQ_SELECT ||
request->req_type == REQ_EXEC_BLOCK ||
request->req_type == REQ_EXEC_BLOCK ||
request->req_type == REQ_SELECT_BLOCK ||
request->req_type == REQ_SELECT_UPD ||
request->req_type == REQ_EMBED_SELECT ||
@ -240,7 +240,7 @@ void DSQL_execute(thread_db* tdbb,
}
}
// A select with a non zero output length is a singleton select
// A select with a non zero output length is a singleton select
bool singleton;
if (request->req_type == REQ_SELECT && out_msg_length != 0) {
singleton = true;
@ -270,7 +270,7 @@ void DSQL_execute(thread_db* tdbb,
* to the list of open cursors (it's not really open).
*/
if ((request->req_type == REQ_SELECT && out_msg_length == 0) ||
(request->req_type == REQ_SELECT_BLOCK) ||
(request->req_type == REQ_SELECT_BLOCK) ||
request->req_type == REQ_SELECT_UPD ||
request->req_type == REQ_EMBED_SELECT ||
request->req_type == REQ_GET_SEGMENT ||
@ -283,11 +283,11 @@ void DSQL_execute(thread_db* tdbb,
/**
DSQL_execute_immediate
@brief Execute a non-SELECT dynamic SQL statement.
@param tdbb
@param attachment
@ -317,23 +317,23 @@ void DSQL_execute_immediate(thread_db* tdbb,
USHORT out_msg_type, USHORT out_msg_length, UCHAR* out_msg)
{
execute_immediate(tdbb, attachment, tra_handle, length,
string, dialect, in_blr_length,
string, dialect, in_blr_length,
in_blr,
in_msg_type, in_msg_length,
in_msg,
out_blr_length,
out_blr,
out_msg_type, out_msg_length,
out_blr_length,
out_blr,
out_msg_type, out_msg_length,
out_msg);
}
/**
DSQL_fetch
@brief Fetch next record from a dynamic SQL cursor
@param user_status
@param req_handle
@ -359,7 +359,7 @@ ISC_STATUS DSQL_fetch(thread_db* tdbb,
Jrd::ContextPoolHolder context(tdbb, &request->req_pool);
// if the cursor isn't open, we've got a problem
// if the cursor isn't open, we've got a problem
if (!(request->req_flags & REQ_cursor_open))
{
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-504) <<
@ -518,11 +518,11 @@ ISC_STATUS DSQL_fetch(thread_db* tdbb,
/**
DSQL_free_statement
@brief Release request for a dsql statement
@param user_status
@param req_handle
@ -558,11 +558,11 @@ void DSQL_free_statement(thread_db* tdbb,
/**
DSQL_insert
@brief Insert next record into a dynamic SQL cursor
@param user_status
@param req_handle
@ -582,13 +582,13 @@ void DSQL_insert(thread_db* tdbb,
Jrd::ContextPoolHolder context(tdbb, &request->req_pool);
if (request->req_flags & REQ_orphan)
if (request->req_flags & REQ_orphan)
{
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-901) <<
Arg::Gds(isc_bad_req_handle));
}
// if the cursor isn't open, we've got a problem
// if the cursor isn't open, we've got a problem
if (request->req_type == REQ_PUT_SEGMENT)
{
@ -609,7 +609,7 @@ void DSQL_insert(thread_db* tdbb,
parse_blr(blr_length, blr, msg_length, message->msg_parameters);
if (request->req_type == REQ_PUT_SEGMENT) {
// For put segment, use the user buffer and indicator directly.
// For put segment, use the user buffer and indicator directly.
dsql_par* parameter = request->req_blob->blb_segment;
const UCHAR* buffer = dsql_msg_buf + (IPTR) parameter->par_user_desc.dsc_address;
@ -621,11 +621,11 @@ void DSQL_insert(thread_db* tdbb,
/**
DSQL_prepare
@brief Prepare a statement for execution.
@param user_status
@param trans_handle
@ -661,7 +661,7 @@ void DSQL_prepare(thread_db* tdbb,
Arg::Gds(isc_bad_req_handle));
}
// check to see if old request has an open cursor
// check to see if old request has an open cursor
if (old_request && (old_request->req_flags & REQ_cursor_open)) {
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-519) <<
@ -683,7 +683,7 @@ void DSQL_prepare(thread_db* tdbb,
try {
// Figure out which parser version to use
// Figure out which parser version to use
/* Since the API to dsql8_prepare is public and can not be changed, there needs to
* be a way to send the parser version to DSQL so that the parser can compare the keyword
* version to the parser version. To accomplish this, the parser version is combined with
@ -735,7 +735,7 @@ void DSQL_prepare(thread_db* tdbb,
request->req_flags |= REQ_prepared;
// Now that we know that the new request exists, zap the old one.
// Now that we know that the new request exists, zap the old one.
{
Jrd::ContextPoolHolder context(tdbb, &old_request->req_pool);
@ -760,11 +760,11 @@ void DSQL_prepare(thread_db* tdbb,
/**
DSQL_set_cursor_name
@brief Set a cursor name for a dynamic request
@param user_status
@param req_handle
@ -790,7 +790,7 @@ void DSQL_set_cursor(thread_db* tdbb,
// Note that "" will be replaced with ".
// The code is very strange, because it doesn't check for "" really
// and thus deletes one isolated " in the middle of the cursor.
for (Firebird::string::iterator i = cursor.begin();
for (Firebird::string::iterator i = cursor.begin();
i < cursor.end(); ++i)
{
if (*i == '\"') {
@ -819,9 +819,9 @@ void DSQL_set_cursor(thread_db* tdbb,
}
cursor.resize(length);
// If there already is a different cursor by the same name, bitch
// If there already is a different cursor by the same name, bitch
const dsql_sym* symbol =
const dsql_sym* symbol =
HSHD_lookup(request->req_dbb, cursor.c_str(), length, SYM_cursor, 0);
if (symbol)
{
@ -850,11 +850,11 @@ void DSQL_set_cursor(thread_db* tdbb,
/**
DSQL_sql_info
@brief Provide information on dsql statement
@param user_status
@param req_handle
@ -878,11 +878,11 @@ void DSQL_sql_info(thread_db* tdbb,
/**
close_cursor
@brief Close an open cursor.
@param request
@param tdbb
@ -917,12 +917,12 @@ static void close_cursor(thread_db* tdbb, dsql_req* request)
/**
convert
@brief Convert a number to VAX form -- least significant bytes first.
Return the length.
@param number
@param buffer
@ -956,11 +956,11 @@ static USHORT convert( SLONG number, UCHAR* buffer)
/**
execute_blob
@brief Open or create a blob.
@param tdbb
@param request
@ -1043,11 +1043,11 @@ static void execute_blob(thread_db* tdbb,
/**
execute_immediate
@brief Common part of prepare and execute a statement.
@param tdbb
@param attachment
@ -1095,7 +1095,7 @@ static void execute_immediate(thread_db* tdbb,
try {
// Figure out which parser version to use
// Figure out which parser version to use
/* Since the API to dsql8_execute_immediate is public and can not be changed, there needs to
* be a way to send the parser version to DSQL so that the parser can compare the keyword
* version to the parser version. To accomplish this, the parser version is combined with
@ -1150,11 +1150,11 @@ static void execute_immediate(thread_db* tdbb,
/**
execute_request
@brief Execute a dynamic SQL statement.
@param tdbb
@param request
@ -1245,11 +1245,11 @@ static void execute_request(thread_db* tdbb,
break;
default:
// Catch invalid request types
// Catch invalid request types
fb_assert(false);
}
// If there is no data required, just start the request
// If there is no data required, just start the request
dsql_msg* message = request->req_send;
if (!message)
@ -1286,7 +1286,7 @@ static void execute_request(thread_db* tdbb,
if (out_msg_length && out_blr_length) {
parse_blr(out_blr_length, out_blr, out_msg_length,
message->msg_parameters);
}
}
else if (!out_msg_length && isBlock) {
message = &temp_msg;
message->msg_number = 1;
@ -1300,7 +1300,7 @@ static void execute_request(thread_db* tdbb,
if (out_msg_length)
map_in_out(NULL, message, 0, out_blr, out_msg_length, out_msg);
// if this is a singleton select, make sure there's in fact one record
// if this is a singleton select, make sure there's in fact one record
if (singleton)
{
@ -1393,12 +1393,12 @@ static void execute_request(thread_db* tdbb,
}
/**
filter_sub_type
@brief Determine the sub_type to use in filtering
a blob.
@param request
@param node
@ -1422,13 +1422,13 @@ static SSHORT filter_sub_type( dsql_req* request, const dsql_nod* node)
/**
get_indices
@brief Retrieve the indices from the index tree in
the request info buffer (explain_ptr), and print them out
in the plan buffer. Return true on success and false on failure.
@param explain_length_ptr
@param explain_ptr
@ -1468,7 +1468,7 @@ static bool get_indices(
explain_length--;
length = *explain++;
// if this isn't the first index, put out a comma
// if this isn't the first index, put out a comma
if (plan[-1] != '(' && plan[-1] != ' ') {
plan_length -= 2;
@ -1478,7 +1478,7 @@ static bool get_indices(
*plan++ = ' ';
}
// now put out the index name
// now put out the index name
if ((plan_length -= length) < 0)
return false;
@ -1501,13 +1501,13 @@ static bool get_indices(
/**
get_plan_info
@brief Get the access plan for the request and turn
it into a textual representation suitable for
human reading.
@param request
@param buffer_length
@ -1527,7 +1527,7 @@ static USHORT get_plan_info(thread_db* tdbb,
SCHAR* buffer_ptr = *out_buffer;
// get the access path info for the underlying request from the engine
// get the access path info for the underlying request from the engine
try
{
@ -1573,12 +1573,12 @@ static USHORT get_plan_info(thread_db* tdbb,
at the begining of the function hence they had trash the second time. */
USHORT join_count = 0, level = 0;
// keep going until we reach the end of the explain info
// keep going until we reach the end of the explain info
while (explain_length > 0 && buffer_length > 0)
{
if (!get_rsb_item(&explain_length, &explain, &buffer_length, &plan,
&join_count, &level))
&join_count, &level))
{
// don't allocate buffer of the same length second time
// and let user know plan is incomplete
@ -1592,7 +1592,7 @@ static USHORT get_plan_info(thread_db* tdbb,
break;
}
// assume we have run out of room in the buffer, try again with a larger one
// assume we have run out of room in the buffer, try again with a larger one
const size_t new_length = MAX_SSHORT;
char* const temp = static_cast<char*>(gds__alloc(new_length));
if (!temp) {
@ -1618,11 +1618,11 @@ static USHORT get_plan_info(thread_db* tdbb,
/**
get_request_info
@brief Get the records updated/deleted for record
@param request
@param buffer_length
@ -1637,7 +1637,7 @@ static USHORT get_request_info(thread_db* tdbb,
if (!request->req_request) // DDL
return 0;
// get the info for the request from the engine
// get the info for the request from the engine
try
{
@ -1691,13 +1691,13 @@ static USHORT get_request_info(thread_db* tdbb,
/**
get_rsb_item
@brief Use recursion to print out a reverse-polish
access plan of joins and join types. Return true on success
and false on failure
@param explain_length_ptr
@param explain_ptr
@ -1727,7 +1727,7 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
{
case isc_info_rsb_begin:
if (!*level_ptr) {
// put out the PLAN prefix
// put out the PLAN prefix
p = "\nPLAN ";
if ((plan_length -= strlen(p)) < 0)
@ -1757,7 +1757,7 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
*plan++ = '(';
}
// if this isn't the first relation, put out a comma
// if this isn't the first relation, put out a comma
if (plan[-1] != '(') {
plan_length -= 2;
@ -1767,7 +1767,7 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
*plan++ = ' ';
}
// put out the relation name
// put out the relation name
{ // scope to keep length local.
explain_length--;
SSHORT length = (UCHAR) * explain++;
@ -1790,7 +1790,7 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
case isc_info_rsb_union:
case isc_info_rsb_recursive:
// put out all the substreams of the join
// put out all the substreams of the join
{ // scope to have union_count, union_level and union_join_count local.
explain_length--;
USHORT union_count = (USHORT) * explain++ - 1;
@ -1844,7 +1844,7 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
*plan++ = ' ';
}
// put out the join type
// put out the join type
if (rsb_type == isc_info_rsb_cross ||
rsb_type == isc_info_rsb_left_cross)
@ -1860,7 +1860,7 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
while (*p)
*plan++ = *p++;
// put out all the substreams of the join
// put out all the substreams of the join
explain_length--;
{ // scope to have join_count local.
@ -1878,14 +1878,14 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
}
} // scope
// put out the final parenthesis for the join
// put out the final parenthesis for the join
if (--plan_length < 0)
return false;
else
*plan++ = ')';
// this qualifies as a stream, so decrement the join count
// this qualifies as a stream, so decrement the join count
if (*parent_join_count)
-- * parent_join_count;
@ -1915,7 +1915,7 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
while (*p)
*plan++ = *p++;
// print out additional index information
// print out additional index information
if (rsb_type == isc_info_rsb_indexed ||
rsb_type == isc_info_rsb_navigate ||
@ -1944,7 +1944,7 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
*plan++ = ')';
}
// detect the end of a single relation and put out a final parenthesis
// detect the end of a single relation and put out a final parenthesis
if (!*parent_join_count)
if (--plan_length < 0)
@ -1952,7 +1952,7 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
else
*plan++ = ')';
// this also qualifies as a stream, so decrement the join count
// this also qualifies as a stream, so decrement the join count
if (*parent_join_count)
-- * parent_join_count;
@ -1973,7 +1973,7 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
break;
}
// if this isn't the first item in the list, put out a comma
// if this isn't the first item in the list, put out a comma
if (*parent_join_count && plan[-1] != '(') {
plan_length -= 2;
@ -2030,11 +2030,11 @@ static bool get_rsb_item(SSHORT* explain_length_ptr,
/**
init
@brief Initialize dynamic SQL. This is called only once.
@param db_handle
@ -2126,12 +2126,12 @@ static dsql_dbb* init(Attachment* attachment)
/**
map_in_out
@brief Map data from external world into message or
from message to external world.
@param request
@param message
@ -2162,7 +2162,7 @@ static void map_in_out( dsql_req* request,
{
if (parameter->par_index)
{
// Make sure the message given to us is long enough
// Make sure the message given to us is long enough
DSC desc = parameter->par_user_desc;
USHORT length = (IPTR) desc.dsc_address + desc.dsc_length;
@ -2252,11 +2252,11 @@ static void map_in_out( dsql_req* request,
/**
parse_blr
@brief Parse the message of a blr request.
@param blr_length
@param blr
@ -2289,14 +2289,14 @@ static USHORT parse_blr(
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-804) <<
Arg::Gds(isc_dsql_sqlda_err));
}
blr++; // skip the blr_version
blr++; // skip the blr_version
if (*blr++ != blr_begin || *blr++ != blr_message)
{
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-804) <<
Arg::Gds(isc_dsql_sqlda_err));
}
++blr; // skip the message number
++blr; // skip the message number
USHORT count = *blr++;
count += (*blr++) << 8;
count /= 2;
@ -2308,7 +2308,7 @@ static USHORT parse_blr(
desc.dsc_scale = 0;
desc.dsc_sub_type = 0;
desc.dsc_flags = 0;
switch (*blr++)
{
case blr_text:
@ -2453,12 +2453,12 @@ static USHORT parse_blr(
/**
prepare
@brief Prepare a statement for execution. Return SQL status
code. Note: caller is responsible for pool handling.
@param request
@param string_length
@ -2503,7 +2503,7 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
}
}
// allocate the statement block, then prepare the statement
// allocate the statement block, then prepare the statement
Jrd::ContextPoolHolder context(tdbb, database->createPool());
@ -2515,7 +2515,7 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
try {
// Parse the SQL statement. If it croaks, return
// Parse the SQL statement. If it croaks, return
Parser parser(*tdbb->getDefaultPool(), client_dialect, statement->req_dbb->dbb_db_SQL_dialect,
parser_version, string, string_length, tdbb->getAttachment()->att_charset);
@ -2532,7 +2532,7 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
Arg::Gds(isc_command_end_err));
}
// allocate the send and receive messages
// allocate the send and receive messages
statement->req_send = FB_NEW(pool) dsql_msg;
dsql_msg* message = FB_NEW(pool) dsql_msg;
@ -2563,7 +2563,7 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
if (!node)
return statement;
// stop here for statements not requiring code generation
// stop here for statements not requiring code generation
if (statement->req_type == REQ_DDL && parser.isStmtAmbiguous() &&
statement->req_dbb->dbb_db_SQL_dialect != client_dialect)
@ -2580,7 +2580,7 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
return statement;
}
// Work on blob segment statements
// Work on blob segment statements
if (statement->req_type == REQ_GET_SEGMENT ||
statement->req_type == REQ_PUT_SEGMENT)
@ -2591,7 +2591,7 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
return statement;
}
// Generate BLR, DDL or TPB for statement
// Generate BLR, DDL or TPB for statement
// Start transactions takes parameters via a parameter block.
// The statement blr string is used for that
@ -2608,8 +2608,8 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
GEN_request(statement, node);
const USHORT length = statement->req_blr_data.getCount();
// stop here for ddl statements
// stop here for ddl statements
if (statement->req_type == REQ_CREATE_DB ||
statement->req_type == REQ_DDL)
@ -2617,7 +2617,7 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
return statement;
}
// have the access method compile the statement
// have the access method compile the statement
#ifdef DSQL_DEBUG
if (DSQL_debug & 64) {
@ -2630,9 +2630,9 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
}
#endif
// check for warnings
// check for warnings
if (tdbb->tdbb_status_vector[2] == isc_arg_warning) {
// save a status vector
// save a status vector
memcpy(local_status, tdbb->tdbb_status_vector, sizeof(ISC_STATUS_ARRAY));
}
@ -2655,17 +2655,17 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
status = tdbb->tdbb_status_vector[1];
}
// restore warnings (if there are any)
// restore warnings (if there are any)
if (local_status[2] == isc_arg_warning)
{
int indx, len, warning;
// find end of a status vector
// find end of a status vector
PARSE_STATUS(tdbb->tdbb_status_vector, indx, warning);
if (indx)
--indx;
// calculate length of saved warnings
// calculate length of saved warnings
PARSE_STATUS(local_status, len, warning);
len -= 2;
@ -2691,13 +2691,13 @@ static dsql_req* prepare(thread_db* tdbb, dsql_dbb* database, jrd_tra* transacti
/**
put_item
@brief Put information item in output buffer if there is room, and
return an updated pointer. If there isn't room for the item,
indicate truncation and return NULL.
@param item
@param length
@ -2734,11 +2734,11 @@ static UCHAR* put_item( UCHAR item,
/**
release_request
@brief Release a dynamic request.
@param request
@param top_level
@ -2747,7 +2747,7 @@ static UCHAR* put_item( UCHAR item,
static void release_request(thread_db* tdbb, dsql_req* request, bool drop)
{
SET_TDBB(tdbb);
// If request is parent, orphan the children and
// release a portion of their requests
@ -2848,7 +2848,7 @@ static void sql_info(thread_db* tdbb,
memset(buffer, 0, sizeof(buffer));
// Pre-initialize buffer. This is necessary because we don't want to transfer rubbish over the wire
memset(info, 0, info_length);
memset(info, 0, info_length);
const UCHAR* const end_items = items + item_length;
const UCHAR* const end_info = info + info_length;
@ -2931,10 +2931,10 @@ static void sql_info(thread_db* tdbb,
case REQ_SAVEPOINT:
number = isc_info_sql_stmt_savepoint;
break;
case REQ_EXEC_BLOCK:
case REQ_EXEC_BLOCK:
number = isc_info_sql_stmt_exec_procedure;
break;
case REQ_SELECT_BLOCK:
case REQ_SELECT_BLOCK:
number = isc_info_sql_stmt_select;
break;
default:
@ -2965,7 +2965,7 @@ static void sql_info(thread_db* tdbb,
}
else if (item == isc_info_sql_records) {
length = get_request_info(tdbb, request, (SSHORT) sizeof(buffer), buffer);
if (length && !(info = put_item(item, length, buffer, info, end_info)))
if (length && !(info = put_item(item, length, buffer, info, end_info)))
{
return;
}
@ -3015,7 +3015,7 @@ static void sql_info(thread_db* tdbb,
const UCHAR* end_describe = items;
while (end_describe < end_items &&
*end_describe != isc_info_end &&
*end_describe != isc_info_sql_describe_end)
*end_describe != isc_info_sql_describe_end)
{
end_describe++;
}
@ -3050,11 +3050,11 @@ static void sql_info(thread_db* tdbb,
/**
var_info
@brief Provide information on an internal message.
@param message
@param items
@ -3068,8 +3068,8 @@ static UCHAR* var_info(
dsql_msg* message,
const UCHAR* items,
const UCHAR* const end_describe,
UCHAR* info,
const UCHAR* const end,
UCHAR* info,
const UCHAR* const end,
USHORT first_index)
{
if (!message || !message->msg_index)
@ -3102,7 +3102,7 @@ static UCHAR* var_info(
SLONG sql_sub_type = 0;
SLONG sql_scale = 0;
SLONG sql_type = 0;
switch (param->par_desc.dsc_dtype)
{
case dtype_real:

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
*
* 27 Nov 2001 Ann W. Harrison - preserve string arguments in
* ERRD_post_warning
*
@ -42,7 +42,7 @@
#include "../dsql/utld_proto.h"
// This is the only one place in dsql code, where we need both
// dsql.h and err_proto.h.
// dsql.h and err_proto.h.
// To avoid warnings, undefine some macro's here
//#undef BUGCHECK
//#undef IBERROR
@ -65,11 +65,11 @@ static void internal_post(const ISC_STATUS* status_vector);
#ifdef DEV_BUILD
/**
ERRD_assert_msg
@brief Generate an assertion failure with a message
@param msg
@param file
@ -86,15 +86,15 @@ void ERRD_assert_msg(const char* msg, const char* file, ULONG lineno)
(msg ? msg : ""), (file ? file : ""), lineno);
ERRD_bugcheck(buffer);
}
#endif // DEV_BUILD
#endif // DEV_BUILD
/**
ERRD_bugcheck
@brief Somebody has screwed up. Bugcheck.
@param text
@ -108,16 +108,16 @@ void ERRD_bugcheck(const char* text)
/**
ERRD_error
@brief This routine should only be used by fatal
error messages, those that cannot use the
normal error routines because something
is very badly wrong. ERRD_post() should
be used by most error messages, especially
so that strings will be handled.
@param code
@param text
@ -134,14 +134,14 @@ void ERRD_error(const char* text)
/**
ERRD_post_warning
@brief Post a warning to the current status vector.
@param status
@param
@param
**/
bool ERRD_post_warning(const Firebird::Arg::StatusVector& v)
@ -155,7 +155,7 @@ bool ERRD_post_warning(const Firebird::Arg::StatusVector& v)
(status_vector[0] == isc_arg_gds && status_vector[1] == 0 &&
status_vector[2] != isc_arg_warning))
{
// this is a blank status vector
// this is a blank status vector
status_vector[0] = isc_arg_gds;
status_vector[1] = 0;
status_vector[2] = isc_arg_end;
@ -163,7 +163,7 @@ bool ERRD_post_warning(const Firebird::Arg::StatusVector& v)
}
else
{
// find end of a status vector
// find end of a status vector
int warning_indx = 0;
PARSE_STATUS(status_vector, indx, warning_indx);
if (indx) {
@ -178,21 +178,21 @@ bool ERRD_post_warning(const Firebird::Arg::StatusVector& v)
return true;
}
// not enough free space
// not enough free space
return false;
}
/**
ERRD_post
@brief Post an error, copying any potentially
transient data before we punt.
@param statusVector
@param
@param
**/
void ERRD_post(const Firebird::Arg::StatusVector& v)
@ -204,22 +204,22 @@ void ERRD_post(const Firebird::Arg::StatusVector& v)
/**
internal_post
@brief Post an error, copying any potentially
transient data before we punt.
@param tmp_status
@param
@param
**/
static void internal_post(const ISC_STATUS* tmp_status)
{
ISC_STATUS* status_vector = JRD_get_thread_data()->tdbb_status_vector;
// calculate length of the status
// calculate length of the status
int tmp_status_len = 0, warning_indx = 0;
PARSE_STATUS(tmp_status, tmp_status_len, warning_indx);
fb_assert(warning_indx == 0);
@ -228,7 +228,7 @@ static void internal_post(const ISC_STATUS* tmp_status)
(status_vector[0] == isc_arg_gds && status_vector[1] == 0 &&
status_vector[2] != isc_arg_warning))
{
// this is a blank status vector
// this is a blank status vector
status_vector[0] = isc_arg_gds;
status_vector[1] = isc_dsql_error;
status_vector[2] = isc_arg_end;
@ -244,11 +244,11 @@ static void internal_post(const ISC_STATUS* tmp_status)
for (i = 0; i < ISC_STATUS_LENGTH; i++)
{
if (status_vector[i] == isc_arg_end && i == status_len) {
break; // end of argument list
break; // end of argument list
}
if (i && i == warning_indx) {
break; // vector has no more errors
break; // vector has no more errors
}
if (status_vector[i] == tmp_status[1] && i &&
@ -257,7 +257,7 @@ static void internal_post(const ISC_STATUS* tmp_status)
(memcmp(&status_vector[i], &tmp_status[1],
sizeof(ISC_STATUS) * (tmp_status_len - 2)) == 0))
{
// duplicate found
// duplicate found
ERRD_punt();
}
}
@ -272,7 +272,7 @@ static void internal_post(const ISC_STATUS* tmp_status)
ISC_STATUS_ARRAY warning_status;
if (warning_indx) {
// copy current warning(s) to a temp buffer
// copy current warning(s) to a temp buffer
MOVE_CLEAR(warning_status, sizeof(warning_status));
memcpy(warning_status, &status_vector[warning_indx],
sizeof(ISC_STATUS) * (ISC_STATUS_LENGTH - warning_indx));
@ -287,7 +287,7 @@ static void internal_post(const ISC_STATUS* tmp_status)
{
memcpy(&status_vector[err_status_len], tmp_status, sizeof(ISC_STATUS) * tmp_status_len);
ERR_make_permanent(&status_vector[err_status_len]);
// copy current warning(s) to the status_vector
// copy current warning(s) to the status_vector
if (warning_count && i + warning_count - 1 < ISC_STATUS_LENGTH)
{
memcpy(&status_vector[i - 1], warning_status,
@ -299,12 +299,12 @@ static void internal_post(const ISC_STATUS* tmp_status)
/**
ERRD_punt
@brief Error stuff has been copied to
status vector. Now punt.
**/
@ -317,11 +317,11 @@ void ERRD_punt(const ISC_STATUS* local)
UTLD_copy_status(local, tdbb->tdbb_status_vector);
}
// Save any strings in a permanent location
// Save any strings in a permanent location
UTLD_save_status_strings(tdbb->tdbb_status_vector);
// Give up whatever we were doing and return to the user.
// Give up whatever we were doing and return to the user.
status_exception::raise(tdbb->tdbb_status_vector);
}

View File

@ -66,11 +66,11 @@ namespace
#include <stdio.h>
/**
HSHD_debug
@brief Print out the hash table for debugging.
**/
@ -78,13 +78,13 @@ void HSHD_debug()
{
Firebird::ReadLockGuard guard(hash_sync);
// dump each hash table entry
// dump each hash table entry
for (SSHORT h = 0; h < HASH_SIZE; h++)
{
for (DSQL_SYM collision = hash_table()[h]; collision;
collision = collision->sym_collision)
{
// check any homonyms first
// check any homonyms first
fprintf(stderr, "Symbol type %d: %s %p\n",
collision->sym_type, collision->sym_string,
collision->sym_dbb);
@ -102,13 +102,13 @@ void HSHD_debug()
/**
HSHD_finish
@brief Remove symbols used by a particular database.
Don't bother to release them since their pools
will be released.
@param database
@ -117,12 +117,12 @@ void HSHD_finish(const void* database)
{
Firebird::WriteLockGuard guard(hash_sync);
// check each hash table entry
// check each hash table entry
for (SSHORT h = 0; h < HASH_SIZE; h++)
{
for (DSQL_SYM* collision = &hash_table()[h]; *collision;)
{
// check any homonyms first
// check any homonyms first
DSQL_SYM chain = *collision;
for (DSQL_SYM* homptr = &chain->sym_homonym; *homptr;)
{
@ -138,7 +138,7 @@ void HSHD_finish(const void* database)
}
}
// now, see if the root entry has to go
// now, see if the root entry has to go
if (chain->sym_dbb == database)
{
if (chain->sym_homonym)
@ -162,11 +162,11 @@ void HSHD_finish(const void* database)
/**
HSHD_insert
@brief Insert a symbol into the hash table.
@param symbol
@ -184,7 +184,7 @@ void HSHD_insert(DSQL_SYM symbol)
{
if ((!database || (database == old->sym_dbb)) &&
scompare(symbol->sym_string, symbol->sym_length, old->sym_string,
old->sym_length))
old->sym_length))
{
symbol->sym_homonym = old->sym_homonym;
old->sym_homonym = symbol;
@ -198,12 +198,12 @@ void HSHD_insert(DSQL_SYM symbol)
/**
HSHD_lookup
@brief Perform a string lookup against hash table.
Make sure to only return a symbol of the desired type.
@param database
@param string
@ -229,7 +229,7 @@ DSQL_SYM HSHD_lookup(const void* database,
if ((database == symbol->sym_dbb) &&
scompare(string, length, symbol->sym_string, symbol->sym_length))
{
// Search for a symbol of the proper type
// Search for a symbol of the proper type
while (symbol && symbol->sym_type != type)
{
symbol = symbol->sym_homonym;
@ -254,11 +254,11 @@ DSQL_SYM HSHD_lookup(const void* database,
/**
HSHD_remove
@brief Remove a symbol from the hash table.
@param symbol
@ -283,9 +283,9 @@ void HSHD_remove(DSQL_SYM symbol)
/**
HSHD_set_flag
@brief Set a flag in all similar objects in a chain. This
is used primarily to mark relations, procedures and functions
as deleted. The object must have the same name and
@ -297,7 +297,7 @@ void HSHD_remove(DSQL_SYM symbol)
This is because there's no way at present for DSQL to tell
if two databases as represented in DSQL are attachments to
the same physical database.
@param database
@param string
@ -337,14 +337,14 @@ void HSHD_set_flag(const void* database,
if (symbol->sym_dbb && (database != symbol->sym_dbb) &&
scompare(string, length, symbol->sym_string, symbol->sym_length))
{
// the symbol name matches and it's from a different database
// the symbol name matches and it's from a different database
for (DSQL_SYM homonym = symbol; homonym;
homonym = homonym->sym_homonym)
{
if (homonym->sym_type == type)
{
// the homonym is of the correct type
// the homonym is of the correct type
/* the next check is for the same relation or procedure ID,
which indicates that it MAY be the same relation or
@ -381,14 +381,14 @@ void HSHD_set_flag(const void* database,
/**
hash
@brief Returns the hash function of a string.
@param
@param
hash
@brief Returns the hash function of a string.
@param
@param
**/
static USHORT hash(const SCHAR* string, USHORT length)
@ -406,13 +406,13 @@ static USHORT hash(const SCHAR* string, USHORT length)
/**
remove_symbol
@brief Given the address of a collision,
remove a symbol from the collision
remove a symbol from the collision
and homonym linked lists.
@param collision
@param symbol
@ -450,15 +450,15 @@ static bool remove_symbol(DSQL_SYM* collision, DSQL_SYM symbol)
/**
scompare
@brief Compare two symbolic strings
The character set for these strings is either ASCII or
Unicode in UTF format.
Symbols are case-significant - so no uppercase operation
is performed.
@param string1
@param length1

View File

@ -138,7 +138,7 @@ static const TOK tokens[] =
{CURRENT_USER, "CURRENT_USER", 2, false},
{CURSOR, "CURSOR", 1, false},
{DATABASE, "DATABASE", 1, false},
{DATA, "DATA", 2, true},
{DATA, "DATA", 2, true},
{DATE, "DATE", 1, false},
{DATEADD, "DATEADD", 2, false},
{DATEDIFF, "DATEDIFF", 2, false},

View File

@ -40,11 +40,11 @@ static void post_error(const Arg::StatusVector&);
/**
MOVD_move
@brief Move (and possible convert) something to something else.
@param from
@param to
@ -58,14 +58,14 @@ void MOVD_move(const dsc* from, dsc* to)
/**
post_error
@brief A conversion error occurred. Complain.
@param status
@param
@param
**/
static void post_error(const Arg::StatusVector& v)

View File

@ -370,7 +370,7 @@ dsql_ctx* PASS1_make_context(CompiledStatement* statement, const dsql_nod* relat
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-204) <<
Arg::Gds(isc_dsql_procedure_err) <<
Arg::Gds(isc_random) << Arg::Str(relation_name->str_data) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(relation_node->nod_line) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(relation_node->nod_line) <<
Arg::Num(relation_node->nod_column));
}
}
@ -390,7 +390,7 @@ dsql_ctx* PASS1_make_context(CompiledStatement* statement, const dsql_nod* relat
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-204) <<
Arg::Gds(isc_dsql_relation_err) <<
Arg::Gds(isc_random) << Arg::Str(relation_name->str_data) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(relation_node->nod_line) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(relation_node->nod_line) <<
Arg::Num(relation_node->nod_column));
}
}
@ -398,7 +398,7 @@ dsql_ctx* PASS1_make_context(CompiledStatement* statement, const dsql_nod* relat
if (procedure && !procedure->prc_out_count) {
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-84) <<
Arg::Gds(isc_dsql_procedure_use_err) << Arg::Str(relation_name->str_data) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(relation_node->nod_line) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(relation_node->nod_line) <<
Arg::Num(relation_node->nod_column));
}
@ -434,14 +434,14 @@ dsql_ctx* PASS1_make_context(CompiledStatement* statement, const dsql_nod* relat
string = (dsql_str*) relation_node->nod_arg[e_rln_alias];
}
if (string)
if (string)
{
context->ctx_internal_alias = (TEXT*) string->str_data;
}
DEV_BLKCHK(string, dsql_type_str);
if (statement->req_alias_relation_prefix && !(relation_node->nod_type == nod_derived_table))
{
{
if (string) {
string = pass1_alias_concat(statement->req_alias_relation_prefix, string);
}
@ -774,9 +774,9 @@ dsql_nod* PASS1_node(CompiledStatement* statement, dsql_nod* input)
{
cte->nod_flags |= NOD_DT_CTE_USED;
if ((statement->req_flags & REQ_CTE_recursive) &&
statement->req_curr_ctes.hasData() &&
(statement->req_curr_ctes.object() == cte))
if ((statement->req_flags & REQ_CTE_recursive) &&
statement->req_curr_ctes.hasData() &&
(statement->req_curr_ctes.object() == cte))
{
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
// Recursive CTE member (%s) can refer itself only in FROM clause
@ -795,7 +795,7 @@ dsql_nod* PASS1_node(CompiledStatement* statement, dsql_nod* input)
dsql_nod* const select_expr = cte->nod_arg[e_derived_table_rse];
dsql_nod* const query = select_expr->nod_arg[e_sel_query_spec];
const bool isRecursive = (query->nod_type == nod_list) &&
const bool isRecursive = (query->nod_type == nod_list) &&
(query->nod_flags & NOD_UNION_RECURSIVE);
dsql_str* cte_name = (dsql_str*) cte->nod_arg[e_derived_table_alias];
@ -1751,7 +1751,7 @@ dsql_nod* PASS1_statement(CompiledStatement* statement, dsql_nod* input)
node = MAKE_node(input->nod_type, input->nod_count);
node->nod_arg[e_exec_stmt_sql] =
PASS1_node(statement, input->nod_arg[e_exec_stmt_sql]);
node->nod_arg[e_exec_stmt_inputs] =
node->nod_arg[e_exec_stmt_inputs] =
PASS1_node(statement, input->nod_arg[e_exec_stmt_inputs]);
// check params names uniqueness, if present
@ -1765,7 +1765,7 @@ dsql_nod* PASS1_statement(CompiledStatement* statement, dsql_nod* input)
for (int i = 0; i < cnt; i++)
{
const dsql_str* name = (dsql_str*) prm[i]->nod_arg[e_named_param_name];
size_t pos;
if (names.find(name->str_data, pos)) {
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-637) <<
@ -1776,9 +1776,9 @@ dsql_nod* PASS1_statement(CompiledStatement* statement, dsql_nod* input)
}
}
node->nod_arg[e_exec_stmt_outputs] =
node->nod_arg[e_exec_stmt_outputs] =
PASS1_node(statement, input->nod_arg[e_exec_stmt_outputs]);
if (input->nod_arg[e_exec_stmt_proc_block])
{
statement->req_loop_level++;
@ -2464,14 +2464,14 @@ static dsql_nod* ambiguity_check(CompiledStatement* statement, dsql_nod* node,
delete node;
}
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-204) <<
Arg::Gds(isc_dsql_ambiguous_field_name) << Arg::Str(buffer) <<
Arg::Gds(isc_dsql_ambiguous_field_name) << Arg::Str(buffer) <<
Arg::Str(++p) <<
Arg::Gds(isc_random) << Arg::Str(name->str_data));
return NULL;
}
ERRD_post_warning(Arg::Warning(isc_sqlwarn) << Arg::Num(204) <<
Arg::Warning(isc_dsql_ambiguous_field_name) << Arg::Str(buffer) <<
Arg::Warning(isc_dsql_ambiguous_field_name) << Arg::Str(buffer) <<
Arg::Str(++p) <<
Arg::Gds(isc_random) << Arg::Str(name->str_data));
@ -2697,7 +2697,7 @@ static void field_appears_once(const dsql_nod* fields, const dsql_nod* old_field
{
const Firebird::MetaName& n1 =
reinterpret_cast<dsql_fld*>(elem1->nod_arg[e_fld_field])->fld_name;
for (int j = i + 1; j < fields->nod_count; ++j)
{
const dsql_nod* elem2 = fields->nod_arg[j];
@ -2708,14 +2708,14 @@ static void field_appears_once(const dsql_nod* fields, const dsql_nod* old_field
{
const Firebird::MetaName& n2 =
reinterpret_cast<dsql_fld*>(elem2->nod_arg[e_fld_field])->fld_name;
if (n1 == n2)
{
const dsql_ctx* tmp_ctx = (dsql_ctx*) elem2->nod_arg[e_fld_context];
const dsql_rel* bad_rel = tmp_ctx ? tmp_ctx->ctx_relation : 0;
field_duplication(bad_rel ? bad_rel->rel_name.c_str() : 0,
n2.c_str(),
is_insert ? old_fields->nod_arg[j]: old_fields->nod_arg[j]->nod_arg[1],
is_insert ? old_fields->nod_arg[j]: old_fields->nod_arg[j]->nod_arg[1],
statement);
}
}
@ -2751,9 +2751,9 @@ static void field_duplication(const TEXT* qualifier_name, const TEXT* field_name
}
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-206) <<
Arg::Gds(isc_dsql_no_dup_name) << Arg::Str(field_name) <<
Arg::Gds(isc_dsql_no_dup_name) << Arg::Str(field_name) <<
Arg::Str(statement) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(flawed_node->nod_line) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(flawed_node->nod_line) <<
Arg::Num(flawed_node->nod_column));
}
@ -2789,14 +2789,14 @@ static void field_unknown(const TEXT* qualifier_name, const TEXT* field_name,
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-206) <<
Arg::Gds(isc_dsql_field_err) <<
Arg::Gds(isc_random) << Arg::Str(field_name) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(flawed_node->nod_line) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(flawed_node->nod_line) <<
Arg::Num(flawed_node->nod_column));
}
else
{
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-206) <<
Arg::Gds(isc_dsql_field_err) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(flawed_node->nod_line) <<
Arg::Gds(isc_dsql_line_col_error) << Arg::Num(flawed_node->nod_line) <<
Arg::Num(flawed_node->nod_column));
}
}
@ -2964,14 +2964,14 @@ static bool get_object_and_field(const dsql_nod* node,
const dsql_ctx* context = reinterpret_cast<dsql_ctx*>(node->nod_arg[e_fld_context]);
DEV_BLKCHK(context, dsql_type_ctx);
if (context->ctx_relation)
*obj_name = context->ctx_relation->rel_name.c_str();
else if (context->ctx_procedure)
*obj_name = context->ctx_procedure->prc_name.c_str();
else
*obj_name = NULL;
*fld_name = reinterpret_cast<dsql_fld*>(node->nod_arg[e_fld_field])->fld_name;
return obj_name && fld_name;
@ -3361,9 +3361,9 @@ static bool node_match(const dsql_nod* node1, const dsql_nod* node2,
}
// Handle derived fields.
if ((node1->nod_type == nod_derived_field) || (node2->nod_type == nod_derived_field))
if ((node1->nod_type == nod_derived_field) || (node2->nod_type == nod_derived_field))
{
if ((node1->nod_type == nod_derived_field) && (node2->nod_type == nod_derived_field))
if ((node1->nod_type == nod_derived_field) && (node2->nod_type == nod_derived_field))
{
const USHORT scope_level1 = (USHORT)(U_IPTR)node1->nod_arg[e_derived_field_scope];
const USHORT scope_level2 = (USHORT)(U_IPTR)node2->nod_arg[e_derived_field_scope];
@ -3474,7 +3474,7 @@ static bool node_match(const dsql_nod* node1, const dsql_nod* node2,
(node1->nod_type == nod_agg_total2) ||
(node1->nod_type == nod_agg_average2) ||
(node1->nod_type == nod_agg_average) ||
(node1->nod_type == nod_agg_list))
(node1->nod_type == nod_agg_list))
{
if ((node1->nod_flags & NOD_AGG_DISTINCT) !=
(node2->nod_flags & NOD_AGG_DISTINCT))
@ -3900,7 +3900,7 @@ static dsql_nod* pass1_constant( CompiledStatement* statement, dsql_nod* input)
*/
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-204) <<
Arg::Gds(isc_dsql_datatype_err) <<
Arg::Gds(isc_collation_not_found) << Arg::Str(global_temp_collation_name->str_data) <<
Arg::Gds(isc_collation_not_found) << Arg::Str(global_temp_collation_name->str_data) <<
Arg::Str(resolved->intlsym_name));
}
resolved = resolved_collation;
@ -3925,7 +3925,7 @@ static dsql_nod* pass1_constant( CompiledStatement* statement, dsql_nod* input)
adjust = sizeof(USHORT);
else if (constant->nod_desc.dsc_dtype == dtype_cstring)
adjust = 1;
constant->nod_desc.dsc_length -= adjust;
CharSet* charSet = INTL_charset_lookup(tdbb, INTL_GET_CHARSET(&constant->nod_desc));
@ -4007,7 +4007,7 @@ static dsql_ctx* pass1_cursor_context( CompiledStatement* statement, const dsql_
{
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-504) <<
Arg::Gds(isc_dsql_cursor_err) <<
Arg::Gds(isc_dsql_cursor_rel_ambiguous) << Arg::Str(rname->str_data) <<
Arg::Gds(isc_dsql_cursor_rel_ambiguous) << Arg::Str(rname->str_data) <<
Arg::Str(string->str_data));
}
else
@ -4027,7 +4027,7 @@ static dsql_ctx* pass1_cursor_context( CompiledStatement* statement, const dsql_
{
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-504) <<
Arg::Gds(isc_dsql_cursor_err) <<
Arg::Gds(isc_dsql_cursor_rel_not_found) << Arg::Str(rname->str_data) <<
Arg::Gds(isc_dsql_cursor_rel_not_found) << Arg::Str(rname->str_data) <<
Arg::Str(string->str_data));
}
@ -4242,7 +4242,7 @@ static dsql_nod* pass1_dbkey( CompiledStatement* statement, dsql_nod* input)
return ambiguity_check(statement, node, MAKE_cstring("RDB$DB_KEY"), contexts);
}
}
else
else
{
const bool cfgRlxAlias = Config::getRelaxedAliasChecking();
bool rlxAlias = false;
@ -4280,7 +4280,7 @@ static dsql_nod* pass1_dbkey( CompiledStatement* statement, dsql_nod* input)
if (rlxAlias == cfgRlxAlias)
break;
rlxAlias = cfgRlxAlias;
}
}
@ -4372,7 +4372,7 @@ static dsql_nod* pass1_delete( CompiledStatement* statement, dsql_nod* input)
pass1_relproc_is_recursive
@brief check if table reference is recursive i.e. its name is equal
@brief check if table reference is recursive i.e. its name is equal
to the name of current processing CTE
@param statement
@ -4404,7 +4404,7 @@ static bool pass1_relproc_is_recursive(CompiledStatement* statement, dsql_nod* i
const dsql_nod* curr_cte = statement->req_curr_ctes.object();
const dsql_str* cte_name = (dsql_str*) curr_cte->nod_arg[e_derived_table_alias];
const bool recursive = (cte_name->str_length == rel_name->str_length) &&
const bool recursive = (cte_name->str_length == rel_name->str_length) &&
(strncmp(rel_name->str_data, cte_name->str_data, cte_name->str_length) == 0);
if (recursive) {
@ -4422,7 +4422,7 @@ static bool pass1_relproc_is_recursive(CompiledStatement* statement, dsql_nod* i
@brief check if join have recursive members. If found remove this member
from join and return its boolean (to be added into WHERE clause).
We must remove member only if it is a table reference.
Punt if recursive reference is found in outer join or more than one
Punt if recursive reference is found in outer join or more than one
recursive reference is found
@param statement
@ -4433,7 +4433,7 @@ static dsql_nod* pass1_join_is_recursive(CompiledStatement* statement, dsql_nod*
{
const NOD_TYPE join_type = input->nod_arg[e_join_type]->nod_type;
bool remove = false;
bool leftRecursive = false;
dsql_nod* leftBool = NULL;
dsql_nod** join_table = &input->nod_arg[e_join_left_rel];
@ -4508,8 +4508,8 @@ static dsql_nod* pass1_join_is_recursive(CompiledStatement* statement, dsql_nod*
pass1_rse_is_recursive
@brief check if rse is recursive. If recursive reference is a table
in the FROM list remove it. If recursive reference is a part of
join add join boolean (returned by pass1_join_is_recursive) to the
in the FROM list remove it. If recursive reference is a part of
join add join boolean (returned by pass1_join_is_recursive) to the
WHERE clause. Punt if more than one recursive reference is found
@param statement
@ -4523,7 +4523,7 @@ static bool pass1_rse_is_recursive(CompiledStatement* statement, dsql_nod* input
dsql_nod* table_list = input->nod_arg[e_qry_from];
dsql_nod** table = table_list->nod_arg;
dsql_nod** end = table_list->nod_arg + table_list->nod_count;
bool found = false;
for (dsql_nod** prev = table; table < end; table++)
{
@ -4558,7 +4558,7 @@ static bool pass1_rse_is_recursive(CompiledStatement* statement, dsql_nod* input
}
found = true;
input->nod_arg[e_qry_where] =
input->nod_arg[e_qry_where] =
compose(input->nod_arg[e_qry_where], joinBool, nod_and);
}
}
@ -4582,11 +4582,11 @@ static bool pass1_rse_is_recursive(CompiledStatement* statement, dsql_nod* input
@brief Process derived table which can be recursive CTE
If it is non-recursive return input node unchanged
If it is recursive return new derived table which is an union of
union of anchor (non-recursive) queries and union of recursive
queries. Check recursive queries to satisfy various criterias.
If it is recursive return new derived table which is an union of
union of anchor (non-recursive) queries and union of recursive
queries. Check recursive queries to satisfy various criterias.
Note that our parser is right-to-left therefore recursive members
will be first in union's list
will be first in union's list
@param statement
@ -4628,19 +4628,19 @@ static dsql_nod* pass1_recursive_cte(CompiledStatement* statement, dsql_nod* inp
if (rse->nod_arg[e_qry_distinct]) {
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
// Recursive member of CTE '%s' has %s clause
Arg::Gds(isc_dsql_cte_wrong_clause) << Arg::Str(cte_alias->str_data) <<
Arg::Gds(isc_dsql_cte_wrong_clause) << Arg::Str(cte_alias->str_data) <<
Arg::Str("DISTINCT"));
}
if (rse->nod_arg[e_qry_group]) {
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
// Recursive member of CTE '%s' has %s clause
Arg::Gds(isc_dsql_cte_wrong_clause) << Arg::Str(cte_alias->str_data) <<
Arg::Gds(isc_dsql_cte_wrong_clause) << Arg::Str(cte_alias->str_data) <<
Arg::Str("GROUP BY"));
}
if (rse->nod_arg[e_qry_having]) {
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
// Recursive member of CTE '%s' has %s clause
Arg::Gds(isc_dsql_cte_wrong_clause) << Arg::Str(cte_alias->str_data) <<
Arg::Gds(isc_dsql_cte_wrong_clause) << Arg::Str(cte_alias->str_data) <<
Arg::Str("HAVING"));
}
// hvlad: we need also forbid any aggregate function here
@ -4675,9 +4675,9 @@ static dsql_nod* pass1_recursive_cte(CompiledStatement* statement, dsql_nod* inp
// Non-recursive member is missing in CTE '%s'
Arg::Gds(isc_dsql_cte_miss_nonrecursive) << Arg::Str(cte_alias->str_data));
}
qry = recursive_rse;
dsql_nod* list = 0;
dsql_nod* list = 0;
while (qry->nod_arg[0] != anchor_rse)
{
list = qry;
@ -4698,7 +4698,7 @@ static dsql_nod* pass1_recursive_cte(CompiledStatement* statement, dsql_nod* inp
dsql_nod* select = MAKE_node(nod_select_expr, e_sel_count);
select->nod_arg[e_sel_query_spec] = union_node;
select->nod_arg[e_sel_order] = select->nod_arg[e_sel_rows] =
select->nod_arg[e_sel_order] = select->nod_arg[e_sel_rows] =
select->nod_arg[e_sel_with_list] = NULL;
dsql_nod* node = MAKE_node(nod_derived_table, e_derived_table_count);
@ -4799,14 +4799,14 @@ static dsql_nod* pass1_derived_table(CompiledStatement* statement, dsql_nod* inp
for (DsqlContextStack::iterator stack(*statement->req_context); stack.hasData(); ++stack)
{
dsql_ctx* local_context = stack.object();
if ((local_context->ctx_scope_level < statement->req_scope_level) ||
if ((local_context->ctx_scope_level < statement->req_scope_level) ||
(local_context->ctx_flags & CTX_system))
{
temp.push(local_context);
}
}
dsql_ctx* baseContext = NULL;
if (temp.hasData()) {
if (temp.hasData()) {
baseContext = temp.object();
}
statement->req_context = &temp;
@ -4815,20 +4815,20 @@ static dsql_nod* pass1_derived_table(CompiledStatement* statement, dsql_nod* inp
dsql_nod* const select_expr = input->nod_arg[e_derived_table_rse];
dsql_nod* query = select_expr->nod_arg[e_sel_query_spec];
dsql_nod* rse = NULL;
const bool isRecursive =
const bool isRecursive =
(query->nod_type == nod_list) && (query->nod_flags & NOD_UNION_RECURSIVE);
USHORT recursive_map_ctx = 0;
if (isRecursive)
{
// Create dummy, non-recursive select statement by doing a union of
// one, non-recursive member. The dummy will be replaced at the end
// Create dummy, non-recursive select statement by doing a union of
// one, non-recursive member. The dummy will be replaced at the end
// of this function.
query->nod_count = 1;
query->nod_flags &= ~NOD_UNION_RECURSIVE;
dsql_ctx* baseUnionCtx = statement->req_union_context.hasData() ?
dsql_ctx* baseUnionCtx = statement->req_union_context.hasData() ?
statement->req_union_context.object() : NULL;
// reserve extra context number for map's secondary context
@ -4842,13 +4842,13 @@ static dsql_nod* pass1_derived_table(CompiledStatement* statement, dsql_nod* inp
query->nod_count = 2;
query->nod_flags |= NOD_UNION_RECURSIVE;
while (statement->req_union_context.hasData() &&
while (statement->req_union_context.hasData() &&
statement->req_union_context.object() != baseUnionCtx)
{
statement->req_union_context.pop();
}
}
else
else
{
// AB: 2005-01-06
// If our derived table contains a single query with a sub-select buried
@ -5014,7 +5014,7 @@ static dsql_nod* pass1_derived_table(CompiledStatement* statement, dsql_nod* inp
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
Arg::Gds(isc_dsql_command_err) <<
Arg::Gds(isc_dsql_derived_field_unnamed) << Arg::Num(count + 1) <<
Arg::Gds(isc_dsql_derived_field_unnamed) << Arg::Num(count + 1) <<
Arg::Str(aliasname));
}
}
@ -5033,7 +5033,7 @@ static dsql_nod* pass1_derived_table(CompiledStatement* statement, dsql_nod* inp
// column %s was specified multiple times for derived table %s
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
Arg::Gds(isc_dsql_command_err) <<
Arg::Gds(isc_dsql_derived_field_dup_name) << Arg::Str(name1->str_data) <<
Arg::Gds(isc_dsql_derived_field_dup_name) << Arg::Str(name1->str_data) <<
Arg::Str(aliasname));
}
}
@ -5063,7 +5063,7 @@ static dsql_nod* pass1_derived_table(CompiledStatement* statement, dsql_nod* inp
temp.clear();
rse->nod_arg[e_rse_items] = context->ctx_rse->nod_arg[e_rse_items];
dsql_nod* node2 = MAKE_node(nod_derived_table, e_derived_table_count);
*node2 = *node;
node2->nod_arg[e_derived_table_rse] = rse;
@ -5076,12 +5076,12 @@ static dsql_nod* pass1_derived_table(CompiledStatement* statement, dsql_nod* inp
statement->req_context = req_base;
// mark union's map context as recursive and assign
// mark union's map context as recursive and assign
// secondary context number to it
dsql_nod* items = rse->nod_arg[e_rse_items];
dsql_nod* map_item = items->nod_arg[0];
if (map_item->nod_type == nod_derived_field) {
map_item = map_item->nod_arg[e_alias_value];
map_item = map_item->nod_arg[e_alias_value];
}
dsql_ctx* map_context = (dsql_ctx*) map_item->nod_arg[e_map_context];
@ -5348,7 +5348,7 @@ static dsql_nod* pass1_field(CompiledStatement* statement, dsql_nod* input,
bool resolve_by_alias = true;
const bool relaxedAliasChecking = Config::getRelaxedAliasChecking();
while (true)
while (true)
{
// AB: Loop through the scope_levels starting by its own.
bool done = false;
@ -5371,7 +5371,7 @@ static dsql_nod* pass1_field(CompiledStatement* statement, dsql_nod* input,
continue;
}
dsql_fld* field = resolve_context(statement, qualifier, context, is_check_constraint,
dsql_fld* field = resolve_context(statement, qualifier, context, is_check_constraint,
resolve_by_alias);
// AB: When there's no relation and no procedure then we have a derived table.
@ -5428,7 +5428,7 @@ static dsql_nod* pass1_field(CompiledStatement* statement, dsql_nod* input,
if (field || using_field) {
// Intercept any reference to a field with datatype that
// did not exist prior to V6 and post an error
if (statement->req_client_dialect <= SQL_DIALECT_V5 && field &&
(field->fld_dtype == dtype_sql_date ||
field->fld_dtype == dtype_sql_time ||
@ -6228,7 +6228,7 @@ static dsql_nod* pass1_group_by_list(CompiledStatement* statement, dsql_nod* inp
DEV_BLKCHK(*ptr, dsql_type_nod);
dsql_nod* sub = (*ptr);
dsql_nod* frnode = NULL;
if (sub->nod_type == nod_field_name)
if (sub->nod_type == nod_field_name)
{
// check for alias or field node
frnode = pass1_field(statement, sub, false, selectList);
@ -6249,7 +6249,7 @@ static dsql_nod* pass1_group_by_list(CompiledStatement* statement, dsql_nod* inp
{
frnode = pass1_node_psql(statement, *ptr, false);
}
stack.push(frnode);
}
// Finally make the complete list.
@ -6344,7 +6344,7 @@ static dsql_nod* pass1_insert( CompiledStatement* statement, dsql_nod* input, bo
fields = pass1_node_psql(statement, fields, false);
// We do not allow cases like INSERT INTO T(f1, f2, f1)...
field_appears_once(fields, old_fields, true, "INSERT");
// begin IBO hack
// 02-May-2004, Nickolay Samofatov. Do not constify ptr further e.g. to
// const dsql_nod* const* .... etc. It chokes GCC 3.4.0
@ -6795,7 +6795,7 @@ static dsql_nod* pass1_label(CompiledStatement* statement, dsql_nod* input)
// ERROR: Label %s is not found in the current scope
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
Arg::Gds(isc_dsql_command_err) <<
Arg::Gds(isc_dsql_invalid_label) << Arg::Str(string->str_data) <<
Arg::Gds(isc_dsql_invalid_label) << Arg::Str(string->str_data) <<
Arg::Str("is not found"));
}
else {
@ -6808,7 +6808,7 @@ static dsql_nod* pass1_label(CompiledStatement* statement, dsql_nod* input)
// ERROR: Label %s already exists in the current scope
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
Arg::Gds(isc_dsql_command_err) <<
Arg::Gds(isc_dsql_invalid_label) << Arg::Str(string->str_data) <<
Arg::Gds(isc_dsql_invalid_label) << Arg::Str(string->str_data) <<
Arg::Str("already exists"));
}
else {
@ -6930,7 +6930,7 @@ static dsql_nod* pass1_lookup_alias(CompiledStatement* statement, const dsql_str
strcat(buffer2, " in the select list with name");
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-204) <<
Arg::Gds(isc_dsql_ambiguous_field_name) << Arg::Str(buffer1) <<
Arg::Gds(isc_dsql_ambiguous_field_name) << Arg::Str(buffer1) <<
Arg::Str(buffer2) <<
Arg::Gds(isc_random) << Arg::Str(name->str_data));
}
@ -7223,7 +7223,7 @@ static dsql_nod* pass1_merge(CompiledStatement* statement, dsql_nod* input)
}
// Changes statement->isPsql() value, calls PASS1_node and restore statement->isPsql().
// Changes statement->isPsql() value, calls PASS1_node and restore statement->isPsql().
static dsql_nod* pass1_node_psql(CompiledStatement* statement, dsql_nod* input, bool psql)
{
PsqlChanger changer(statement, psql);
@ -7360,7 +7360,7 @@ static dsql_nod* pass1_not(CompiledStatement* statement,
node->nod_arg[0] = PASS1_node(statement, sub);
return node;
}
if (is_between) {
// handle the special BETWEEN case
fb_assert(node_type == nod_or);
@ -7484,9 +7484,9 @@ static dsql_nod* pass1_alias_list(CompiledStatement* statement, dsql_nod* alias_
dsql_ctx* context = NULL;
while (aliasCount > 0)
{
if (context)
if (context)
{
if (context->ctx_rse && !context->ctx_relation && !context->ctx_procedure)
if (context->ctx_rse && !context->ctx_relation && !context->ctx_procedure)
{
// Derived table
statement->req_scope_level++;
@ -7501,7 +7501,7 @@ static dsql_nod* pass1_alias_list(CompiledStatement* statement, dsql_nod* alias_
// since we already matched it to the context.
for (; arg < end; arg++, aliasCount--)
{
if (!(relation = pass1_base_table(statement, relation, (dsql_str*) *arg)))
if (!(relation = pass1_base_table(statement, relation, (dsql_str*) *arg)))
break;
}
@ -7520,7 +7520,7 @@ static dsql_nod* pass1_alias_list(CompiledStatement* statement, dsql_nod* alias_
// calculate the length leaving room for spaces and a null
USHORT alias_length = alias_list->nod_count;
dsql_nod** aliasArg = startArg;
for (; aliasArg < end; aliasArg++)
for (; aliasArg < end; aliasArg++)
{
DEV_BLKCHK(*aliasArg, dsql_type_str);
alias_length += static_cast<USHORT>(((dsql_str*) *aliasArg)->str_length);
@ -7530,7 +7530,7 @@ static dsql_nod* pass1_alias_list(CompiledStatement* statement, dsql_nod* alias_
alias->str_length = alias_length;
TEXT* p = new_context->ctx_alias = (TEXT*) alias->str_data;
for (aliasArg = startArg; aliasArg < end; aliasArg++)
for (aliasArg = startArg; aliasArg < end; aliasArg++)
{
for (const TEXT* q = (TEXT*) ((dsql_str*) *aliasArg)->str_data; *q;)
*p++ = *q++;
@ -7540,10 +7540,10 @@ static dsql_nod* pass1_alias_list(CompiledStatement* statement, dsql_nod* alias_
context = new_context;
}
else
else
{
context = NULL;
}
context = NULL;
}
}
}
else
@ -7607,7 +7607,7 @@ static dsql_ctx* pass1_alias(CompiledStatement* statement, DsqlContextStack& sta
}
// check for matching alias.
if (context->ctx_internal_alias)
if (context->ctx_internal_alias)
{
if (!strcmp(context->ctx_internal_alias,
reinterpret_cast<const char*>(alias->str_data)))
@ -7756,7 +7756,7 @@ static dsql_nod* pass1_returning(CompiledStatement* statement, const dsql_nod* i
// RETURNING without INTO is not allowed for PSQL
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
// Unexpected end of command
Arg::Gds(isc_command_end_err2) << Arg::Num(errSrc->nod_line) <<
Arg::Gds(isc_command_end_err2) << Arg::Num(errSrc->nod_line) <<
Arg::Num(errSrc->nod_column));
}
@ -7764,12 +7764,12 @@ static dsql_nod* pass1_returning(CompiledStatement* statement, const dsql_nod* i
fb_assert(count);
dsql_nod* node = MAKE_node(nod_list, count);
if (target)
if (target)
{
// PSQL case
fb_assert(statement->isPsql());
if (count != target->nod_count) {
// count of column list and value list don't match
// count of column list and value list don't match
ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-804) <<
Arg::Gds(isc_dsql_var_count_err));
}
@ -7824,11 +7824,11 @@ static dsql_nod* pass1_returning(CompiledStatement* statement, const dsql_nod* i
/**
pass1_rse
@brief wrapper for pass1_rse_impl
substitute recursive CTE alias (if needed)
substitute recursive CTE alias (if needed)
and call pass1_rse_impl
@param statement
@ -7864,7 +7864,7 @@ static dsql_nod* pass1_rse( CompiledStatement* statement, dsql_nod* input, dsql_
/**
pass1_rse_impl
@brief Compile a record selection expression.
@ -7897,12 +7897,12 @@ static dsql_nod* pass1_rse_impl( CompiledStatement* statement, dsql_nod* input,
if (input->nod_type == nod_select_expr)
{
dsql_nod* node_with = input->nod_arg[e_sel_with_list];
try
try
{
if (node_with)
statement->addCTEs(node_with);
dsql_nod* ret =
dsql_nod* ret =
pass1_rse(statement, input->nod_arg[e_sel_query_spec],
input->nod_arg[e_sel_order], input->nod_arg[e_sel_rows],
update_lock, viewFlags);
@ -7914,7 +7914,7 @@ static dsql_nod* pass1_rse_impl( CompiledStatement* statement, dsql_nod* input,
}
return ret;
}
}
catch (const Firebird::Exception&) {
if (node_with)
statement->clearCTEs();
@ -8488,7 +8488,7 @@ static dsql_nod* pass1_sort( CompiledStatement* statement, dsql_nod* input, dsql
dsql_nod* node = MAKE_node(input->nod_type, input->nod_count);
dsql_nod** ptr2 = node->nod_arg;
for (int sortloop = 0; sortloop < input->nod_count; sortloop++)
{
DEV_BLKCHK(input->nod_arg[sortloop], dsql_type_nod);
@ -9895,8 +9895,8 @@ static dsql_nod* remap_field(CompiledStatement* statement, dsql_nod* field,
}
if (context->ctx_scope_level < lscope_level) {
field->nod_arg[e_derived_field_value] =
remap_field(statement, field->nod_arg[e_derived_field_value],
field->nod_arg[e_derived_field_value] =
remap_field(statement, field->nod_arg[e_derived_field_value],
context, current_level);
}
return field;
@ -10105,7 +10105,7 @@ static dsql_nod* remap_field(CompiledStatement* statement, dsql_nod* field,
case nod_constant:
case nod_dbkey:
return post_map(field, context);
return post_map(field, context);
default:
return field;
@ -10244,9 +10244,9 @@ static dsql_fld* resolve_context( CompiledStatement* statement, const dsql_str*
// return NULL;
// }
// AB: If this context is a system generated context as in NEW/OLD inside
// triggers, the qualifier by the field is mandatory. While we can't
// fall back from a higher scope-level to the NEW/OLD contexts without
// AB: If this context is a system generated context as in NEW/OLD inside
// triggers, the qualifier by the field is mandatory. While we can't
// fall back from a higher scope-level to the NEW/OLD contexts without
// the qualifier present.
// An exception is a check-constraint that is allowed to reference fields
// without the qualifier.
@ -10712,7 +10712,7 @@ dsql_nod* CompiledStatement::findCTE(const dsql_str* name)
dsql_nod* cte = req_ctes[i];
const dsql_str* cte_name = (dsql_str*) cte->nod_arg[e_derived_table_alias];
if (name->str_length == cte_name->str_length &&
if (name->str_length == cte_name->str_length &&
strncmp(name->str_data, cte_name->str_data, cte_name->str_length) == 0)
{
return cte;
@ -10782,9 +10782,9 @@ static void trace_line(const char* message, ...) {
}
/**
DSQL_pretty
@brief Pretty print a node tree.
@ -11035,7 +11035,7 @@ void DSQL_pretty(const dsql_nod* node, int column)
case nod_exec_procedure:
verb = "execute procedure";
break;
case nod_exec_block:
case nod_exec_block:
verb = "execute block";
break;
case nod_exists:
@ -11295,7 +11295,7 @@ void DSQL_pretty(const dsql_nod* node, int column)
case nod_join_inner:
verb = "join_inner";
break;
// SKIDDER: some more missing node types
// SKIDDER: some more missing node types
case nod_commit:
verb = "commit";
break;
@ -11641,7 +11641,7 @@ void DSQL_pretty(const dsql_nod* node, int column)
field->fld_name.c_str(), context->ctx_context);
return;
}
case nod_field_name:
trace_line("%sfield name: \"", buffer);
string = (dsql_str*) node->nod_arg[e_fln_context];
@ -11759,15 +11759,15 @@ void DSQL_pretty(const dsql_nod* node, int column)
case nod_param_val:
verb = "param_val"; // do we need more here?
break;
case nod_query_spec:
verb = "query_spec";
break;
case nod_comment:
verb = "comment";
break;
case nod_mod_udf:
verb = "mod_udf";
break;
@ -11795,11 +11795,11 @@ void DSQL_pretty(const dsql_nod* node, int column)
case nod_collation_specific_attr:
verb = "collation_specific_attr";
break;
case nod_returning:
verb = "returning";
break;
case nod_tra_misc:
verb = "tra_misc";
break;
@ -11850,7 +11850,7 @@ void DSQL_pretty(const dsql_nod* node, int column)
if (node->nod_count == 2)
DSQL_pretty(*ptr, column + 1);
return;
case nod_mod_role:
verb = "mod_role";
break;

View File

@ -1,7 +1,7 @@
/*
* PROGRAM: Dynamic SQL runtime support
* MODULE: preparse.cpp
* DESCRIPTION: Dynamic SQL pre parser / parser on client side.
* DESCRIPTION: Dynamic SQL pre parser / parser on client side.
* This module will probably change to a YACC parser.
*
* The contents of this file are subject to the Interbase Public
@ -79,7 +79,7 @@ static const pp_table pp_symbols[] = {
{"", 0, 0}
};
// define the tokens
// define the tokens
enum token_vals {
NO_MORE_TOKENS = -1,
@ -95,9 +95,9 @@ using namespace Firebird;
/**
PREPARSE_execute
@brief
@param user_status
@ -135,7 +135,7 @@ bool PREPARSE_execute(
if (get_token(user_status, SYMBOL, false, &stmt, stmt_end, token) ||
token.length() != pp_symbols[PP_CREATE].length ||
token != pp_symbols[PP_CREATE].symbol)
token != pp_symbols[PP_CREATE].symbol)
{
return false;
}
@ -144,7 +144,7 @@ bool PREPARSE_execute(
(token.length() != pp_symbols[PP_DATABASE].length &&
token.length() != pp_symbols[PP_SCHEMA].length) ||
(token != pp_symbols[PP_DATABASE].symbol &&
token != pp_symbols[PP_SCHEMA].symbol))
token != pp_symbols[PP_SCHEMA].symbol))
{
return false;
}
@ -175,7 +175,7 @@ bool PREPARSE_execute(
matched = false;
for (int i = 3; pp_symbols[i].length && !matched; i++) {
if (token.length() == pp_symbols[i].length &&
token == pp_symbols[i].symbol)
token == pp_symbols[i].symbol)
{
bool get_out = false;
// CVC: What's strange, this routine doesn't check token.length()
@ -232,7 +232,7 @@ bool PREPARSE_execute(
break;
case PP_LENGTH:
// Skip a token for value
// Skip a token for value
if (get_token(user_status, '=', true, &stmt, stmt_end, token) ||
get_token(user_status, NUMERIC, false, &stmt, stmt_end, token))
@ -258,10 +258,10 @@ bool PREPARSE_execute(
} while (matched);
// This code is because 3.3 server does not recognize isc_dpb_overwrite.
// This code is because 3.3 server does not recognize isc_dpb_overwrite.
FB_API_HANDLE temp_db_handle = 0;
if (!isc_attach_database(user_status, 0, file_name.c_str(),
&temp_db_handle, dpb.getBufferLength(),
if (!isc_attach_database(user_status, 0, file_name.c_str(),
&temp_db_handle, dpb.getBufferLength(),
reinterpret_cast<const ISC_SCHAR*>(dpb.getBuffer())) ||
user_status[1] != isc_io_error)
{
@ -287,7 +287,7 @@ bool PREPARSE_execute(
isc_create_database(user_status, 0, file_name.c_str(),
(db_handle), dpb.getBufferLength(),
reinterpret_cast<const ISC_SCHAR*>(dpb.getBuffer()),
reinterpret_cast<const ISC_SCHAR*>(dpb.getBuffer()),
0);
}
catch (const Exception& ex)
@ -301,9 +301,9 @@ bool PREPARSE_execute(
/**
generate_error
@brief
@param user_status
@ -351,9 +351,9 @@ static void generate_error(ISC_STATUS* user_status,
/**
get_next_token
@brief
@param stmt
@ -426,7 +426,7 @@ static SSHORT get_next_token(const SCHAR** stmt,
}
*stmt = s;
if (token.length() > MAX_TOKEN_SIZE) {
// '=' used as then there is no place for null termination
// '=' used as then there is no place for null termination
token.erase(MAX_TOKEN_SIZE);
return TOKEN_TOO_LONG;
}
@ -448,7 +448,7 @@ static SSHORT get_next_token(const SCHAR** stmt,
return NUMERIC;
}
// Is is a symbol
// Is is a symbol
if (char_class & CHR_LETTER) {
token += UPPER(c);
@ -473,9 +473,9 @@ static SSHORT get_next_token(const SCHAR** stmt,
/**
get_token
@brief
@param status
@ -506,13 +506,13 @@ static SSHORT get_token(ISC_STATUS* status,
case TOKEN_TOO_LONG:
*stmt = temp_stmt;
// generate error here
// generate error here
generate_error(status, token, result, 0);
return FB_FAILURE;
}
// Some token was found
// Some token was found
if (result == token_type) {
*stmt = temp_stmt;

View File

@ -57,7 +57,7 @@ enum name_type {
NAME_cursor = 2
};
/* declare a structure which enables us to associate a cursor with a
/* declare a structure which enables us to associate a cursor with a
statement and vice versa */
struct dsql_dbb
@ -70,14 +70,14 @@ struct dsql_name; // fwd. decl.
struct dsql_stmt
{
dsql_stmt* stmt_next; // next in chain
dsql_stmt* stmt_next; // next in chain
dsql_name* stmt_stmt; // symbol table entry for statement name
dsql_name* stmt_cursor; // symbol table entry for cursor name
FB_API_HANDLE stmt_handle; // stmt handle returned by dsql_xxx
FB_API_HANDLE stmt_db_handle; // database handle for this statement
FB_API_HANDLE stmt_handle; // stmt handle returned by dsql_xxx
FB_API_HANDLE stmt_db_handle; // database handle for this statement
};
// declare a structure to hold the cursor and statement names
// declare a structure to hold the cursor and statement names
struct dsql_name
{
@ -109,9 +109,9 @@ static USHORT name_length(const SCHAR*);
static void remove_name(dsql_name*, dsql_name**);
static bool scompare(const SCHAR*, USHORT, const SCHAR*, USHORT);
// declare the private data
// declare the private data
static bool init_flag = false; // whether we've been initialized
static bool init_flag = false; // whether we've been initialized
static dsql_err_stblock* UDSQL_error = NULL;
static dsql_stmt* statements = NULL;
static dsql_name* statement_names = NULL;
@ -530,7 +530,7 @@ ISC_STATUS API_ROUTINE isc_embed_dsql_insert(ISC_STATUS* user_status,
INIT_DSQL(user_status, local_status);
try
{
// get the symbol table entry
// get the symbol table entry
dsql_stmt* statement = lookup_stmt(cursor_name, cursor_names, NAME_cursor);
@ -612,7 +612,7 @@ ISC_STATUS API_ROUTINE isc_embed_dsql_open2(ISC_STATUS* user_status,
INIT_DSQL(user_status, local_status);
try
{
// get the symbol table entry
// get the symbol table entry
dsql_stmt* statement = lookup_stmt(cursor_name, cursor_names, NAME_cursor);
@ -692,7 +692,7 @@ ISC_STATUS API_ROUTINE isc_embed_dsql_prepare(ISC_STATUS* user_status,
length, string, dialect, sqlda);
if (s) {
// An error occurred. Free any newly allocated statement handle.
// An error occurred. Free any newly allocated statement handle.
if (!statement) {
ISC_STATUS_ARRAY local_status2;
@ -711,13 +711,13 @@ ISC_STATUS API_ROUTINE isc_embed_dsql_prepare(ISC_STATUS* user_status,
if (!statement)
{
statement = (dsql_stmt*) gds__alloc((SLONG) sizeof(dsql_stmt));
// FREE: by user calling isc_embed_dsql_release()
if (!statement) // NOMEM:
// FREE: by user calling isc_embed_dsql_release()
if (!statement) // NOMEM:
error_post(Arg::Gds(isc_virmemexh));
#ifdef DEBUG_GDS_ALLOC
gds_alloc_flag_unfreed((void *) statement);
#endif // DEBUG_GDS_ALLOC
#endif // DEBUG_GDS_ALLOC
statement->stmt_next = statements;
statements = statement;
@ -762,7 +762,7 @@ ISC_STATUS API_ROUTINE isc_embed_dsql_release(ISC_STATUS* user_status,
INIT_DSQL(user_status, local_status);
try
{
// If a request already exists under that name, purge it out
// If a request already exists under that name, purge it out
dsql_stmt* statement = lookup_stmt(stmt_name, statement_names, NAME_statement);
@ -852,10 +852,10 @@ ISC_STATUS API_ROUTINE isc_dsql_fetch2_a(ISC_STATUS* user_status,
*sqlcode = 0;
const ISC_STATUS s =
isc_dsql_fetch2(user_status,
reinterpret_cast<FB_API_HANDLE*>(stmt_handle),
dialect,
reinterpret_cast<XSQLDA*>(sqlda),
isc_dsql_fetch2(user_status,
reinterpret_cast<FB_API_HANDLE*>(stmt_handle),
dialect,
reinterpret_cast<XSQLDA*>(sqlda),
direction,
offset);
if (s == 100)
@ -1344,8 +1344,8 @@ static dsql_name* insert_name(const TEXT* symbol_name, dsql_name** list_ptr, dsq
**************************************/
const USHORT l = name_length(symbol_name);
dsql_name* name = (dsql_name*) gds__alloc((SLONG) sizeof(dsql_name) + l);
// FREE: by exit handler cleanup() or database_cleanup()
if (!name) // NOMEM:
// FREE: by exit handler cleanup() or database_cleanup()
if (!name) // NOMEM:
error_post(Arg::Gds(isc_virmemexh));
name->name_stmt = stmt;
name->name_length = l;

View File

@ -332,7 +332,7 @@ int CLIB_ROUTINE main( int argc, char* argv[])
}
FILE* input_file;
if (dudleyGlob.DDL_extract) {
strcpy(dudleyGlob.DB_file_string, file_name_1);
strcpy(dudleyGlob.DDL_file_string, file_name_2);
@ -355,8 +355,8 @@ int CLIB_ROUTINE main( int argc, char* argv[])
dudleyGlob.DDL_interactive = dudleyGlob.DDL_service || isatty(0);
}
else {
/*
* try to open the input DDL file.
/*
* try to open the input DDL file.
* If it already has a .GDL extension, just try to open it.
* Otherwise, add the extension, try, remove the extension,
* and try again.
@ -696,7 +696,7 @@ bool DDL_yes_no( USHORT number)
*
**************************************/
TEXT prompt[128], reprompt[128], yes_ans[128], no_ans[128];
static const SafeArg dummy;
fb_msg_format(0, DDL_MSG_FAC, number, sizeof(prompt), prompt, dummy);

View File

@ -69,7 +69,7 @@ void EXP_actions(void)
* Expand the output of the parser.
* Look for field references and put
* them in appropriate context.
*
*
**************************************/
ACT action;
@ -398,11 +398,11 @@ static DUDLEY_FLD field_context( DUDLEY_NOD node, dudley_lls* contexts, DUDLEY_C
*
* Functional description
* Lookup a field reference, guessing the
* context. Since by now all field references
* context. Since by now all field references
* ought to be entered in the hash table, this is
* pretty easy. We may be looking up a global
* field reference, in which case the context
* relation will be null.
* relation will be null.
*
*
**************************************/
@ -468,7 +468,7 @@ static DUDLEY_FLD field_search( DUDLEY_NOD node, dudley_lls* contexts, DUDLEY_CT
* iteratively. The context indicated is
* the current context. Get to there, then
* work backward.
*
*
**************************************/
DUDLEY_FLD field;
DUDLEY_CTX context, old_context;
@ -562,7 +562,7 @@ static DUDLEY_FLD lookup_field( DUDLEY_FLD old_field)
* Lookup a field reference, from a modify or
* delete field statement, and make sure we
* found the thing originally.
* context. Since by now all field references
* context. Since by now all field references
* ought to be entered in the hash table, this is
* pretty easy.
*
@ -650,7 +650,7 @@ static DUDLEY_TRG lookup_trigger( DUDLEY_TRG trigger)
{
/**************************************
*
* l o o k u p _ t r i g g e r
* l o o k u p _ t r i g g e r
*
**************************************
*
@ -886,7 +886,7 @@ static void resolve_rse( DUDLEY_NOD rse, dudley_lls** stack)
**************************************
*
* Functional description
* Resolve record selection expression, augmenting
* Resolve record selection expression, augmenting
* context stack. At the same time, put a context
* node in front of every context and build a list
* out of the whole thing;

View File

@ -36,7 +36,7 @@ static void get_set_generator(STR, DUDLEY_NOD);
static inline void check_blr(str* blr, const int l)
{
if (!(blr->str_current - blr->str_start + l <= blr->str_length)
if (!(blr->str_current - blr->str_start + l <= blr->str_length)
&& !TRN_get_buffer(blr, l) )
{
DDL_err(289);
@ -538,7 +538,7 @@ static void generate( STR blr, DUDLEY_NOD node)
operatr = blr_matching2;
break;
// case nod_substr:
// operatr = blr_substring;
// operatr = blr_substring;
// break;
default:

View File

@ -173,7 +173,7 @@ struct word {
// {KW_RAW, "RAW"},
// {KW_RAW_PARTITIONS, "RAW_PARTITIONS"},
{KW_REFERENCE, "REFERENCE"},
{KW_RELATION, "RELATION"},
{KW_RELATION, "RELATION"},
{KW_RETURN_ARGUMENT, "RETURN_ARGUMENT"}, /* function argument return_mode */
{KW_RETURN_VALUE, "RETURN_VALUE"}, /* function argument return_mode */
{KW_REVOKE, "REVOKE"},
@ -250,8 +250,8 @@ struct word {
{KW_MAX, "MAX"},
{KW_TO, "TO"},
{KW_TOTAL, "TOTAL"},
{KW_UNIQUE, "UNIQUE"},
{KW_UPPERCASE, "UPPERCASE"},
{KW_UNIQUE, "UNIQUE"},
{KW_UPPERCASE, "UPPERCASE"},
{KW_WITH, "WITH"}
};
@ -344,7 +344,7 @@ void HSH_remove( SYM symbol)
{
/**************************************
*
* H S H _ r e m o v e
* H S H _ r e m o v e
*
**************************************
*

View File

@ -242,7 +242,7 @@ FUNC PARSE_function(int existingFunction)
*
* Functional description
* Get the function block associated with the current token. Also
* advance the token. Create a new function requested.
* advance the token. Create a new function requested.
*
**************************************/
if (dudleyGlob.DDL_token.tok_type != tok_ident)
@ -253,7 +253,7 @@ FUNC PARSE_function(int existingFunction)
FUNC function;
if (symbol && (function = (FUNC) symbol->sym_object) &&
function->func_database == dudleyGlob.database)
function->func_database == dudleyGlob.database)
{
LEX_token();
return function;
@ -324,7 +324,7 @@ DUDLEY_NOD PARSE_make_list(dudley_lls* stack)
while (stack)
node->nod_arg[--count] = LLS_POP(&stack);
return node;
}
@ -369,7 +369,7 @@ bool PARSE_match( enum kwwords keyword)
for (SYM symbol = dudleyGlob.DDL_token.tok_symbol; symbol; symbol = symbol->sym_homonym)
if (symbol->sym_type == SYM_keyword &&
symbol->sym_keyword == (int) keyword)
symbol->sym_keyword == (int) keyword)
{
LEX_token();
return true;
@ -560,7 +560,7 @@ static SYM copy_symbol( SYM old_name)
* does the implicit invocation of same-named
* global fields.
*
* We'll just leave the type blank for now.
* We'll just leave the type blank for now.
*
**************************************/
SYM new_name = (SYM) DDL_alloc(SYM_LEN + old_name->sym_length);
@ -674,7 +674,7 @@ static void define_database( enum act_t action_type)
**************************************/
if (dudleyGlob.database)
DDL_error_abort(0, 120);
// msg 120: GDEF processes only one database at a time
// msg 120: GDEF processes only one database at a time
dudleyGlob.database = (DBB) DDL_alloc(sizeof(dbb));
dudleyGlob.database->dbb_name = PARSE_symbol(tok_quoted);
@ -740,7 +740,7 @@ static void define_database( enum act_t action_type)
*/
else
PARSE_error(121, 0, 0);
// msg 121 only SECURITY_CLASS, DESCRIPTION and CACHE can be dropped
// msg 121 only SECURITY_CLASS, DESCRIPTION and CACHE can be dropped
}
else if (PARSE_match(KW_FILE)) {
FIL file = define_file();
@ -1113,7 +1113,7 @@ static FIL define_log_file( USHORT log_type)
else if (PARSE_match(KW_RAW_PARTITIONS)) {
if (log_type != DBB_log_preallocated)
PARSE_error(332, 0, 0);
// msg 332: Partitions not supported in series of log file specification
// msg 332: Partitions not supported in series of log file specification
PARSE_match(KW_EQUALS);
file->fil_partitions = PARSE_number();
file->fil_raw = LOG_raw;
@ -1204,7 +1204,7 @@ static void define_relation(void)
|| EXE_relation(relation)))
{
PARSE_error(137, relation->rel_name->sym_string, 0);
// msg 137: relation %s already exists
// msg 137: relation %s already exists
}
if (PARSE_match(KW_EXTERNAL_FILE)) {
@ -1334,7 +1334,7 @@ static void define_shadow(void)
*
* Functional description
* Define a shadow file to the database.
* Parse it as a set of normal file additions,
* Parse it as a set of normal file additions,
* setting the shadow number on all files.
*
**************************************/
@ -1351,7 +1351,7 @@ static void define_shadow(void)
PARSE_error(139, 0, 0); /* msg 139: shadow number must be a positive integer */
}
/* match the keywords MANUAL or AUTO to imply whether the shadow
/* match the keywords MANUAL or AUTO to imply whether the shadow
should be automatically deleted when something goes awry */
if (PARSE_match(KW_MANUAL))
@ -1365,7 +1365,7 @@ static void define_shadow(void)
shadow->fil_name = PARSE_symbol(tok_quoted);
if (!check_filename(shadow->fil_name, false))
PARSE_error(297, 0, 0);
// msg 297: A node name is not permitted in a shadow or secondary file name
// msg 297: A node name is not permitted in a shadow or secondary file name
if (PARSE_match(KW_LENGTH)) {
shadow->fil_length = PARSE_number();
@ -1424,7 +1424,7 @@ static void define_trigger(void)
trigger->trg_sequence = trg_sequence;
if (!(int) trigger->trg_type) /* still none */
PARSE_error(141, dudleyGlob.DDL_token.tok_string, 0);
PARSE_error(141, dudleyGlob.DDL_token.tok_string, 0);
/* msg 141: expected STORE, MODIFY, ERASE, encountered \"%s\" */
bool action = false;
@ -1530,7 +1530,7 @@ static void define_view(void)
|| EXE_relation(relation)))
{
PARSE_error(300, relation->rel_name->sym_string, 0);
// msg 300: relation %s already exists
// msg 300: relation %s already exists
}
PARSE_match(KW_OF);
@ -1895,7 +1895,7 @@ static void end_text( TXT text)
dudleyGlob.DDL_token.tok_position - dudleyGlob.DDL_token.tok_length - text->txt_position;
#if (defined WIN_NT)
/* the length of the text field should subtract out the
/* the length of the text field should subtract out the
line feeds, since they are automatically filtered out
when reading from a file */
@ -1913,7 +1913,7 @@ static SYM gen_trigger_name( TRG_T type, DUDLEY_REL relation)
**************************************
*
* Functional description
* Generate a trigger name for an old style trigger.
* Generate a trigger name for an old style trigger.
*
**************************************/
SYM symbol = (SYM) DDL_alloc(SYM_LEN + GDS_NAME_LEN);
@ -1992,7 +1992,7 @@ static void get_trigger_attributes( int *flags, int *type, int *sequence)
* PRE and POST are optional in new style definitions.
* For STORE & MODIFY PRE is the default.
* For ERASE, POST is the default.
*
*
**************************************/
if (PARSE_match(KW_INACTIVE)) {
@ -2098,9 +2098,9 @@ static void grant_user_privilege(void)
PARSE_error(313, dudleyGlob.DDL_token.tok_string, 0); /* msg 313: expected ON or '(', encountered "%s" */
do {
if (dudleyGlob.DDL_token.tok_keyword == KW_SELECT
|| dudleyGlob.DDL_token.tok_keyword == KW_INSERT
|| dudleyGlob.DDL_token.tok_keyword == KW_DELETE
if (dudleyGlob.DDL_token.tok_keyword == KW_SELECT
|| dudleyGlob.DDL_token.tok_keyword == KW_INSERT
|| dudleyGlob.DDL_token.tok_keyword == KW_DELETE
|| dudleyGlob.DDL_token.tok_keyword == KW_UPDATE)
{
break;
@ -2188,7 +2188,7 @@ static DUDLEY_CTX lookup_context( SYM symbol, dudley_lls* contexts)
for (; contexts; contexts = contexts->lls_next) {
DUDLEY_CTX context = (DUDLEY_CTX) contexts->lls_object;
SYM name = context->ctx_name;
if (name && !strcmp(name->sym_string, symbol->sym_string))
if (name && !strcmp(name->sym_string, symbol->sym_string))
return context;
}
@ -2713,7 +2713,7 @@ static void modify_trigger(void)
while (!(dudleyGlob.DDL_token.tok_keyword == KW_SEMI)) {
if ((PARSE_match(KW_MESSAGE)) || (PARSE_match(KW_MSGADD)) ||
(PARSE_match(KW_MSGMODIFY)))
(PARSE_match(KW_MSGMODIFY)))
{
msg_type = trgmsg_modify;
}
@ -3089,9 +3089,9 @@ static bool parse_action(void)
static void parse_array( DUDLEY_FLD field)
{
/**************************************
/**************************************
*
* p a r s e _ a r r a y
* p a r s e _ a r r a y
*
**************************************
*
@ -3149,7 +3149,7 @@ static TXT parse_description(void)
**************************************
*
* Functional description
* Create a text block to hold the pointer and length
* Create a text block to hold the pointer and length
* of the description of a metadata item.
*
**************************************/
@ -3444,7 +3444,7 @@ static void parse_field_dtype( DUDLEY_FLD field)
LEX_token();
if (field->fld_dtype == blr_text ||
field->fld_dtype == blr_varying || field->fld_dtype == blr_cstring)
field->fld_dtype == blr_varying || field->fld_dtype == blr_cstring)
{
if (!PARSE_match(KW_L_BRCKET) && !PARSE_match(KW_LT))
PARSE_error(200, dudleyGlob.DDL_token.tok_string, 0); /* msg 200: expected \"[\", encountered \"%s\" */
@ -3561,7 +3561,7 @@ static FUNCARG parse_function_arg( FUNC function, USHORT * position)
PARSE_error(204, 0, 0); /* msg 204: argument mode is by value, or by reference */
}
/* (kw_comma or kw_semi) here means this argument is not a
/* (kw_comma or kw_semi) here means this argument is not a
return_value or a return_argument in which case it had
better not be passed by value */
@ -3786,7 +3786,7 @@ static int parse_page_size(void)
* Functional description
* parse the page_size clause of a
* define database statement
*
*
*
**************************************/
PARSE_match(KW_EQUALS);
@ -3971,8 +3971,8 @@ static SLONG score_entry( SCE element)
**************************************
*
* Functional description
* Compute a value to determine placement of an
* access control element in an Apollo access
* Compute a value to determine placement of an
* access control element in an Apollo access
* control list.
*
**************************************/
@ -3982,7 +3982,7 @@ static SLONG score_entry( SCE element)
const TEXT* const* ptr = (TEXT**) element->sce_idents;
for (const TEXT* const* const end = ptr + id_max; ptr < end;
ptr++)
ptr++)
{
score <<= 1;
if (*ptr)

View File

@ -354,7 +354,7 @@ static void add_dimensions( STR dyn, DUDLEY_FLD field)
**************************************
*
* Functional description
* Generate dynamic DDL to create dimensions.
* Generate dynamic DDL to create dimensions.
* First get rid of any old ones.
*
**************************************/
@ -385,7 +385,7 @@ static void add_field( STR dyn, DUDLEY_FLD field, DUDLEY_REL view)
**************************************
*
* Functional description
* Generate dynamic DDL to create a
* Generate dynamic DDL to create a
* local field.
*
**************************************/
@ -499,7 +499,7 @@ static void add_filter( STR dyn, FILTER filter)
**************************************
*
* Functional description
* Generate dynamic DDL to create a
* Generate dynamic DDL to create a
* blob filter.
*
**************************************/
@ -526,7 +526,7 @@ static void add_function( STR dyn, FUNC function)
**************************************
*
* Functional description
* Generate dynamic DDL to create a
* Generate dynamic DDL to create a
* user define function.
*
**************************************/
@ -551,7 +551,7 @@ static void add_function_arg( STR dyn, FUNCARG func_arg)
**************************************
*
* Functional description
* Generate dynamic DDL to create a
* Generate dynamic DDL to create a
* user defined function.
*
**************************************/
@ -578,7 +578,7 @@ static void add_generator( STR dyn, SYM symbol)
**************************************
*
* Functional description
* Generate dynamic DDL to create a
* Generate dynamic DDL to create a
* generator.
*
**************************************/
@ -867,7 +867,7 @@ static void drop_field( STR dyn, DUDLEY_FLD field)
**************************************
*
* Functional description
* Generate dynamic DDL to eliminate
* Generate dynamic DDL to eliminate
* a local field.
*
**************************************/
@ -893,7 +893,7 @@ static void drop_filter( STR dyn, FILTER filter)
**************************************
*
* Functional description
* Generate dynamic DDL to delete a
* Generate dynamic DDL to delete a
* blob filter.
*
**************************************/
@ -913,7 +913,7 @@ static void drop_function( STR dyn, FUNC function)
**************************************
*
* Functional description
* Generate dynamic DDL to delete a
* Generate dynamic DDL to delete a
* user defined function.
*
**************************************/
@ -933,7 +933,7 @@ static void drop_global_field( STR dyn, DUDLEY_FLD field)
**************************************
*
* Functional description
* Generate dynamic DDL to eliminate
* Generate dynamic DDL to eliminate
* a global field.
*
**************************************/
@ -969,7 +969,7 @@ static void drop_relation( STR dyn, DUDLEY_REL relation)
{
/**************************************
*
* d r o p _ r e l a t i o n
* d r o p _ r e l a t i o n
*
**************************************
*
@ -1188,7 +1188,7 @@ static void modify_field( STR dyn, DUDLEY_FLD field, DUDLEY_REL view)
**************************************
*
* Functional description
* Generate dynamic DDL to modify a
* Generate dynamic DDL to modify a
* local field.
*
**************************************/
@ -1293,7 +1293,7 @@ static void modify_global_field( STR dyn, DUDLEY_FLD field)
}
else
put_symbol(dyn, isc_dyn_fld_query_name, field->fld_query_name);
if (field->fld_flags & fld_null_query_header) {
check_dyn(dyn, 3);
dyn->add_byte(isc_dyn_fld_query_header);

View File

@ -64,7 +64,7 @@ be easy to add needed headers to stdafx.h after a makefile is built.
#if defined (_WIN32)
/*
BOOL APIENTRY DllMain( HANDLE ,//hModule,
DWORD ul_reason_for_call,
DWORD ul_reason_for_call,
LPVOID //lpReserved
)
{
@ -114,7 +114,7 @@ namespace internal
};
/*
inline fb_len get_varchar_len(const char* vchar)
inline fb_len get_varchar_len(const char* vchar)
{
return reinterpret_cast<const vvary*>(vchar)->vary_length;
}
@ -129,7 +129,7 @@ namespace internal
{
reinterpret_cast<vvary*>(vchar)->vary_length = len;
}
inline void set_varchar_len(ISC_UCHAR* vchar, const fb_len len)
{
reinterpret_cast<vvary*>(vchar)->vary_length = len;
@ -739,7 +739,7 @@ FBUDF_API void fbround(const paramdsc* v, paramdsc* rc)
rc->dsc_scale = 0;
return;
}
// round(0.3) => 0 ### round(0.5) => 1
// round(-0.3) => 0 ### round(-0.5) => 0
// round(-0.3) => 0 ### round(-0.5) => -1 ### SYMMETRIC_MATH defined.

View File

@ -15,11 +15,11 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* Changes made by Claudio Valderrama for the Firebird project
* changes to substr and added substrlen
* Changes made by Claudio Valderrama for the Firebird project
* changes to substr and added substrlen
* 2004.9.1 Claudio Valderrama, change some UDF's to be able to detect NULL.
* 2004.12.5 Slavomir Skopalik contributed IB_UDF_frac.
*
*
*/
#include "firebird.h"
@ -145,8 +145,8 @@ double EXPORT IB_UDF_div( ISC_LONG *a, ISC_LONG *b)
}
else
{
// This is a Kludge! We need to return INF,
// but this seems to be the only way to do
// This is a Kludge! We need to return INF,
// but this seems to be the only way to do
// it since there seens to be no constant for it.
#ifdef HAVE_INFINITY
return INFINITY;
@ -189,7 +189,7 @@ char *EXPORT IB_UDF_lower(const char *s)
{
if (!s)
return 0;
char* buf = (char *) ib_util_malloc(strlen(s) + 1);
char* p = buf;
while (*s)
@ -211,7 +211,7 @@ char *EXPORT IB_UDF_lpad( const char *s, ISC_LONG *a, const char *c)
return 0;
const long avalue = *a;
if (avalue >= 0) {
long current = 0;
const long length = strlen(s);
@ -242,10 +242,10 @@ char *EXPORT IB_UDF_ltrim( const char *s)
{
if (!s)
return 0;
while (*s == ' ') /* skip leading blanks */
s++;
const long length = strlen(s);
char* buf = (char *) ib_util_malloc(length + 1);
memcpy(buf, s, length);
@ -265,8 +265,8 @@ double EXPORT IB_UDF_mod( ISC_LONG *a, ISC_LONG *b)
}
else
{
// This is a Kludge! We need to return INF,
// but this seems to be the only way to do
// This is a Kludge! We need to return INF,
// but this seems to be the only way to do
// it since there seens to be no constant for it.
#ifdef HAVE_INFINITY
return INFINITY;
@ -296,7 +296,7 @@ char *EXPORT IB_UDF_rpad( const char *s, ISC_LONG *a, const char *c)
{
if (!s || !c)
return 0;
const long avalue = *a;
if (avalue >= 0) {
@ -328,10 +328,10 @@ char *EXPORT IB_UDF_rtrim( const char *s)
{
if (!s)
return 0;
const char* p = s + strlen(s);
while (--p >= s && *p == ' '); // empty loop body
const long length = p - s + 1;
char* buf = (char *) ib_util_malloc(length + 1);
memcpy(buf, s, length);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +1,23 @@
//____________________________________________________________
//
//
// PROGRAM: C preprocessor
// MODULE: cme.cpp
// DESCRIPTION: Request expression compiler
//
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
//
@ -110,7 +110,7 @@ const op_table operators[] =
{ nod_user_name , blr_user_name },
// { count2 }
// { nod_count, blr_count2 },
//
//
{ nod_count , blr_count },
{ nod_max , blr_maximum },
{ nod_min , blr_minimum },
@ -160,9 +160,9 @@ static inline bool is_date_and_time(const USHORT d1, const USHORT d2)
}
//____________________________________________________________
//
//
// Compile a random expression.
//
//
void CME_expr(GPRE_NOD node, gpre_req* request)
{
@ -312,7 +312,7 @@ void CME_expr(GPRE_NOD node, gpre_req* request)
// STUFF (blr_count);
// CME_rse (node->nod_arg [0], request);
// return;
//
//
case nod_agg_total:
if (node->nod_arg[1] && !(request->req_database->dbb_flags & DBB_v3))
@ -336,8 +336,8 @@ void CME_expr(GPRE_NOD node, gpre_req* request)
case nod_dom_value:
request->add_byte(blr_fid);
request->add_byte(0); // Context
request->add_word(0); // Field id
request->add_byte(0); // Context
request->add_word(0); // Field id
return;
case nod_map_ref:
@ -480,7 +480,7 @@ void CME_expr(GPRE_NOD node, gpre_req* request)
case nod_ansi_any:
case nod_ansi_all:
case nod_unique:
// count2 next line would be deleted
// count2 next line would be deleted
case nod_count:
CME_rse((gpre_rse*) node->nod_arg[0], request);
break;
@ -490,9 +490,9 @@ void CME_expr(GPRE_NOD node, gpre_req* request)
case nod_average:
case nod_total:
case nod_from:
//
//
// case nod_count:
//
//
CME_rse((gpre_rse*) node->nod_arg[0], request);
CME_expr(node->nod_arg[1], request);
break;
@ -506,9 +506,9 @@ void CME_expr(GPRE_NOD node, gpre_req* request)
//____________________________________________________________
//
//
// Compute datatype, length, and scale of an expression.
//
//
void CME_get_dtype(const gpre_nod* node, gpre_fld* f)
{
@ -534,12 +534,12 @@ void CME_get_dtype(const gpre_nod* node, gpre_fld* f)
* SELECT NULL FROM TABLE1;
* As we don't have a <dtype_null, HOSTTYPE> datatype pairing,
* we don't know how to map this NULL to a host-language
* datatype. Therefore we now describe it as a
* datatype. Therefore we now describe it as a
* CHAR(1) CHARACTER SET NONE type.
* No value will ever be sent back, as the value of the select
* will be NULL - this is only for purposes of allocating
* values in the message DESCRIBING
* the statement.
* the statement.
* Other parts of gpre aren't too happy with a dtype_unknown datatype
*/
f->fld_dtype = dtype_text;
@ -710,7 +710,7 @@ void CME_get_dtype(const gpre_nod* node, gpre_fld* f)
CPR_error("expression evaluation not supported");
}
}
switch (dtype_max)
{
case dtype_short:
@ -1057,7 +1057,7 @@ void CME_get_dtype(const gpre_nod* node, gpre_fld* f)
f->fld_length = strlen(string) - 2;
if (gpreGlob.sw_cstring)
{
// add 1 back for the NULL byte
// add 1 back for the NULL byte
f->fld_length += 1;
f->fld_dtype = dtype_cstring;
@ -1138,9 +1138,9 @@ void CME_get_dtype(const gpre_nod* node, gpre_fld* f)
//____________________________________________________________
//
//
// Generate a relation reference.
//
//
void CME_relation(gpre_ctx* context, gpre_req* request)
{
@ -1214,9 +1214,9 @@ void CME_relation(gpre_ctx* context, gpre_req* request)
//____________________________________________________________
//
//
// Generate blr for an rse node.
//
//
void CME_rse(gpre_rse* selection, gpre_req* request)
{
@ -1234,7 +1234,7 @@ void CME_rse(gpre_rse* selection, gpre_req* request)
else
request->add_byte(blr_rs_stream);
// Process unions, if any, otherwise process relations
// Process unions, if any, otherwise process relations
gpre_rse* sub_rse = 0;
gpre_nod* union_node = selection->rse_union;
@ -1284,7 +1284,7 @@ void CME_rse(gpre_rse* selection, gpre_req* request)
request->add_byte(blr_writelock);
}
// Process the clauses present
// Process the clauses present
if (selection->rse_first)
{
@ -1351,11 +1351,11 @@ void CME_rse(gpre_rse* selection, gpre_req* request)
}
#ifdef SCROLLABLE_CURSORS
// generate a statement to be executed if the user scrolls
// in a direction other than forward; a message is sent outside
// the normal send/receive protocol to specify the direction
// and offset to scroll; note that we do this only on a SELECT
// type statement and only when talking to a 4.1 engine or greater
// generate a statement to be executed if the user scrolls
// in a direction other than forward; a message is sent outside
// the normal send/receive protocol to specify the direction
// and offset to scroll; note that we do this only on a SELECT
// type statement and only when talking to a 4.1 engine or greater
if (request->req_flags & REQ_sql_cursor &&
request->req_database->dbb_base_level >= 5)
@ -1372,17 +1372,17 @@ void CME_rse(gpre_rse* selection, gpre_req* request)
}
#endif
// Finish up by making a BLR_END
// Finish up by making a BLR_END
request->add_byte(blr_end);
}
//____________________________________________________________
//
//
// Compile up an array reference putting
// out sdl (slice description language)
//
//
static void cmp_array( GPRE_NOD node, gpre_req* request)
{
@ -1412,11 +1412,11 @@ static void cmp_array( GPRE_NOD node, gpre_req* request)
reference->add_byte(isc_sdl_struct);
reference->add_byte(1);
// The datatype of the array elements
// The datatype of the array elements
cmp_sdl_dtype(field->fld_array, reference);
// The relation and field identifiers or strings
// The relation and field identifiers or strings
if (gpreGlob.sw_ids)
{
@ -1438,11 +1438,11 @@ static void cmp_array( GPRE_NOD node, gpre_req* request)
reference->add_byte(*p);
}
// The loops for the dimensions
// The loops for the dimensions
stuff_sdl_loops(reference, field);
// The array element and its "subscripts"
// The array element and its "subscripts"
stuff_sdl_element(reference, field);
@ -1459,10 +1459,10 @@ static void cmp_array( GPRE_NOD node, gpre_req* request)
//____________________________________________________________
//
//
// Compile up a subscripted array reference
// from an gpre_rse and output blr for this reference
//
//
static void cmp_array_element( GPRE_NOD node, gpre_req* request)
{
@ -1480,8 +1480,8 @@ static void cmp_array_element( GPRE_NOD node, gpre_req* request)
//____________________________________________________________
//
//
//
//
static void cmp_cast( GPRE_NOD node, gpre_req* request)
{
@ -1493,9 +1493,9 @@ static void cmp_cast( GPRE_NOD node, gpre_req* request)
//____________________________________________________________
//
//
// Compile up a field reference.
//
//
static void cmp_field( const gpre_nod* node, gpre_req* request)
{
@ -1554,9 +1554,9 @@ static void cmp_field( const gpre_nod* node, gpre_req* request)
//____________________________________________________________
//
//
// Handle a literal expression.
//
//
static void cmp_literal( const gpre_nod* node, gpre_req* request)
{
@ -1584,7 +1584,7 @@ static void cmp_literal( const gpre_nod* node, gpre_req* request)
if (!(request->req_database->dbb_flags & DBB_v3))
request->add_byte(blr_double);
else if (gpreGlob.sw_know_interp)
{ // then must be using blr_version5
{ // then must be using blr_version5
request->add_byte(blr_text2);
request->add_word(ttype_ascii);
}
@ -1631,7 +1631,7 @@ static void cmp_literal( const gpre_nod* node, gpre_req* request)
else
long_val = (long) uint64_val;
request->add_byte(blr_long);
request->add_byte(scale); // scale factor
request->add_byte(scale); // scale factor
request->add_word(long_val);
request->add_word(long_val >> 16);
}
@ -1644,7 +1644,7 @@ static void cmp_literal( const gpre_nod* node, gpre_req* request)
else
sint64_val = (SINT64) uint64_val;
request->add_byte(blr_int64);
request->add_byte(scale); // scale factor
request->add_byte(scale); // scale factor
request->add_word(sint64_val);
request->add_word(sint64_val >> 16);
request->add_word(sint64_val >> 32);
@ -1657,18 +1657,18 @@ static void cmp_literal( const gpre_nod* node, gpre_req* request)
}
else
{
// Remove surrounding quotes from string, etc.
// Remove surrounding quotes from string, etc.
char buffer[MAX_SYM_SIZE];
char* p = buffer;
// Skip introducing quote mark
// Skip introducing quote mark
if (*string)
string++;
while (*string)
*p++ = *string++;
// Zap out terminating quote mark
// Zap out terminating quote mark
*--p = 0;
const SSHORT length = p - buffer;
@ -1738,9 +1738,9 @@ static void cmp_literal( const gpre_nod* node, gpre_req* request)
//____________________________________________________________
//
//
// Generate a map for a union or aggregate rse.
//
//
static void cmp_map(map* a_map, gpre_req* request)
{
@ -1756,13 +1756,13 @@ static void cmp_map(map* a_map, gpre_req* request)
//____________________________________________________________
//
//
// Generate an access plan for a query.
//
//
static void cmp_plan(const gpre_nod* plan_expression, gpre_req* request)
{
// stuff the join type
// stuff the join type
const gpre_nod* list = plan_expression->nod_arg[1];
if (list->nod_count > 1)
@ -1775,7 +1775,7 @@ static void cmp_plan(const gpre_nod* plan_expression, gpre_req* request)
request->add_byte(list->nod_count);
}
// stuff one or more plan items
// stuff one or more plan items
gpre_nod* const* ptr = list->nod_arg;
for (gpre_nod* const* const end = ptr + list->nod_count; ptr < end; ptr++)
@ -1787,16 +1787,16 @@ static void cmp_plan(const gpre_nod* plan_expression, gpre_req* request)
continue;
}
// if we're here, it must be a nod_plan_item
// if we're here, it must be a nod_plan_item
request->add_byte(blr_retrieve);
/* stuff the relation--the relation id itself is redundant except
/* stuff the relation--the relation id itself is redundant except
when there is a need to differentiate the base tables of views */
CME_relation((gpre_ctx*) node->nod_arg[2], request);
// now stuff the access method for this stream
// now stuff the access method for this stream
const gpre_nod* arg = node->nod_arg[1];
switch (arg->nod_type)
@ -1829,17 +1829,17 @@ static void cmp_plan(const gpre_nod* plan_expression, gpre_req* request)
//____________________________________________________________
//
//
// Print out the correct blr for
// this datatype.
//
//
static void cmp_sdl_dtype( const gpre_fld* field, REF reference)
{
switch (field->fld_dtype)
{
case dtype_cstring:
// 3.2j has new, tagged blr intruction for cstring
// 3.2j has new, tagged blr intruction for cstring
if (gpreGlob.sw_know_interp)
{
@ -1855,7 +1855,7 @@ static void cmp_sdl_dtype( const gpre_fld* field, REF reference)
break;
case dtype_text:
// 3.2j has new, tagged blr intruction for text too
// 3.2j has new, tagged blr intruction for text too
if (gpreGlob.sw_know_interp)
{
@ -1871,7 +1871,7 @@ static void cmp_sdl_dtype( const gpre_fld* field, REF reference)
break;
case dtype_varying:
// 3.2j has new, tagged blr intruction for varying also
// 3.2j has new, tagged blr intruction for varying also
if (gpreGlob.sw_know_interp)
{
@ -1940,9 +1940,9 @@ static void cmp_sdl_dtype( const gpre_fld* field, REF reference)
//____________________________________________________________
//
//
// Compile a reference to a user defined function.
//
//
static void cmp_udf( GPRE_NOD node, gpre_req* request)
{
@ -1974,9 +1974,9 @@ static void cmp_udf( GPRE_NOD node, gpre_req* request)
//____________________________________________________________
//
//
// Process a random value expression.
//
//
static void cmp_value( const gpre_nod* node, gpre_req* request)
{
@ -2008,9 +2008,9 @@ static void cmp_value( const gpre_nod* node, gpre_req* request)
//____________________________________________________________
//
//
// Figure out a text length from a datatype and a length
//
//
static USHORT get_string_len( const gpre_fld* field)
{
@ -2028,17 +2028,17 @@ static USHORT get_string_len( const gpre_fld* field)
}
//____________________________________________________________
//
//
// Write to the sdl string, the do
// loop for a particular dimension.
//
//
static void stuff_sdl_dimension(const dim* dimension,
ref* reference, SSHORT dimension_count)
{
// In the future, when we support slices, new code to handle the
// user-defined slice ranges will be here.
// user-defined slice ranges will be here.
if (dimension->dim_lower == 1)
{
@ -2057,11 +2057,11 @@ static void stuff_sdl_dimension(const dim* dimension,
//____________________________________________________________
//
//
// Write the element information
// (including the subscripts) to
// the SDL string for the array.
//
//
static void stuff_sdl_element(ref* reference, const gpre_fld* field)
{
@ -2072,7 +2072,7 @@ static void stuff_sdl_element(ref* reference, const gpre_fld* field)
reference->add_byte(field->fld_array_info->ary_dimension_count);
// Fortran needs the array in column-major order
// Fortran needs the array in column-major order
if (gpreGlob.sw_language == lang_fortran)
{
@ -2095,10 +2095,10 @@ static void stuff_sdl_element(ref* reference, const gpre_fld* field)
//____________________________________________________________
//
//
// Write loop information to the SDL
// string for the array dimensions.
//
//
static void stuff_sdl_loops(ref* reference, const gpre_fld* field)
{
@ -2129,10 +2129,10 @@ static void stuff_sdl_loops(ref* reference, const gpre_fld* field)
//____________________________________________________________
//
//
// Write the number in the 'smallest'
// form possible to the SDL string.
//
//
static void stuff_sdl_number(const SLONG number, REF reference)
{
@ -2218,21 +2218,21 @@ static void get_dtype_of_case(const gpre_nod* node, gpre_fld* f)
// (dtype_text, dtype_cstring, dtype_varying, dtype_blob sub_type TEXT)
// !! Currently engine cannot convert string to BLOB therefor BLOB isn't allowed. !!
// - first character-set and collation are used as output descriptor.
// - if all types have datatype CHAR then output should be CHAR else
// - if all types have datatype CHAR then output should be CHAR else
// VARCHAR and with the maximum length used from the given list.
//
// If all of the datatypes are EXACT numeric then the output descriptor
// shall be EXACT numeric with the maximum scale and the maximum precision
//
// If all of the datatypes are EXACT numeric then the output descriptor
// shall be EXACT numeric with the maximum scale and the maximum precision
// used. (dtype_byte, dtype_short, dtype_long, dtype_int64)
//
//
// If any of the datatypes is APPROXIMATE numeric then each datatype in the
// list shall be numeric else a error is thrown and the output descriptor
// list shall be numeric else a error is thrown and the output descriptor
// shall be APPROXIMATE numeric. (dtype_real, dtype_double, dtype_d_float)
//
//
// If any of the datatypes is a datetime type then each datatype in the
// list shall be the same datetime type else a error is thrown.
// numeric. (dtype_sql_date, dtype_sql_time, dtype_timestamp)
//
//
// If any of the datatypes is a BLOB datatype then :
// - all types should be a BLOB else throw error.
// - all types should have the same sub_type else throw error.
@ -2274,7 +2274,7 @@ static void get_dtype_of_list(const gpre_nod* node, gpre_fld* f)
const gpre_fld& field = field_aux; // Trick to avoid more assignment mistakes.
// Initialize some values if this is the first time
if (firstarg)
if (firstarg)
{
max_scale = field.fld_scale;
max_length = max_dtype_length = field.fld_length;
@ -2404,7 +2404,7 @@ static void get_dtype_of_list(const gpre_nod* node, gpre_fld* f)
any_text_blob = true;
}
}
else
else
all_blob = false;
}
@ -2427,7 +2427,7 @@ static void get_dtype_of_list(const gpre_nod* node, gpre_fld* f)
f->fld_dtype = dtype_cstring;
else
f->fld_dtype = dtype_text;
f->fld_ttype = ttype;
f->fld_length = maxtextlength;
f->fld_scale = 0;

View File

@ -1,27 +1,27 @@
//____________________________________________________________
//
//
// PROGRAM: C preprocessor
// MODULE: cmp.cpp
// DESCRIPTION: Request compiler
//
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// TMN (Mike Nordell) 11.APR.2001 - Reduce compiler warnings
//
//
//
//____________________________________________________________
//
@ -84,11 +84,11 @@ static ULONG next_ident;
const int MAX_TPB = 4000;
//____________________________________________________________
//
//
// Check to make sure that generated blr string is not about to
// over the memory allocated for it. If so, allocate an extra
// couple of hundred bytes to be safe.
//
//
void CMP_check( gpre_req* request, SSHORT min_reqd)
{
@ -112,11 +112,11 @@ void CMP_check( gpre_req* request, SSHORT min_reqd)
//____________________________________________________________
//
//
// Compile a single request, but do not generate any text.
// Generate port blocks, assign parameter numbers, message
// numbers, and internal idents. Compute length of request.
//
//
void CMP_compile_request( gpre_req* request)
{
@ -135,7 +135,7 @@ void CMP_compile_request( gpre_req* request)
request->req_ident = CMP_next_ident();
// If this is an SQL blob cursor, compile the blob and get out fast.
// If this is an SQL blob cursor, compile the blob and get out fast.
if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create)) {
for (blb* blob = request->req_blobs; blob; blob = blob->blb_next)
@ -144,7 +144,7 @@ void CMP_compile_request( gpre_req* request)
}
// Before we get too far, make sure an eof field has been
// constructed. If not, do so now.
// constructed. If not, do so now.
ref* reference;
if (!eof_field) {
@ -162,7 +162,7 @@ void CMP_compile_request( gpre_req* request)
lit1 = MSC_unary(nod_literal, (GPRE_NOD) reference);
}
// Handle different request types differently
// Handle different request types differently
switch (request->req_type) {
case REQ_create_database:
@ -180,12 +180,12 @@ void CMP_compile_request( gpre_req* request)
cmp_procedure(request);
return;
}
// expand any incomplete references or values
// expand any incomplete references or values
expand_references(request->req_references);
expand_references(request->req_values);
// Initialize the blr string
// Initialize the blr string
request->req_blr = request->req_base = MSC_alloc(500);
request->req_length = 500;
@ -195,13 +195,13 @@ void CMP_compile_request( gpre_req* request)
request->add_byte(blr_version5);
// If there are values to be transmitted, make a port
// to hold them
// to hold them
if (request->req_values)
request->req_vport = make_port(request, request->req_values);
#ifdef SCROLLABLE_CURSORS
// If there is an asynchronous message to be sent, make a port for it
// If there is an asynchronous message to be sent, make a port for it
if (request->req_flags & REQ_sql_cursor &&
request->req_database->dbb_base_level >= 5)
@ -221,7 +221,7 @@ void CMP_compile_request( gpre_req* request)
#endif
// If this is a FOR type request, an eof field reference needs
// to be generated. Do it.
// to be generated. Do it.
if (request->req_type == REQ_for ||
request->req_type == REQ_cursor || request->req_type == REQ_any)
@ -238,7 +238,7 @@ void CMP_compile_request( gpre_req* request)
else
reference = request->req_references;
// Assume that a general port needs to be constructed.
// Assume that a general port needs to be constructed.
gpre_port* port;
if ((request->req_type != REQ_insert) && (request->req_type != REQ_store2)
@ -249,7 +249,7 @@ void CMP_compile_request( gpre_req* request)
// Loop thru actions looking for something interesting to do. Not
// all action types are "interesting", so don't worry about missing
// ones.
// ones.
upd* update;
for (act* action = request->req_actions; action; action = action->act_next)
@ -286,12 +286,12 @@ void CMP_compile_request( gpre_req* request)
cmp_blr(request);
request->add_byte(blr_eoc);
// Compute out final blr lengths
// Compute out final blr lengths
request->req_length = request->req_blr - request->req_base;
request->req_blr = request->req_base;
// Finally, assign identifiers to any blobs that may have been referenced
// Finally, assign identifiers to any blobs that may have been referenced
for (blb* blob = request->req_blobs; blob; blob = blob->blb_next)
cmp_blob(blob, false);
@ -299,12 +299,12 @@ void CMP_compile_request( gpre_req* request)
//____________________________________________________________
//
//
// Stuff field datatype info into request.
// Text fields are not remapped to process text type.
// This is used by the CAST & COLLATE operators to
// indicate cast datatypes.
//
//
void CMP_external_field( gpre_req* request, const gpre_fld* field)
{
@ -336,10 +336,10 @@ void CMP_external_field( gpre_req* request, const gpre_fld* field)
//____________________________________________________________
//
//
// Initialize (or re-initialize) for request compilation. This is
// called at most once per module.
//
//
void CMP_init(void)
{
@ -351,9 +351,9 @@ void CMP_init(void)
//____________________________________________________________
//
//
// Give out next identifier.
//
//
ULONG CMP_next_ident(void)
{
@ -362,9 +362,9 @@ ULONG CMP_next_ident(void)
//____________________________________________________________
//
//
// Stuff a symbol.
//
//
void CMP_stuff_symbol( gpre_req* request, const gpre_sym* symbol)
{
@ -376,17 +376,17 @@ void CMP_stuff_symbol( gpre_req* request, const gpre_sym* symbol)
//____________________________________________________________
//
//
// Take a transaction block with (potentially) a
// lot of relation lock blocks, and generate TPBs
//
//
// We'll always generate TPB's, and link them
// into the DBB for that database so they get
// generated. If there's no lock list, we generate
// a simple TPB for every database in the program.
// a simple TPB for every database in the program.
// If there is a lock list, we generate a more complex
// TPB for each database referenced.
//
//
void CMP_t_start( gpre_tra* trans)
{
@ -394,7 +394,7 @@ void CMP_t_start( gpre_tra* trans)
char tpb_buffer[MAX_TRA_OPTIONS + 1];
// fill out a standard tpb buffer ahead of time so we know
// how large it is
// how large it is
char* text = tpb_buffer;
*text++ = isc_tpb_version1;
@ -421,7 +421,7 @@ void CMP_t_start( gpre_tra* trans)
for (dbb* database = gpreGlob.isc_databases; database; database = database->dbb_next)
{
/*
/*
* figure out if this is a simple transaction or a reserving
* transaction. Allocate a TPB of the right size in either
* case.
@ -459,7 +459,7 @@ void CMP_t_start( gpre_tra* trans)
new_tpb->tpb_length = buff_len + tpb_len;
database->dbb_rrls = NULL;
}
else // this database isn't referenced
else // this database isn't referenced
continue;
/* link this into the TPB chains (gpre_tra and DBB) */
@ -471,7 +471,7 @@ void CMP_t_start( gpre_tra* trans)
trans->tra_tpb = new_tpb;
trans->tra_db_count++;
// fill in the standard TPB and concatenate the relation names
// fill in the standard TPB and concatenate the relation names
new_tpb->tpb_ident = CMP_next_ident();
@ -485,9 +485,9 @@ void CMP_t_start( gpre_tra* trans)
//____________________________________________________________
//
//
// Generate blr tree for free standing ANY expression.
//
//
static void cmp_any( gpre_req* request)
{
@ -502,7 +502,7 @@ static void cmp_any( gpre_req* request)
gpre_nod* value = MSC_unary(nod_value, (GPRE_NOD) port->por_references);
// Make a send to signal end of file
// Make a send to signal end of file
request->add_byte(blr_assignment);
CME_expr(lit1, request);
@ -526,9 +526,9 @@ static void cmp_any( gpre_req* request)
//____________________________________________________________
//
//
// Compile a build assignment statement.
//
//
static void cmp_assignment( GPRE_NOD node, gpre_req* request)
{
@ -540,9 +540,9 @@ static void cmp_assignment( GPRE_NOD node, gpre_req* request)
//____________________________________________________________
//
//
// Compile a blob parameter block, if required.
//
//
static void cmp_blob(blb* blob,
bool sql_flag)
@ -588,7 +588,7 @@ static void cmp_blob(blb* blob,
}
if (blob->blb_from_charset) {
// create bpb instruction for source character set
// create bpb instruction for source character set
*p++ = isc_bpb_source_interp;
*p++ = 2;
@ -598,7 +598,7 @@ static void cmp_blob(blb* blob,
if (blob->blb_to_charset) {
// create bpb instruction for target character set
// create bpb instruction for target character set
*p++ = isc_bpb_target_interp;
*p++ = 2;
@ -611,21 +611,21 @@ static void cmp_blob(blb* blob,
//____________________________________________________________
//
//
// Build a request tree for a request.
//
//
static void cmp_blr( gpre_req* request)
{
request->add_byte(blr_begin);
// build message definition for each port
// build message definition for each port
gpre_port* port;
for (port = request->req_ports; port; port = port->por_next)
cmp_port(port, request);
// See if there is a receive to be built
// See if there is a receive to be built
if ((request->req_type == REQ_store) || (request->req_type == REQ_store2))
port = request->req_primary;
@ -635,7 +635,7 @@ static void cmp_blr( gpre_req* request)
if (port)
make_receive(port, request);
// Compile up request
// Compile up request
switch (request->req_type) {
case REQ_cursor:
@ -670,9 +670,9 @@ static void cmp_blr( gpre_req* request)
//____________________________________________________________
//
//
// Generate blr for ERASE action.
//
//
static void cmp_erase( act* action, gpre_req* request)
{
@ -689,11 +689,11 @@ static void cmp_erase( act* action, gpre_req* request)
//____________________________________________________________
//
//
// Go over an SQL fetch list and expand
// references to indicator variables.
// Not tough.
//
//
static void cmp_fetch( act* action)
{
@ -717,9 +717,9 @@ static void cmp_fetch( act* action)
//____________________________________________________________
//
//
// Stuff field datatype info into request.
//
//
static void cmp_field( gpre_req* request, const gpre_fld* field,
const ref* reference)
@ -741,7 +741,7 @@ static void cmp_field( gpre_req* request, const gpre_fld* field,
request->add_word(field->fld_length);
}
else {
// 3.2j has new, tagged blr instruction for cstring
// 3.2j has new, tagged blr instruction for cstring
request->add_byte(blr_cstring2);
request->add_word(field->fld_ttype);
@ -755,7 +755,7 @@ static void cmp_field( gpre_req* request, const gpre_fld* field,
request->add_word(field->fld_length);
}
else {
// 3.2j has new, tagged blr instruction for text too
// 3.2j has new, tagged blr instruction for text too
request->add_byte(blr_text2);
request->add_word(field->fld_ttype);
@ -769,7 +769,7 @@ static void cmp_field( gpre_req* request, const gpre_fld* field,
request->add_word(field->fld_length);
}
else {
// 3.2j has new, tagged blr instruction for varying also
// 3.2j has new, tagged blr instruction for varying also
request->add_byte(blr_varying2);
request->add_word(field->fld_ttype);
@ -834,9 +834,9 @@ static void cmp_field( gpre_req* request, const gpre_fld* field,
//____________________________________________________________
//
//
// Generate blr tree for for statement
//
//
static void cmp_for( gpre_req* request)
{
@ -863,7 +863,7 @@ static void cmp_for( gpre_req* request)
CME_rse(request->req_rse, request);
// Loop thru actions looking for primary port. While we're at it,
// count the number of update actions.
// count the number of update actions.
bool updates = false;
@ -877,11 +877,11 @@ static void cmp_for( gpre_req* request)
break;
}
}
if (updates)
request->add_byte(blr_begin);
// Build the primary send statement
// Build the primary send statement
gpre_port* port = request->req_primary;
make_send(port, request);
@ -916,7 +916,7 @@ static void cmp_for( gpre_req* request)
}
request->add_byte(blr_end);
// If there are any actions, handle them here
// If there are any actions, handle them here
if (updates) {
request->add_byte(blr_label);
@ -943,7 +943,7 @@ static void cmp_for( gpre_req* request)
request->add_byte(blr_end);
}
// Make a send to signal end of file
// Make a send to signal end of file
make_send(port, request);
request->add_byte(blr_assignment);
@ -956,9 +956,9 @@ static void cmp_for( gpre_req* request)
//____________________________________________________________
//
//
// Compile a mass looping update statement.
//
//
static void cmp_loop( gpre_req* request)
{
@ -972,7 +972,7 @@ static void cmp_loop( gpre_req* request)
for (ref* reference = primary->por_references; reference;
reference = reference->ref_next)
{
if (reference->ref_field == count_field)
if (reference->ref_field == count_field)
counter->nod_arg[0] = (GPRE_NOD) reference;
}
@ -1041,9 +1041,9 @@ static void cmp_loop( gpre_req* request)
//____________________________________________________________
//
//
// Generate a receive and modify tree for a modify action.
//
//
static void cmp_modify( act* action, gpre_req* request)
{
@ -1058,7 +1058,7 @@ static void cmp_modify( act* action, gpre_req* request)
request->add_byte(update->upd_source->ctx_internal);
request->add_byte(update->upd_update->ctx_internal);
// count the references and build an assignment block
// count the references and build an assignment block
gpre_nod* list = update->upd_assignments;
request->add_byte(blr_begin);
@ -1078,9 +1078,9 @@ static void cmp_modify( act* action, gpre_req* request)
//____________________________________________________________
//
//
// Build a request tree for a request.
//
//
static void cmp_port( gpre_port* port, gpre_req* request)
{
@ -1100,9 +1100,9 @@ static void cmp_port( gpre_port* port, gpre_req* request)
//____________________________________________________________
//
// Compile a EXECUTE PROCEDURE request.
//
//
// Compile a EXECUTE PROCEDURE request.
//
static void cmp_procedure( gpre_req* request)
{
@ -1111,7 +1111,7 @@ static void cmp_procedure( gpre_req* request)
// Remember the order of the references. The exec_proc blr verb
// requires parameters to be in parameter order which may be changed
// when there references are expanded.
// when there references are expanded.
gpre_lls* outputs = NULL;
ref* reference = request->req_references;
@ -1122,7 +1122,7 @@ static void cmp_procedure( gpre_req* request)
}
}
// Expand any incomplete references or values.
// Expand any incomplete references or values.
expand_references(request->req_values);
expand_references(request->req_references);
@ -1144,7 +1144,7 @@ static void cmp_procedure( gpre_req* request)
request->req_primary = make_port(request, request->req_references);
request->req_references = request->req_primary->por_references;
// build message definition for each port
// build message definition for each port
for (gpre_port* port = request->req_ports; port; port = port->por_next)
cmp_port(port, request);
@ -1196,10 +1196,10 @@ static void cmp_procedure( gpre_req* request)
//____________________________________________________________
//
//
// Generate parameter buffer for READY with
// buffercount.
//
//
static void cmp_ready( gpre_req* request)
{
@ -1241,10 +1241,10 @@ static void cmp_ready( gpre_req* request)
request->add_byte(4);
request->add_long(db->dbb_users);
}
const TEXT* p;
SSHORT l;
if (db->dbb_c_user && !db->dbb_r_user) {
request->add_byte(isc_dpb_user_name);
l = strlen(db->dbb_c_user);
@ -1273,7 +1273,7 @@ static void cmp_ready( gpre_req* request)
}
if (db->dbb_c_lc_messages && !db->dbb_r_lc_messages) {
// Language must be an ASCII string
// Language must be an ASCII string
request->add_byte(isc_dpb_lc_messages);
l = strlen(db->dbb_c_lc_messages);
request->add_byte(l);
@ -1283,7 +1283,7 @@ static void cmp_ready( gpre_req* request)
}
if (db->dbb_c_lc_ctype && !db->dbb_r_lc_ctype) {
// Character Format must be an ASCII string
// Character Format must be an ASCII string
request->add_byte(isc_dpb_lc_ctype);
l = strlen(db->dbb_c_lc_ctype);
request->add_byte(l);
@ -1301,10 +1301,10 @@ static void cmp_ready( gpre_req* request)
//____________________________________________________________
//
//
// Build in a fudge to bias the language specific subscript to the
// declared array subscript [i.e. C subscripts are zero based].
//
//
static void cmp_sdl_fudge( gpre_req* request, SLONG lower_bound)
{
@ -1329,11 +1329,11 @@ static void cmp_sdl_fudge( gpre_req* request, SLONG lower_bound)
}
//____________________________________________________________
//
//
// Build an SDL loop for GET_SLICE/PUT_SLICE unless the upper and
// lower bounds are constant. Return true if a loop has been built,
// otherwise false.
//
//
static bool cmp_sdl_loop(gpre_req* request,
USHORT index,
@ -1361,10 +1361,10 @@ static bool cmp_sdl_loop(gpre_req* request,
//____________________________________________________________
//
//
// Write the number in the 'smallest'
// form possible to the SDL string.
//
//
static void cmp_sdl_number( gpre_req* request, SLONG number)
{
@ -1385,10 +1385,10 @@ static void cmp_sdl_number( gpre_req* request, SLONG number)
//____________________________________________________________
//
//
// Build an SDL loop for GET_SLICE/PUT_SLICE unless the upper and
// lower bounds are constant.
//
//
static void cmp_sdl_subscript(gpre_req* request, USHORT index, const slc* slice,
const ary* array)
@ -1407,9 +1407,9 @@ static void cmp_sdl_subscript(gpre_req* request, USHORT index, const slc* slice,
//____________________________________________________________
//
//
// Stuff a slice description language value.
//
//
static void cmp_sdl_value( gpre_req* request, const gpre_nod* node)
{
@ -1432,9 +1432,9 @@ static void cmp_sdl_value( gpre_req* request, const gpre_nod* node)
//____________________________________________________________
//
//
// generate blr for set generator
//
//
static void cmp_set_generator( gpre_req* request)
{
@ -1467,8 +1467,8 @@ static void cmp_set_generator( gpre_req* request)
//____________________________________________________________
//
//
//
//
static void cmp_slice( gpre_req* request)
{
@ -1478,7 +1478,7 @@ static void cmp_slice( gpre_req* request)
gpre_fld* element = field->fld_array;
const ary* array = field->fld_array_info;
// Process variable references
// Process variable references
for (ref* reference = request->req_values; reference;
reference = reference->ref_next)
@ -1507,7 +1507,7 @@ static void cmp_slice( gpre_req* request)
for (bool* p = loop_flags; n < slice->slc_dimensions; n++, p++)
*p = cmp_sdl_loop(request, n, slice, array);
} // end scope block
request->add_byte(isc_sdl_element);
request->add_byte(1);
request->add_byte(isc_sdl_scalar);
@ -1529,9 +1529,9 @@ static void cmp_slice( gpre_req* request)
//____________________________________________________________
//
//
// Generate blr for a store request.
//
//
static void cmp_store( gpre_req* request)
{
@ -1544,7 +1544,7 @@ static void cmp_store( gpre_req* request)
CME_relation(request->req_contexts, request);
// Make an assignment list
// Make an assignment list
gpre_nod* list = request->req_node;
request->add_byte(blr_begin);
@ -1559,7 +1559,7 @@ static void cmp_store( gpre_req* request)
request->add_byte(blr_end);
if (request->req_type == REQ_store2) {
// whip through actions to find return list
// whip through actions to find return list
act* action;
for (action = request->req_actions;; action = action->act_next) {
@ -1585,13 +1585,13 @@ static void cmp_store( gpre_req* request)
//____________________________________________________________
//
//
// During the parsing of an SQL statement
// we may have run into an indicator variable.
// If so, all we've got now is its name, and
// we really ought to build a full reference
// block for it before we forget.
//
//
static void expand_references( REF reference)
{
@ -1609,10 +1609,10 @@ static void expand_references( REF reference)
//____________________________________________________________
//
//
// Make up a port block and process a linked list
// of field references.
//
//
static gpre_port* make_port( gpre_req* request, REF reference)
{
@ -1622,8 +1622,8 @@ static gpre_port* make_port( gpre_req* request, REF reference)
port->por_next = request->req_ports;
request->req_ports = port;
// Hmmm -- no references. Not going to fly.
// Make up a dummy reference.
// Hmmm -- no references. Not going to fly.
// Make up a dummy reference.
if (!reference) {
reference = (REF) MSC_alloc(REF_LEN);
@ -1684,9 +1684,9 @@ static gpre_port* make_port( gpre_req* request, REF reference)
//____________________________________________________________
//
//
// Make a receive node for a given port.
//
//
static void make_receive( gpre_port* port, gpre_req* request)
{
@ -1696,9 +1696,9 @@ static void make_receive( gpre_port* port, gpre_req* request)
//____________________________________________________________
//
//
// Make a receive node for a given port.
//
//
static void make_send( gpre_port* port, gpre_req* request)
{
@ -1708,10 +1708,10 @@ static void make_send( gpre_port* port, gpre_req* request)
//____________________________________________________________
//
//
// where a duplicate reference list is used
// to build the port, fix request_references
//
//
static void update_references( REF references)
{

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +1,30 @@
//____________________________________________________________
//
//
// PROGRAM: BLR Pretty Printer
// MODULE: dyntable.cpp
// DESCRIPTION: Dynamic DDL to internal conversion table generator
//
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
//
//
//
//____________________________________________________________
//
// $Id: dyntable.cpp,v 1.10 2005-05-27 22:42:14 asfernandes Exp $
// $Id: dyntable.cpp,v 1.11 2008-12-05 01:19:48 asfernandes Exp $
//
// CVC: Strange, this file is only referenced in a MacOsX project and gpre
// works directly with dyntable.h.
@ -117,9 +117,9 @@ struct dyn {
//____________________________________________________________
//
//
// Spit out a conversion table.
//
//
int main()
{

View File

@ -1,27 +1,27 @@
//____________________________________________________________
//
//
// PROGRAM: C preprocessor
// MODULE: exp.cpp
// DESCRIPTION: Expression parser
//
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// TMN (Mike Nordell) 11.APR.2001 - Reduce compiler warnings
//
//
//
//____________________________________________________________
//
@ -112,9 +112,9 @@ static const dtypes data_types[] = {
//____________________________________________________________
//
//
// Parse array subscript.
//
//
GPRE_NOD EXP_array(gpre_req* request, gpre_fld* field, bool subscript_flag, bool sql_flag)
{
@ -123,9 +123,9 @@ GPRE_NOD EXP_array(gpre_req* request, gpre_fld* field, bool subscript_flag, bool
//____________________________________________________________
//
//
// Parse a datatype cast (sans leading period).
//
//
gpre_fld* EXP_cast(gpre_fld* field)
{
@ -225,7 +225,7 @@ gpre_ctx* EXP_context(gpre_req* request, gpre_sym* initial_symbol)
// block. Then check for the keyword IN. If it's
// missing, either complain or punt, depending on the
// error flag. In either case, be sure to get rid of
// the symbol. If things look kosher, continue.
// the symbol. If things look kosher, continue.
gpre_sym* symbol = initial_symbol;
if (!symbol) {
@ -249,11 +249,11 @@ gpre_ctx* EXP_context(gpre_req* request, gpre_sym* initial_symbol)
//____________________________________________________________
//
//
// Parse a qualified field clause. If recognized,
// return both the field block (as value) and the
// context block (by reference).
//
//
gpre_fld* EXP_field(gpre_ctx** rcontext)
{
@ -290,9 +290,9 @@ gpre_fld* EXP_field(gpre_ctx** rcontext)
//____________________________________________________________
//
//
// Eat a left parenthesis, complain if not there.
//
//
void EXP_left_paren(const TEXT* string)
{
@ -302,9 +302,9 @@ void EXP_left_paren(const TEXT* string)
//____________________________________________________________
//
//
// Parse a native literal constant value.
//
//
GPRE_NOD EXP_literal(void)
{
@ -361,7 +361,7 @@ GPRE_NOD EXP_literal(void)
((INTLSYM) (symbol->sym_object))->intlsym_ttype;
}
else if (gpreGlob.sw_language == lang_internal) {
// literals referenced in an Internal request are always correct charset
// literals referenced in an Internal request are always correct charset
reference->ref_flags |= REF_ttype;
reference->ref_ttype = ttype_metadata;
}
@ -371,10 +371,10 @@ GPRE_NOD EXP_literal(void)
//____________________________________________________________
//
//
// Parse and convert to binary a numeric token.
// Restrict to LONG range.
//
//
SINT64 EXP_SINT64_ordinal(bool advance_flag)
{
@ -386,7 +386,7 @@ SINT64 EXP_SINT64_ordinal(bool advance_flag)
const char format[8] = "%"SQUADFORMAT;
SINT64 n;
sscanf(gpreGlob.token_global.tok_string, format, &n);
char buffer[64];
sprintf(buffer, format, n);
if (strcmp(buffer, gpreGlob.token_global.tok_string) != 0)
@ -399,10 +399,10 @@ SINT64 EXP_SINT64_ordinal(bool advance_flag)
}
//____________________________________________________________
//
//
// Parse and convert to binary a numeric token.
// Restrict to LONG range.
//
//
SLONG EXP_SLONG_ordinal(bool advance_flag)
{
@ -425,10 +425,10 @@ SLONG EXP_SLONG_ordinal(bool advance_flag)
//____________________________________________________________
//
//
// Parse and convert to binary a numeric token.
// A SSHORT is desired.
//
//
SSHORT EXP_SSHORT_ordinal(bool advance_flag)
{
@ -451,10 +451,10 @@ SSHORT EXP_SSHORT_ordinal(bool advance_flag)
//____________________________________________________________
//
//
// Parse and convert to binary a numeric token.
// Restrict to LONG range.
//
//
ULONG EXP_ULONG_ordinal(bool advance_flag)
{
@ -475,9 +475,9 @@ ULONG EXP_ULONG_ordinal(bool advance_flag)
//____________________________________________________________
//
//
// Parse and convert to binary a numeric token.
//
//
USHORT EXP_USHORT_ordinal(bool advance_flag)
{
@ -496,10 +496,10 @@ USHORT EXP_USHORT_ordinal(bool advance_flag)
//____________________________________________________________
//
//
// Parse and convert to binary a numeric token.
// Which must be non-zero.
//
//
USHORT EXP_pos_USHORT_ordinal(bool advance_flag)
{
@ -512,10 +512,10 @@ USHORT EXP_pos_USHORT_ordinal(bool advance_flag)
//____________________________________________________________
//
//
// We have a free reference to array. Make sure the whole damn thing
// gets sucked up.
//
//
void EXP_post_array( REF reference)
{
@ -546,12 +546,12 @@ void EXP_post_array( REF reference)
//____________________________________________________________
//
//
// Post a field reference to a request. This
// can be called from either par_variable (free
// standing field reference) or EXP\par_value
// (cross request field reference).
//
//
REF EXP_post_field(gpre_fld* field, gpre_ctx* context, bool null_flag)
{
@ -559,7 +559,7 @@ REF EXP_post_field(gpre_fld* field, gpre_ctx* context, bool null_flag)
gpre_req* request = context->ctx_request;
// If the reference is already posted, return the reference
// If the reference is already posted, return the reference
ref* reference;
for (reference = request->req_references; reference;
@ -594,7 +594,7 @@ REF EXP_post_field(gpre_fld* field, gpre_ctx* context, bool null_flag)
}
}
// This is first occurrence of field, make a new reference
// This is first occurrence of field, make a new reference
reference = MSC_reference(&request->req_references);
reference->ref_context = context;
@ -609,10 +609,10 @@ REF EXP_post_field(gpre_fld* field, gpre_ctx* context, bool null_flag)
//____________________________________________________________
//
//
// Match a trailing parenthesis. If isn't one, generate an error
// and return FALSE.
//
//
bool EXP_match_paren(void)
{
@ -625,9 +625,9 @@ bool EXP_match_paren(void)
//____________________________________________________________
//
//
// Parse and look up a qualified relation name.
//
//
gpre_rel* EXP_relation(void)
{
@ -637,7 +637,7 @@ gpre_rel* EXP_relation(void)
// The current token is (i.e. should be) either a relation
// name or a database name. If it's a database name, search
// it for the relation name. If it's an unqualified relation
// name, search all databases for the name
// name, search all databases for the name
gpre_rel* relation = NULL;
@ -677,15 +677,15 @@ gpre_rel* EXP_relation(void)
//____________________________________________________________
//
//
// Parse a record selection expression. If there is an
// error, return NULL. This is slightly complicated by
// the fact that PASCAL and FORTRAN have a native FOR
// statement, and ADA has a FOR <variable> IN statement.
//
//
// If an initial symbol is given, the caller has already
// parsed the <contect> IN part of the expression.
//
//
gpre_rse* EXP_rse(gpre_req* request, gpre_sym* initial_symbol)
{
@ -698,7 +698,7 @@ gpre_rse* EXP_rse(gpre_req* request, gpre_sym* initial_symbol)
first = par_value(request, global_count_field);
}
// parse first context clause
// parse first context clause
if (initial_symbol && gpreGlob.sw_language == lang_ada && !check_relation())
return NULL;
@ -706,7 +706,7 @@ gpre_rse* EXP_rse(gpre_req* request, gpre_sym* initial_symbol)
gpre_ctx* context = EXP_context(request, initial_symbol);
SSHORT count = 1;
// parse subsequent context clauses if this is a join
// parse subsequent context clauses if this is a join
gpre_nod* boolean = NULL;
while (MSC_match(KW_CROSS)) {
context = EXP_context(request, 0);
@ -715,11 +715,11 @@ gpre_rse* EXP_rse(gpre_req* request, gpre_sym* initial_symbol)
boolean = make_and(boolean, par_over(context));
}
// bug_3380 - could have an "over" clause without a "cross" clause
// bug_3380 - could have an "over" clause without a "cross" clause
if (MSC_match(KW_OVER))
boolean = make_and(boolean, par_over(context));
// build rse node
// build rse node
gpre_rse* rec_expr = (gpre_rse*) MSC_alloc(RSE_LEN(count));
rec_expr->rse_count = count;
@ -733,14 +733,14 @@ gpre_rse* EXP_rse(gpre_req* request, gpre_sym* initial_symbol)
}
// parse boolean, if any. If there is an error, ignore the
// boolean, but keep the rse
// boolean, but keep the rse
if (MSC_match(KW_WITH))
boolean = make_and(boolean, par_boolean(request));
rec_expr->rse_boolean = boolean;
// Parse SORT clause, if any.
// Parse SORT clause, if any.
// CVC: It's not clear whether this var should be initialized at the same
// level than "direction".
@ -793,7 +793,7 @@ gpre_rse* EXP_rse(gpre_req* request, gpre_sym* initial_symbol)
}
}
// Parse REDUCED clause, if any.
// Parse REDUCED clause, if any.
else if (MSC_match(KW_REDUCED)) {
MSC_match(KW_TO);
@ -822,10 +822,10 @@ gpre_rse* EXP_rse(gpre_req* request, gpre_sym* initial_symbol)
//____________________________________________________________
//
//
// Remove any context variables from hash table for a record
// selection expression.
//
//
void EXP_rse_cleanup( gpre_rse* rs)
{
@ -838,12 +838,12 @@ void EXP_rse_cleanup( gpre_rse* rs)
if ((*context)->ctx_symbol)
HSH_remove((*context)->ctx_symbol);
// If this is an aggregate, clean up the underlying rse
// If this is an aggregate, clean up the underlying rse
if (rs->rse_aggregate)
EXP_rse_cleanup(rs->rse_aggregate);
// If this is a union, clean up each of the primitive rse's
// If this is a union, clean up each of the primitive rse's
gpre_nod* node = rs->rse_union;
if (node) {
@ -854,16 +854,16 @@ void EXP_rse_cleanup( gpre_rse* rs)
//____________________________________________________________
//
//
// Parse a subscript value. This is called by PAR\par_slice.
//
//
GPRE_NOD EXP_subscript(gpre_req* request)
{
ref* reference = (REF) MSC_alloc(REF_LEN);
gpre_nod* node = MSC_unary(nod_value, (GPRE_NOD) reference);
// Special case literals
// Special case literals
if (gpreGlob.token_global.tok_type == tok_number) {
node->nod_type = nod_literal;
@ -886,16 +886,16 @@ GPRE_NOD EXP_subscript(gpre_req* request)
//____________________________________________________________
//
//
// Check current token for either a relation or database name.
//
//
static bool check_relation(void)
{
// The current token is (i.e. should be) either a relation
// name or a database name. If it's a database name, search
// it for the relation name. If it's an unqualified relation
// name, search all databases for the name
// name, search all databases for the name
gpre_sym* symbol = gpreGlob.token_global.tok_symbol;
if (symbol && symbol->sym_type == SYM_database)
@ -911,11 +911,11 @@ static bool check_relation(void)
//____________________________________________________________
//
//
// Check to see if the current token is a field name corresponding
// to a given context. If so, return a field block (with reference
// block) for field.
//
//
static GPRE_NOD lookup_field(gpre_ctx* context)
{
@ -933,11 +933,11 @@ static GPRE_NOD lookup_field(gpre_ctx* context)
//____________________________________________________________
//
//
// Combine two (potention) conjuncts into a single, valid
// boolean. Either or both on the conjunctions may be NULL.
// If both are null, return null.
//
//
static GPRE_NOD make_and( GPRE_NOD node1, GPRE_NOD node2)
{
@ -952,9 +952,9 @@ static GPRE_NOD make_and( GPRE_NOD node1, GPRE_NOD node2)
//____________________________________________________________
//
//
// Make a generic variable length node from a stack.
//
//
static GPRE_NOD make_list( gpre_lls* stack)
{
@ -972,13 +972,13 @@ static GPRE_NOD make_list( gpre_lls* stack)
//____________________________________________________________
//
//
// "Normalize" the array index so that
// the index used in the rse refers to
// the same relative position in the
// dimension in the database as it is
// in the user's program.
//
//
static GPRE_NOD normalize_index( dim* dimension, GPRE_NOD user_index, USHORT array_base)
{
@ -1021,9 +1021,9 @@ static GPRE_NOD normalize_index( dim* dimension, GPRE_NOD user_index, USHORT arr
//____________________________________________________________
//
//
// Parse a boolean AND.
//
//
static GPRE_NOD par_and( gpre_req* request)
{
@ -1037,11 +1037,11 @@ static GPRE_NOD par_and( gpre_req* request)
//____________________________________________________________
//
//
// Parse a array element reference
// (array name and subscript list)
// in an gpre_rse.
//
//
static GPRE_NOD par_array(gpre_req* request,
gpre_fld* field, bool subscript_flag, bool sql_flag)
@ -1071,7 +1071,7 @@ static GPRE_NOD par_array(gpre_req* request,
global_subscript_field = MET_make_field("gds_array_subscript", dtype_long,
4, false);
// Parse a commalist of subscripts and build a tree of index nodes
// Parse a commalist of subscripts and build a tree of index nodes
int i = 1;
for (dim* dimension = field->fld_array_info->ary_dimension;
@ -1095,7 +1095,7 @@ static GPRE_NOD par_array(gpre_req* request,
case lang_c:
case lang_cxx:
case lang_internal:
index_node->nod_arg[0] = normalize_index(dimension,
index_node->nod_arg[0] = normalize_index(dimension,
index_node->nod_arg[0],
ZERO_BASED);
break;
@ -1107,9 +1107,9 @@ static GPRE_NOD par_array(gpre_req* request,
break;
}
// Error checking of constants being out of range will be here in the future.
// Error checking of constants being out of range will be here in the future.
// Good ole Fortran's column major order needs to be accomodated.
// Good ole Fortran's column major order needs to be accomodated.
if (gpreGlob.sw_language == lang_fortran)
array_node->nod_arg[fortran_adjustment - i] = index_node;
@ -1120,7 +1120,7 @@ static GPRE_NOD par_array(gpre_req* request,
CPR_s_error("Adequate number of subscripts for this array reference.");
}
// Match the parenthesis or bracket
// Match the parenthesis or bracket
if (paren && !MSC_match(KW_RIGHT_PAREN))
CPR_s_error("Missing parenthesis for array reference.");
@ -1133,10 +1133,10 @@ static GPRE_NOD par_array(gpre_req* request,
//____________________________________________________________
//
//
// Parse a boolean expression. Actually, just parse
// an OR node or anything of lower precedence.
//
//
static GPRE_NOD par_boolean( gpre_req* request)
{
@ -1150,16 +1150,16 @@ static GPRE_NOD par_boolean( gpre_req* request)
//____________________________________________________________
//
//
// Parse a field reference. Anything else is an error.
//
//
static GPRE_NOD par_field( gpre_req* request)
{
const gpre_sym* symbol = gpreGlob.token_global.tok_symbol;
if (!symbol)
CPR_s_error("qualified field reference");
bool upcase_flag = false;
gpre_nod* prefix_node = 0;
if (MSC_match(KW_UPPERCASE)) {
@ -1190,7 +1190,7 @@ static GPRE_NOD par_field( gpre_req* request)
// There is a legit field reference. If the reference is
// to a field in this request, make up a reference block
// and a field node, and return.
// and a field node, and return.
if (!field->fld_array_info)
node = MSC_node(nod_field, 1);
@ -1234,10 +1234,10 @@ static GPRE_NOD par_field( gpre_req* request)
//____________________________________________________________
//
//
// Parse a value expression. In specific, handle the lowest
// precedence operator plus/minus.
//
//
static GPRE_NOD par_multiply( gpre_req* request, gpre_fld* field)
{
@ -1259,15 +1259,15 @@ static GPRE_NOD par_multiply( gpre_req* request, gpre_fld* field)
//____________________________________________________________
//
//
// Parse a native C value.
//
//
static GPRE_NOD par_native_value( gpre_req* request, gpre_fld* field)
{
TEXT s[64];
// Special case literals
// Special case literals
if (gpreGlob.token_global.tok_type == tok_number || gpreGlob.token_global.tok_type == tok_sglquoted
|| (gpreGlob.token_global.tok_type == tok_dblquoted && gpreGlob.sw_sql_dialect == 1))
@ -1281,7 +1281,7 @@ static GPRE_NOD par_native_value( gpre_req* request, gpre_fld* field)
// Handle general native value references. Since these values will need
// to be exported to the database system, make sure there is a reference
// field.
// field.
reference->ref_value = PAR_native_value(false, false);
@ -1299,9 +1299,9 @@ static GPRE_NOD par_native_value( gpre_req* request, gpre_fld* field)
//____________________________________________________________
//
//
// Parse either a boolean NOT or a boolean parenthetical.
//
//
static GPRE_NOD par_not( gpre_req* request)
{
@ -1323,9 +1323,9 @@ static GPRE_NOD par_not( gpre_req* request)
//____________________________________________________________
//
//
// Parse the substance of an OVER clause (but not the leading keyword).
//
//
static GPRE_NOD par_over( gpre_ctx* context)
{
@ -1360,10 +1360,10 @@ static GPRE_NOD par_over( gpre_ctx* context)
//____________________________________________________________
//
//
// Parse a value expression. In specific, handle the lowest
// precedence operator plus/minus.
//
//
static GPRE_NOD par_primitive_value( gpre_req* request, gpre_fld* field)
{
@ -1398,7 +1398,7 @@ static GPRE_NOD par_primitive_value( gpre_req* request, gpre_fld* field)
return node;
}
// Check for user defined functions
// Check for user defined functions
gpre_nod* node = par_udf(request, UDF_value, field);
if (node)
@ -1413,9 +1413,9 @@ static GPRE_NOD par_primitive_value( gpre_req* request, gpre_fld* field)
//____________________________________________________________
//
//
// Parse a relational expression.
//
//
static GPRE_NOD par_relational( gpre_req* request)
{
@ -1436,7 +1436,7 @@ static GPRE_NOD par_relational( gpre_req* request)
}
// That's right, three pointer dereferences to get to the reference
// structure if there's a UDF. V3 bug#531. MaryAnn 12/4/89
// structure if there's a UDF. V3 bug#531. MaryAnn 12/4/89
gpre_nod* expr1 = par_udf(request, UDF_value, 0);
ref* reference;
@ -1449,7 +1449,7 @@ static GPRE_NOD par_relational( gpre_req* request)
gpre_fld* field = reference->ref_field;
// Check for any of the binary guys
// Check for any of the binary guys
const bool negation = MSC_match(KW_NOT);
@ -1517,18 +1517,18 @@ static GPRE_NOD par_relational( gpre_req* request)
//____________________________________________________________
//
//
// Parse a user defined function. If the current token isn't one,
// return NULL. Otherwise try to parse one. If things go badly,
// complain bitterly.
//
//
static GPRE_NOD par_udf( gpre_req* request, USHORT type, gpre_fld* field)
{
if (!request)
return NULL;
// Check for user defined functions
// Check for user defined functions
udf* new_udf;
for (gpre_sym* symbol = gpreGlob.token_global.tok_symbol; symbol; symbol = symbol->sym_homonym)
@ -1558,10 +1558,10 @@ static GPRE_NOD par_udf( gpre_req* request, USHORT type, gpre_fld* field)
//____________________________________________________________
//
//
// Parse a value expression. In specific, handle the lowest
// precedence operator plus/minus.
//
//
static GPRE_NOD par_value( gpre_req* request, gpre_fld* field)
{

View File

@ -1539,7 +1539,7 @@ EXPORT RM_ENTRY(rmc_ftoc)
*(float *)arg_vector[-1].a_address = arg;
else
*(double *)arg_vector[-1].a_address = arg;
return (0);
}
@ -1552,7 +1552,7 @@ EXPORT RM_ENTRY(rmc_stoc)
const int dlen = arg_vector[-1].a_length;
const char* src = (char*) arg_vector[0].a_address;
const int slen = arg_vector[0].a_length;
int i = slen - 1;
while (src[i] == ' ' && i >= 0)
--i;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +1,28 @@
/*
* tab=4
*____________________________________________________________
*
*
* PROGRAM: C preprocessor
* MODULE: gpre_meta_boot.cpp
* DESCRIPTION: Meta data interface to system
*
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy
* of the License at http://www.Inprise.com/IPL.html
*
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
*
* The Original Code was created by Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
*
*
*____________________________________________________________
*
@ -63,10 +63,10 @@ static int upcase(const TEXT*, TEXT* const);
#endif
/*____________________________________________________________
*
*
* Lookup a field by name in a context.
* If found, return field block. If not, return NULL.
*/
*/
gpre_fld* MET_context_field( gpre_ctx* context, const char* string)
{
@ -102,16 +102,16 @@ gpre_fld* MET_context_field( gpre_ctx* context, const char* string)
/*____________________________________________________________
*
*
* Initialize meta data access to database. If the
* database can't be opened, return FALSE.
*/
*/
bool MET_database(DBB db,
bool print_version)
{
/*
** Each info item requested will return
/*
** Each info item requested will return
**
** 1 byte for the info item tag
** 2 bytes for the length of the information that follows
@ -127,10 +127,10 @@ bool MET_database(DBB db,
/*____________________________________________________________
*
*
* Lookup a domain by name.
* Initialize the size of the field.
*/
*/
bool MET_domain_lookup(gpre_req* request,
gpre_fld* field,
@ -172,9 +172,9 @@ bool MET_domain_lookup(gpre_req* request,
/*____________________________________________________________
*
*
* Gets the default value for a domain of an existing table
*/
*/
bool MET_get_domain_default(DBB db,
const TEXT* domain_name,
@ -187,16 +187,16 @@ bool MET_get_domain_default(DBB db,
/*____________________________________________________________
*
*
* Gets the default value for a column of an existing table.
* Will check the default for the column of the table, if that is
* not present, will check for the default of the relevant domain
*
*
* The default blr is returned in buffer. The blr is of the form
* blr_version4 blr_literal ..... blr_eoc
*
*
* Reads the system tables RDB$FIELDS and RDB$RELATION_FIELDS.
*/
*/
bool MET_get_column_default(const gpre_rel* relation,
const TEXT* column_name,
@ -209,11 +209,11 @@ bool MET_get_column_default(const gpre_rel* relation,
/*____________________________________________________________
*
*
* Lookup the fields for the primary key
* index on a relation, returning a list
* of the fields.
*/
*/
gpre_lls* MET_get_primary_key(DBB db, const TEXT* relation_name)
{
@ -234,10 +234,10 @@ gpre_lls* MET_get_primary_key(DBB db, const TEXT* relation_name)
/*____________________________________________________________
*
*
* Lookup a field by name in a relation.
* If found, return field block. If not, return NULL.
*/
*/
gpre_fld* MET_field(gpre_rel* relation, const char* string)
{
@ -269,9 +269,9 @@ gpre_fld* MET_field(gpre_rel* relation, const char* string)
/*____________________________________________________________
*
*
* Return a list of the fields in a relation
*/
*/
GPRE_NOD MET_fields(gpre_ctx* context)
{
@ -318,9 +318,9 @@ GPRE_NOD MET_fields(gpre_ctx* context)
/*____________________________________________________________
*
*
* Shutdown all attached databases.
*/
*/
void MET_fini( DBB end)
{
@ -329,10 +329,10 @@ void MET_fini( DBB end)
/*____________________________________________________________
*
*
* Lookup a generator by name.
* If found, return string. If not, return NULL.
*/
*/
const SCHAR* MET_generator(const TEXT* string, DBB db)
{
@ -342,7 +342,7 @@ const SCHAR* MET_generator(const TEXT* string, DBB db)
for (gpre_sym* symbol = HSH_lookup(name); symbol; symbol = symbol->sym_homonym)
if ((symbol->sym_type == SYM_generator) &&
(db == (DBB) (symbol->sym_object)))
(db == (DBB) (symbol->sym_object)))
{
return symbol->sym_string;
}
@ -352,9 +352,9 @@ const SCHAR* MET_generator(const TEXT* string, DBB db)
/*____________________________________________________________
*
*
* Compute internal datatype and length based on system relation field values.
*/
*/
USHORT MET_get_dtype(USHORT blr_dtype, USHORT sub_type, USHORT* length)
{
@ -441,12 +441,12 @@ USHORT MET_get_dtype(USHORT blr_dtype, USHORT sub_type, USHORT* length)
/*____________________________________________________________
*
*
* Lookup a procedure (represented by a token) in a database.
* Return a procedure block (if name is found) or NULL.
*
*
* This function has been cloned into MET_get_udf
*/
*/
gpre_prc* MET_get_procedure(DBB db, const TEXT* string, const TEXT* owner_name)
{
@ -462,7 +462,7 @@ gpre_prc* MET_get_procedure(DBB db, const TEXT* string, const TEXT* owner_name)
procedure->prc_database == db &&
(!owner[0] ||
(procedure->prc_owner
&& !strcmp(owner, procedure->prc_owner->sym_string))))
&& !strcmp(owner, procedure->prc_owner->sym_string))))
{
break;
}
@ -479,16 +479,16 @@ gpre_prc* MET_get_procedure(DBB db, const TEXT* string, const TEXT* owner_name)
/*____________________________________________________________
*
*
* Lookup a relation (represented by a token) in a database.
* Return a relation block (if name is found) or NULL.
*/
*/
gpre_rel* MET_get_relation(DBB db, const TEXT* string, const TEXT* owner_name)
{
gpre_rel* relation;
SCHAR name[NAME_SIZE], owner[NAME_SIZE];
strcpy(name, string);
strcpy(owner, owner_name);
@ -509,8 +509,8 @@ gpre_rel* MET_get_relation(DBB db, const TEXT* string, const TEXT* owner_name)
/*____________________________________________________________
*
*/
*
*/
INTLSYM MET_get_text_subtype(SSHORT ttype)
{
@ -523,12 +523,12 @@ INTLSYM MET_get_text_subtype(SSHORT ttype)
/*____________________________________________________________
*
*
* Lookup a udf (represented by a token) in a database.
* Return a udf block (if name is found) or NULL.
*
*
* This function was cloned from MET_get_procedure
*/
*/
udf* MET_get_udf(DBB db, const TEXT* string)
{
@ -552,11 +552,11 @@ udf* MET_get_udf(DBB db, const TEXT* string)
/*____________________________________________________________
*
* Return relation if the passed view_name represents a
* view with the passed relation as a base table
*
* Return relation if the passed view_name represents a
* view with the passed relation as a base table
* (the relation could be an alias).
*/
*/
gpre_rel* MET_get_view_relation(gpre_req* request,
const char* view_name,
@ -568,10 +568,10 @@ gpre_rel* MET_get_view_relation(gpre_req* request,
/*____________________________________________________________
*
*
* Lookup an index for a database.
* Return an index block (if name is found) or NULL.
*/
*/
IND MET_index(DBB db, const TEXT* string)
{
@ -594,11 +594,11 @@ IND MET_index(DBB db, const TEXT* string)
/*____________________________________________________________
*
*
* Load all of the relation names
* and user defined function names
* into the symbol (hash) table.
*/
*/
void MET_load_hash_table( DBB db)
{
@ -611,9 +611,9 @@ void MET_load_hash_table( DBB db)
/*____________________________________________________________
*
*
* Make a field symbol.
*/
*/
gpre_fld* MET_make_field(const SCHAR* name,
SSHORT dtype,
@ -634,9 +634,9 @@ gpre_fld* MET_make_field(const SCHAR* name,
/*____________________________________________________________
*
*
* Make an index symbol.
*/
*/
IND MET_make_index(const SCHAR* name)
{
@ -648,9 +648,9 @@ IND MET_make_index(const SCHAR* name)
/*____________________________________________________________
*
*
* Make an relation symbol.
*/
*/
gpre_rel* MET_make_relation(const SCHAR* name)
{
@ -663,9 +663,9 @@ gpre_rel* MET_make_relation(const SCHAR* name)
/*____________________________________________________________
*
*
* Lookup a type name for a field.
*/
*/
bool MET_type(gpre_fld* field,
const TEXT* string,
@ -688,12 +688,12 @@ bool MET_type(gpre_fld* field,
/*____________________________________________________________
*
*
* Lookup an index for a database.
*
*
* Return: true if the trigger exists
* false otherwise
*/
*/
bool MET_trigger_exists(DBB db,
const TEXT* trigger_name)
@ -708,16 +708,16 @@ bool MET_trigger_exists(DBB db,
#ifdef NOT_USED_OR_REPLACED
/*____________________________________________________________
*
*
* Compute and return the size of the array.
*/
*/
static SLONG array_size( gpre_fld* field)
{
ary* array_block = field->fld_array_info;
SLONG count = field->fld_array->fld_length;
for (dim* dimension = array_block->ary_dimension; dimension;
dimension = dimension->dim_next)
dimension = dimension->dim_next)
{
count =
count * (dimension->dim_upper - dimension->dim_lower + 1);
@ -728,9 +728,9 @@ static SLONG array_size( gpre_fld* field)
/*____________________________________________________________
*
*
* See if field is array.
*/
*/
static void get_array( DBB db, const TEXT* field_name, gpre_fld* field)
{
@ -740,22 +740,22 @@ static void get_array( DBB db, const TEXT* field_name, gpre_fld* field)
/*____________________________________________________________
*
*
* Character types can be specified as either:
* b) A POSIX style locale name "<collation>.<characterset>"
* or
* c) A simple <characterset> name (using default collation)
* d) A simple <collation> name (use charset for collation)
*
*
* Given an ASCII7 string which could be any of the above, try to
* resolve the name in the order b, c, d.
* b) is only tried iff the name contains a period.
* (in which case c) and d) are not tried).
*
*
* Return:
* true if no errors (and *id is set).
* false if the name could not be resolved.
*/
*/
static bool get_intl_char_subtype(SSHORT* id,
const UCHAR* name,
@ -772,31 +772,31 @@ static bool get_intl_char_subtype(SSHORT* id,
/*____________________________________________________________
*
*
* Given ASCII7 name of charset & collation
* resolve the specification to a ttype (id) that implements
* it.
*
*
* Inputs:
* (charset)
* (charset)
* ASCII7z name of characterset.
* NULL (implying unspecified) means use the character set
* for defined for (collation).
*
*
* (collation)
* ASCII7z name of collation.
* NULL means use the default collation for (charset).
*
*
* Outputs:
* (*id)
* (*id)
* Set to subtype specified by this name.
*
*
* Return:
* true if no errors (and *id is set).
* false if either name not found.
* or if names found, but the collation isn't for the specified
* character set.
*/
*/
static bool resolve_charset_and_collation(
SSHORT* id,
@ -810,7 +810,7 @@ static bool resolve_charset_and_collation(
/*____________________________________________________________
*
*
* Upcase a string into another string. Return
* length of string.
*/

View File

@ -52,9 +52,9 @@ static struct word {
//____________________________________________________________
//
//
// Release space used by keywords.
//
//
void HSH_fini(void)
{
@ -68,10 +68,10 @@ void HSH_fini(void)
//____________________________________________________________
//
//
// Initialize the hash table. This mostly involves
// inserting all known keywords.
//
//
void HSH_init(void)
{
@ -98,9 +98,9 @@ void HSH_init(void)
//____________________________________________________________
//
//
// Insert a symbol into the hash table.
//
//
void HSH_insert( gpre_sym* symbol)
{
@ -115,7 +115,7 @@ void HSH_insert( gpre_sym* symbol)
}
if (scompare(symbol->sym_string, (*next)->sym_string)) {
/* insert in most recently seen order;
/* insert in most recently seen order;
This is important for alias resolution in subqueries.
BUT insert tokens AFTER keyword!
In a lookup, keyword should be found first.
@ -143,16 +143,16 @@ void HSH_insert( gpre_sym* symbol)
//____________________________________________________________
//
//
// Perform a string lookup against hash table.
//
//
gpre_sym* HSH_lookup(const SCHAR* string)
{
for (gpre_sym* symbol = hash_table[hash(string)]; symbol;
symbol = symbol->sym_collision)
{
if (scompare(string, symbol->sym_string))
if (scompare(string, symbol->sym_string))
return symbol;
}
@ -160,18 +160,18 @@ gpre_sym* HSH_lookup(const SCHAR* string)
}
//____________________________________________________________
//
//
// Perform a string lookup against hash table.
// Calls scompare2 which performs case insensitive
// compare.
//
//
gpre_sym* HSH_lookup2(const SCHAR* string)
{
for (gpre_sym* symbol = hash_table[hash(string)]; symbol;
symbol = symbol->sym_collision)
{
if (scompare2(string, symbol->sym_string))
if (scompare2(string, symbol->sym_string))
return symbol;
}
@ -180,9 +180,9 @@ gpre_sym* HSH_lookup2(const SCHAR* string)
//____________________________________________________________
//
//
// Remove a symbol from the hash table.
//
//
void HSH_remove( gpre_sym* symbol)
{
@ -219,9 +219,9 @@ void HSH_remove( gpre_sym* symbol)
//____________________________________________________________
//
//
// Returns the hash function of a string.
//
//
static int hash(const SCHAR* string)
{
@ -237,9 +237,9 @@ static int hash(const SCHAR* string)
//____________________________________________________________
//
// case sensitive Compare
//
//
// case sensitive Compare
//
static bool scompare(const SCHAR* string1,
const SCHAR* string2)
@ -248,9 +248,9 @@ static bool scompare(const SCHAR* string1,
}
//____________________________________________________________
//
//
// Compare two strings
//
//
static bool scompare2(const SCHAR* string1,
const SCHAR* string2)
@ -262,7 +262,7 @@ static bool scompare2(const SCHAR* string1,
if (!(c2 = *string2++) || (UPPER(c1) != UPPER(c2)))
return false;
}
if (*string2)
return false;

View File

@ -1,27 +1,27 @@
//____________________________________________________________
//
//
// PROGRAM: C preprocess
// MODULE: int_cxx.cpp
// DESCRIPTION: Code generate for internal JRD modules
//
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// TMN (Mike Nordell) 11.APR.2001 - Reduce compiler warnings in generated code
//
//
//
//____________________________________________________________
//
@ -86,13 +86,13 @@ static inline void endp(const int column)
}
//____________________________________________________________
//
//
//
//
void INT_CXX_action( const act* action, int column)
{
// Put leading braces where required
// Put leading braces where required
switch (action->act_type) {
case ACT_for:
@ -156,16 +156,16 @@ void INT_CXX_action( const act* action, int column)
return;
}
// Put in a trailing brace for those actions still with us
// Put in a trailing brace for those actions still with us
endp(column);
}
//____________________________________________________________
//
//
// Align output to a specific column for output.
//
//
static void align(const int column)
{
@ -185,10 +185,10 @@ static void align(const int column)
//____________________________________________________________
//
//
// Build an assignment from a host language variable to
// a port variable.
//
//
static void asgn_from( REF reference, int column)
{
@ -229,10 +229,10 @@ static void asgn_from( REF reference, int column)
//____________________________________________________________
//
//
// Build an assignment to a host language variable from
// a port variable.
//
//
#ifdef NOT_USED_OR_REPLACED
static void asgn_to( REF reference)
{
@ -259,9 +259,9 @@ static void asgn_to( REF reference)
#endif
//____________________________________________________________
//
//
// Generate code for AT END clause of FETCH.
//
//
static void gen_at_end( const act* action, int column)
{
@ -273,9 +273,9 @@ static void gen_at_end( const act* action, int column)
//____________________________________________________________
//
//
// Callback routine for BLR pretty printer.
//
//
static void gen_blr(void* user_arg, SSHORT offset, const char* string)
{
@ -284,9 +284,9 @@ static void gen_blr(void* user_arg, SSHORT offset, const char* string)
//____________________________________________________________
//
//
// Generate text to compile a request.
//
//
static void gen_compile( const gpre_req* request, int column)
{
@ -302,9 +302,9 @@ static void gen_compile( const gpre_req* request, int column)
//____________________________________________________________
//
//
// Generate insertion text for the database statement.
//
//
static void gen_database( const act* action, int column)
{
@ -319,9 +319,9 @@ static void gen_database( const act* action, int column)
//____________________________________________________________
//
//
// Generate substitution text for END_MODIFY.
//
//
static void gen_emodify( const act* action, int column)
{
@ -358,9 +358,9 @@ static void gen_emodify( const act* action, int column)
//____________________________________________________________
//
//
// Generate substitution text for END_STORE.
//
//
static void gen_estore( const act* action, int column, bool special)
{
@ -372,9 +372,9 @@ static void gen_estore( const act* action, int column, bool special)
//____________________________________________________________
//
//
// Generate definitions associated with a single request.
//
//
static void gen_endfor( const act* action, int column)
{
@ -389,9 +389,9 @@ static void gen_endfor( const act* action, int column)
//____________________________________________________________
//
//
// Generate substitution text for ERASE.
//
//
static void gen_erase( const act* action, int column)
{
@ -401,9 +401,9 @@ static void gen_erase( const act* action, int column)
//____________________________________________________________
//
//
// Generate substitution text for FOR statement.
//
//
static void gen_for( const act* action, int column)
{
@ -424,10 +424,10 @@ static void gen_for( const act* action, int column)
//____________________________________________________________
//
//
// Generate a name for a reference. Name is constructed from
// port and parameter idents.
//
//
static char* gen_name(char* const string, const ref* reference)
{
@ -440,9 +440,9 @@ static char* gen_name(char* const string, const ref* reference)
//____________________________________________________________
//
//
// Generate BLR in raw, numeric form. Ugly but dense.
//
//
static void gen_raw( const gpre_req* request)
{
@ -473,9 +473,9 @@ static void gen_raw( const gpre_req* request)
//____________________________________________________________
//
//
// Generate a send or receive call for a port.
//
//
static void gen_receive( const gpre_req* request, const gpre_port* port)
{
@ -488,9 +488,9 @@ static void gen_receive( const gpre_req* request, const gpre_port* port)
//____________________________________________________________
//
//
// Generate definitions associated with a single request.
//
//
static void gen_request( const gpre_req* request)
{
@ -514,15 +514,15 @@ static void gen_request( const gpre_req* request)
//____________________________________________________________
//
//
// Process routine head. If there are gpreGlob.requests in the
// routine, insert local definitions.
//
//
static void gen_routine( const act* action, int column)
{
for (const gpre_req* request = (gpre_req*) action->act_object; request;
request = request->req_routine)
request = request->req_routine)
{
for (gpre_port* port = request->req_ports; port; port = port->por_next)
make_port(port, column + INDENT);
@ -531,9 +531,9 @@ static void gen_routine( const act* action, int column)
//____________________________________________________________
//
//
// Generate substitution text for END_STREAM.
//
//
static void gen_s_end( const act* action, int column)
{
@ -543,9 +543,9 @@ static void gen_s_end( const act* action, int column)
//____________________________________________________________
//
//
// Generate substitution text for FETCH.
//
//
static void gen_s_fetch( const act* action, int column)
{
@ -558,10 +558,10 @@ static void gen_s_fetch( const act* action, int column)
//____________________________________________________________
//
//
// Generate text to compile and start a stream. This is
// used both by START_STREAM and FOR
//
//
static void gen_s_start( const act* action, int column)
{
@ -577,9 +577,9 @@ static void gen_s_start( const act* action, int column)
//____________________________________________________________
//
//
// Generate a send or receive call for a port.
//
//
static void gen_send( const gpre_req* request, const gpre_port* port,
int column, bool special)
@ -599,9 +599,9 @@ static void gen_send( const gpre_req* request, const gpre_port* port,
//____________________________________________________________
//
//
// Generate a START.
//
//
static void gen_start( const gpre_req* request, const gpre_port* port,
int column, bool special)
@ -617,9 +617,9 @@ static void gen_start( const gpre_req* request, const gpre_port* port,
//____________________________________________________________
//
//
// Substitute for a variable reference.
//
//
static void gen_type( const act* action, int column)
{
@ -629,9 +629,9 @@ static void gen_type( const act* action, int column)
//____________________________________________________________
//
//
// Substitute for a variable reference.
//
//
static void gen_variable( const act* action, int column)
{
@ -644,9 +644,9 @@ static void gen_variable( const act* action, int column)
//____________________________________________________________
//
//
// Insert a port record description in output.
//
//
static void make_port( gpre_port* port, int column)
{
@ -697,7 +697,7 @@ static void make_port( gpre_port* port, int column)
fprintf(gpreGlob.out_file, " ISC_QUAD jrd_%d;\t// %s ",
reference->ref_ident, name);
break;
case dtype_blob:
fprintf(gpreGlob.out_file, " bid jrd_%d;\t// %s ",
reference->ref_ident, name);
@ -736,9 +736,9 @@ static void make_port( gpre_port* port, int column)
//____________________________________________________________
//
//
// Print a fixed string at a particular column.
//
//
static void printa(const int column, const TEXT* string, ...)
{

View File

@ -1,28 +1,28 @@
//____________________________________________________________
//
//
// PROGRAM: JRD Access Method
// MODULE: jrdmet.cpp
// DESCRIPTION: Non-database meta data for internal JRD stuff
//
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// TMN (Mike Nordell) 11.APR.2001 - Reduce compiler warnings
// There however is still a bunch of constness errors in this file
//
//
//
//
@ -42,9 +42,9 @@
//____________________________________________________________
//
//
// Initialize in memory meta data.
//
//
void JRDMET_init( DBB db)
{
@ -65,7 +65,7 @@ void JRDMET_init( DBB db)
HSH_insert(symbol);
const int* fld = relfld + RFLD_RPT;
for (int n = 0; fld[RFLD_F_NAME]; ++n, fld += RFLD_F_LENGTH)
for (int n = 0; fld[RFLD_F_NAME]; ++n, fld += RFLD_F_LENGTH)
{
const gfld* gfield = (fld[RFLD_F_UPD_MINOR]) ?
&gfields[fld[RFLD_F_UPD_ID]] :

View File

@ -1,23 +1,23 @@
//____________________________________________________________
//
//
// PROGRAM: Gpre support
// MODULE: movg.cpp
// DESCRIPTION: Data mover and converter and comparator, etc.
//
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// TMN (Mike Nordell) 11.APR.2001 - Reduce compiler warnings
@ -35,7 +35,7 @@
// the latter references a macro from the former, and doesn't include that
// header file itself. We need to include gpre_proto.h since we use gpre
// functions.
//
//
#include "../gpre/gpre.h"
#include "../gpre/gpre_proto.h"
#include "../common/cvt.h"
@ -44,9 +44,9 @@ static void post_error(const Firebird::Arg::StatusVector&);
//____________________________________________________________
//
//
// Move (and possible convert) something to something else.
//
//
void MOVG_move(const dsc* from, dsc* to)
{
@ -55,9 +55,9 @@ void MOVG_move(const dsc* from, dsc* to)
//____________________________________________________________
//
//
// A conversion error occurred. Complain.
//
//
static void post_error(const Firebird::Arg::StatusVector&)
{

View File

@ -1,47 +1,47 @@
//____________________________________________________________
//
//
// PROGRAM: C preprocessor
// MODULE: msc.cpp
// DESCRIPTION: Miscellaneous little stuff
//
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// TMN (Mike Nordell) 11.APR.2001 - Reduce compiler warnings
//
//
//
//____________________________________________________________
//
//
//
//
//
//
// ***************************************************
// THIS MODULE HAS SEVERAL KISSING COUSINS; IF YOU
// SHOULD CHANGE ONE OF THE MODULES IN THE FOLLOWING
// LIST, PLEASE BE SURE TO CHECK THE OTHERS FOR
// SIMILAR CHANGES:
//
//
// dsql/all.cpp
// jrd/all.cpp
// pipe/allp.cpp
// qli/all.cpp
// remote/allr.cpp
// gpre/msc.cpp
//
//
// - THANK YOU
//**************************************************
@ -64,9 +64,9 @@ static gpre_lls* free_lls;
//____________________________________________________________
//
//
// Make an action and link it to a request.
//
//
act* MSC_action( gpre_req* request, enum act_t type)
{
@ -84,8 +84,8 @@ act* MSC_action( gpre_req* request, enum act_t type)
//____________________________________________________________
//
//
//
//
UCHAR* MSC_alloc(int size)
{
@ -97,7 +97,7 @@ UCHAR* MSC_alloc(int size)
if (!next)
CPR_error("virtual memory exhausted");
#ifdef DEBUG_GDS_ALLOC
// For V4.0 we don't care about gpre specific memory leaks
// For V4.0 we don't care about gpre specific memory leaks
gds_alloc_flag_unfreed(next);
#endif
next->spc_next = space;
@ -114,9 +114,9 @@ UCHAR* MSC_alloc(int size)
//____________________________________________________________
//
//
// Allocate a block in permanent memory.
//
//
UCHAR* MSC_alloc_permanent(int size)
{
@ -128,7 +128,7 @@ UCHAR* MSC_alloc_permanent(int size)
if (!next)
CPR_error("virtual memory exhausted");
#ifdef DEBUG_GDS_ALLOC
// For V4.0 we don't care about gpre specific memory leaks
// For V4.0 we don't care about gpre specific memory leaks
gds_alloc_flag_unfreed(next);
#endif
next->spc_next = permanent_space;
@ -146,9 +146,9 @@ UCHAR* MSC_alloc_permanent(int size)
//____________________________________________________________
//
//
// Make a binary node.
//
//
GPRE_NOD MSC_binary(NOD_T type, GPRE_NOD arg1, GPRE_NOD arg2)
{
@ -161,9 +161,9 @@ GPRE_NOD MSC_binary(NOD_T type, GPRE_NOD arg1, GPRE_NOD arg2)
//____________________________________________________________
//
//
// Make a new context for a request and link it up to the request.
//
//
gpre_ctx* MSC_context(gpre_req* request)
{
@ -174,7 +174,7 @@ gpre_ctx* MSC_context(gpre_req* request)
context->ctx_internal = request->req_internal++;
context->ctx_scope_level = request->req_scope_level;
// link in with the request block
// link in with the request block
context->ctx_next = request->req_contexts;
request->req_contexts = context;
@ -184,9 +184,9 @@ gpre_ctx* MSC_context(gpre_req* request)
//____________________________________________________________
//
//
// Copy one string into another.
//
//
void MSC_copy(const char* from, int length, char* to)
{
@ -198,9 +198,9 @@ void MSC_copy(const char* from, int length, char* to)
}
//____________________________________________________________
//
//
// Copy two strings into another.
//
//
void MSC_copy_cat(const char* from1, int length1, const char* from2, int length2,
char* to)
@ -215,9 +215,9 @@ void MSC_copy_cat(const char* from1, int length1, const char* from2, int length2
}
//____________________________________________________________
//
//
// Find a symbol of a particular type.
//
//
gpre_sym* MSC_find_symbol(gpre_sym* symbol, enum sym_t type)
{
@ -231,9 +231,9 @@ gpre_sym* MSC_find_symbol(gpre_sym* symbol, enum sym_t type)
//____________________________________________________________
//
//
// Free a block.
//
//
void MSC_free(void* block)
{
@ -242,9 +242,9 @@ void MSC_free(void* block)
//____________________________________________________________
//
//
// Get rid of an erroroneously allocated request block.
//
//
void MSC_free_request( gpre_req* request)
{
@ -256,10 +256,10 @@ void MSC_free_request( gpre_req* request)
//____________________________________________________________
//
//
// Initialize (or more properly, re-initialize) the memory
// allocator.
//
//
void MSC_init(void)
{
@ -274,11 +274,11 @@ void MSC_init(void)
//____________________________________________________________
//
//
// Match the current token against a keyword. If successful,
// advance the token stream and return true. Otherwise return
// false.
//
//
bool MSC_match(KWWORDS keyword)
{
@ -289,7 +289,7 @@ bool MSC_match(KWWORDS keyword)
symbol = symbol->sym_collision)
{
if ((strcmp(symbol->sym_string, gpreGlob.token_global.tok_string) ==
0) && symbol->sym_keyword != KW_none)
0) && symbol->sym_keyword != KW_none)
{
gpreGlob.token_global.tok_symbol = symbol;
gpreGlob.token_global.tok_keyword = static_cast < kwwords > (symbol->sym_keyword);
@ -307,10 +307,10 @@ bool MSC_match(KWWORDS keyword)
#ifdef NOT_USED_OR_REPLACED
//____________________________________________________________
//
//
// Determinate where a specific object is
// represented on a linked list stack.
//
//
bool MSC_member(GPRE_NOD object, gpre_lls* stack)
{
@ -324,9 +324,9 @@ bool MSC_member(GPRE_NOD object, gpre_lls* stack)
#endif
//____________________________________________________________
//
//
// Allocate an initialize a syntax node.
//
//
GPRE_NOD MSC_node(enum nod_t type, SSHORT count)
{
@ -339,9 +339,9 @@ GPRE_NOD MSC_node(enum nod_t type, SSHORT count)
//____________________________________________________________
//
//
// Pop an item off a linked list stack. Free the stack node.
//
//
GPRE_NOD MSC_pop(gpre_lls** pointer)
{
@ -357,9 +357,9 @@ GPRE_NOD MSC_pop(gpre_lls** pointer)
//____________________________________________________________
//
//
// Allocate a new privilege (grant/revoke) block.
//
//
PRV MSC_privilege_block(void)
{
@ -375,9 +375,9 @@ PRV MSC_privilege_block(void)
//____________________________________________________________
//
//
// Push an arbitrary object onto a linked list stack.
//
//
void MSC_push( GPRE_NOD object, gpre_lls** pointer)
{
@ -394,10 +394,10 @@ void MSC_push( GPRE_NOD object, gpre_lls** pointer)
//____________________________________________________________
//
//
// Generate a reference and possibly link the reference into
// a linked list.
//
//
REF MSC_reference(REF* link)
{
@ -413,10 +413,10 @@ REF MSC_reference(REF* link)
//____________________________________________________________
//
//
// Set up for a new request. Make request and action
// blocks, all linked up and ready to go.
//
//
gpre_req* MSC_request(enum req_t type)
{
@ -438,9 +438,9 @@ gpre_req* MSC_request(enum req_t type)
//____________________________________________________________
//
//
// Copy a string into a permanent block.
//
//
SCHAR* MSC_string(const TEXT* input)
{
@ -452,9 +452,9 @@ SCHAR* MSC_string(const TEXT* input)
//____________________________________________________________
//
//
// Allocate and initialize a symbol block.
//
//
gpre_sym* MSC_symbol(enum sym_t type, const TEXT* string, USHORT length, gpre_ctx* object)
{
@ -472,9 +472,9 @@ gpre_sym* MSC_symbol(enum sym_t type, const TEXT* string, USHORT length, gpre_ct
//____________________________________________________________
//
//
// Make a unary node.
//
//
GPRE_NOD MSC_unary(NOD_T type, GPRE_NOD arg)
{
@ -486,9 +486,9 @@ GPRE_NOD MSC_unary(NOD_T type, GPRE_NOD arg)
//____________________________________________________________
//
//
// Set up for a new username.
//
//
gpre_usn* MSC_username(SCHAR* name, USHORT name_dyn)
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,26 @@
//____________________________________________________________
//
//
// PROGRAM: Language Preprocessor
// MODULE: pat.cpp
// DESCRIPTION: Code generator pattern generator
//
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
//
//
//
//____________________________________________________________
//
@ -38,23 +38,23 @@
typedef enum {
NL,
RH, RL, RT, RI, RS, // Request handle, level, transaction, ident, length
DH, DF, // Database handle, filename
TH, // Transaction handle
BH, BI, // Blob handle, blob_ident
FH, // Form handle
V1, V2, // Status vectors
I1, I2, // Identifier numbers
RF, RE, // OS- and language-dependent REF and REF-end character
VF, VE, // OS- and language-dependent VAL and VAL-end character
RH, RL, RT, RI, RS, // Request handle, level, transaction, ident, length
DH, DF, // Database handle, filename
TH, // Transaction handle
BH, BI, // Blob handle, blob_ident
FH, // Form handle
V1, V2, // Status vectors
I1, I2, // Identifier numbers
RF, RE, // OS- and language-dependent REF and REF-end character
VF, VE, // OS- and language-dependent VAL and VAL-end character
S1, S2, S3, S4, S5, S6, S7,
// Arbitrary strings
// Arbitrary strings
N1, N2, N3, N4, // Arbitrary number (SSHORT)
L1, L2, // Arbitrary number (SLONG)
PN, PL, PI, // Port number, port length, port ident
QN, QL, QI, // Second port number, port length, port ident
IF, EL, EN, // If, else, end
FR // Field reference
PN, PL, PI, // Port number, port length, port ident
QN, QL, QI, // Second port number, port length, port ident
IF, EL, EN, // If, else, end
FR // Field reference
} PAT_T;
static const struct ops {
@ -109,9 +109,9 @@ static const struct ops {
//____________________________________________________________
//
//
// Expand a pattern.
//
//
void PATTERN_expand( USHORT column, const TEXT* pattern, PAT* args)
{
@ -378,7 +378,7 @@ void PATTERN_expand( USHORT column, const TEXT* pattern, PAT* args)
sprintf(p, gpreGlob.long_ident_pattern, long_value);
else
sprintf(p, gpreGlob.ident_pattern, value);
}
}
else if (reference) {
if (!reference->ref_port)
sprintf(p, gpreGlob.ident_pattern, reference->ref_ident);

View File

@ -1,27 +1,27 @@
//____________________________________________________________
//
//
// PROGRAM: BLR Pretty Printer
// MODULE: pretty.cpp
// DESCRIPTION: BLR Pretty Printer
//
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// TMN (Mike Nordell) 11.APR.2001 - Reduce compiler warnings
//
//
//
//____________________________________________________________
//
@ -48,10 +48,10 @@
typedef struct ctl {
UCHAR *ctl_blr; // Running blr string
UCHAR *ctl_blr_start; // Original start of blr string
FPTR_PRINT_CALLBACK ctl_routine; // Call back
void *ctl_user_arg; // User argument
UCHAR *ctl_blr; // Running blr string
UCHAR *ctl_blr_start; // Original start of blr string
FPTR_PRINT_CALLBACK ctl_routine; // Call back
void *ctl_user_arg; // User argument
TEXT *ctl_ptr;
SSHORT ctl_language;
SSHORT ctl_level;
@ -102,9 +102,9 @@ const char *map_strings[] = {
};
//____________________________________________________________
//
//
// Pretty print create database parameter buffer thru callback routine.
//
//
int PRETTY_print_cdb( UCHAR* blr,
FPTR_PRINT_CALLBACK routine,
@ -134,7 +134,7 @@ int PRETTY_print_cdb( UCHAR* blr,
else
sprintf(temp, "gds__dpb_version%d", i);
blr_format(control, temp);
SSHORT offset = 0;
print_line(control, offset);
@ -167,11 +167,11 @@ int PRETTY_print_cdb( UCHAR* blr,
int PRETTY_print_dyn(
UCHAR* blr,
//____________________________________________________________
//
//
// Pretty print dynamic DDL thru callback routine.
//
//
FPTR_PRINT_CALLBACK routine,
FPTR_PRINT_CALLBACK routine,
void* user_arg, SSHORT language)
{
ctl ctl_buffer;
@ -215,9 +215,9 @@ int PRETTY_print_dyn(
int
PRETTY_print_sdl(UCHAR* blr,
//____________________________________________________________
//
//
// Pretty print slice description language.
//
//
FPTR_PRINT_CALLBACK routine,
void *user_arg, SSHORT language)
@ -260,9 +260,9 @@ PRETTY_print_sdl(UCHAR* blr,
//____________________________________________________________
//
//
// Format an utterance.
//
//
static int blr_format(CTL control, const char *string, ...)
{
@ -273,15 +273,15 @@ static int blr_format(CTL control, const char *string, ...)
va_end(ptr);
while (*control->ctl_ptr)
control->ctl_ptr++;
return 0;
}
//____________________________________________________________
//
//
// Put out an error msg and punt.
//
//
static int error( CTL control, SSHORT offset, const TEXT * string, int arg)
{
@ -297,9 +297,9 @@ static int error( CTL control, SSHORT offset, const TEXT * string, int arg)
//____________________________________________________________
//
//
// Indent for pretty printing.
//
//
static int indent( CTL control, SSHORT level)
{
@ -312,10 +312,10 @@ static int indent( CTL control, SSHORT level)
//____________________________________________________________
//
//
// Print a datatype sequence and return the length of the
// data described.
//
//
static int print_blr_dtype(CTL control,
bool print_object)
@ -326,7 +326,7 @@ static int print_blr_dtype(CTL control,
const USHORT dtype = BLR_BYTE;
// Special case blob (261) to keep down the size of the
// jump table
// jump table
switch (dtype) {
case blr_short:
@ -418,7 +418,7 @@ static int print_blr_dtype(CTL control,
if (!print_object)
return length;
// TMN: FIX FIX Note that offset is not initialized to anything useful
// for e.g. print_word(control, (SSHORT)offset). I assume it's better to initialize it to zero
// than letting it be random.
@ -470,9 +470,9 @@ static int print_blr_dtype(CTL control,
//____________________________________________________________
//
//
// Print a line of pretty-printed BLR.
//
//
static void print_blr_line(void* arg, SSHORT offset, const char* line)
{
@ -498,9 +498,9 @@ static void print_blr_line(void* arg, SSHORT offset, const char* line)
//____________________________________________________________
//
//
// Print a byte as a numeric value and return same.
//
//
static int print_byte( CTL control, SSHORT offset)
{
@ -514,9 +514,9 @@ static int print_byte( CTL control, SSHORT offset)
//____________________________________________________________
//
//
// Print a byte as a numeric value and return same.
//
//
static int print_char( CTL control, SSHORT offset)
{
@ -536,9 +536,9 @@ static int print_char( CTL control, SSHORT offset)
//____________________________________________________________
//
//
// Primary recursive routine to print dynamic DDL.
//
//
static int print_dyn_verb( CTL control, SSHORT level)
{
@ -560,7 +560,7 @@ static int print_dyn_verb( CTL control, SSHORT level)
++level;
int length;
switch (dyn_operator) {
case isc_dyn_drop_difference:
case isc_dyn_begin_backup:
@ -721,9 +721,9 @@ static int print_dyn_verb( CTL control, SSHORT level)
//____________________________________________________________
//
//
// Invoke callback routine to print (or do something with) a line.
//
//
static int print_line( CTL control, SSHORT offset)
{
@ -736,9 +736,9 @@ static int print_line( CTL control, SSHORT offset)
//____________________________________________________________
//
//
// Print a VAX word as a numeric value an return same.
//
//
static SLONG print_long( CTL control, SSHORT offset)
{
@ -757,9 +757,9 @@ static SLONG print_long( CTL control, SSHORT offset)
//____________________________________________________________
//
//
// Primary recursive routine to print slice description language.
//
//
static int print_sdl_verb( CTL control, SSHORT level)
{
@ -865,9 +865,9 @@ static int print_sdl_verb( CTL control, SSHORT level)
//____________________________________________________________
//
//
// Print a byte-counted string.
//
//
static int print_string( CTL control, SSHORT offset)
{
@ -881,9 +881,9 @@ static int print_string( CTL control, SSHORT offset)
//____________________________________________________________
//
//
// Print a VAX word as a numeric value an return same.
//
//
static int print_word( CTL control, SSHORT offset)
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -153,9 +153,9 @@ ULONG CVBIG5_unicode_to_big5(csconvert* obj,
const int tmp1 = big5_ch / 256;
const int tmp2 = big5_ch % 256;
if (tmp1 == 0) { /* ASCII character */
fb_assert((UCHAR(tmp2) & 0x80) == 0);
*big5_str++ = tmp2;
big5_len--;
unicode_len -= sizeof(*unicode_str);
@ -190,9 +190,9 @@ INTL_BOOL CVBIG5_check_big5(charset* cs,
/**************************************
* Functional description
* Make sure that the big5 string does not have any truncated 2 byte
* character at the end.
* If we have a truncated character then,
* return false.
* character at the end.
* If we have a truncated character then,
* return false.
* else return(true);
**************************************/
const UCHAR* big5_str_start = big5_str;

View File

@ -113,7 +113,7 @@ ULONG CVGB_unicode_to_gb2312(csconvert* obj,
const UCHAR* p_unicode_str,
ULONG gb_len,
UCHAR* gb_str,
USHORT* err_code,
USHORT* err_code,
ULONG* err_position)
{
fb_assert(obj != NULL);
@ -152,9 +152,9 @@ ULONG CVGB_unicode_to_gb2312(csconvert* obj,
const int tmp1 = gb_ch / 256;
const int tmp2 = gb_ch % 256;
if (tmp1 == 0) { /* ASCII character */
fb_assert((UCHAR(tmp2) & 0x80) == 0);
*gb_str++ = tmp2;
gb_len--;
unicode_len -= sizeof(*unicode_str);
@ -186,9 +186,9 @@ INTL_BOOL CVGB_check_gb2312(charset* cs, ULONG gb_len, const UCHAR *gb_str, ULON
/**************************************
* Functional description
* Make sure that the GB2312 string does not have any truncated 2 byte
* character at the end.
* If we have a truncated character then,
* return false.
* character at the end.
* If we have a truncated character then,
* return false.
* else return(true);
**************************************/
const UCHAR* gb_str_start = gb_str;

View File

@ -241,7 +241,7 @@ Received: by dbase.a-t.com (/\==/\ Smail3.1.21.1 #21.5)
id <m0kjfXI-0004qKC@dbase.a-t.com>; Tue, 19 Nov 91 16:11 PST
Received: by tate.a-t.com (/\==/\ Smail3.1.21.1 #21.1)
id <m0kjfPU-000Gf0C@tate.a-t.com>; Tue, 19 Nov 91 16:03 PST
Received: from Sun.COM by relay1.UU.NET with SMTP
Received: from Sun.COM by relay1.UU.NET with SMTP
(5.61/UUNET-internet-primary) id AA21144; Tue, 19 Nov 91 18:45:19 -0500
Received: from Eng.Sun.COM (zigzag-bb.Corp.Sun.COM) by Sun.COM (4.1/SMI-4.1)
id AA04289; Tue, 19 Nov 91 15:40:59 PST
@ -350,7 +350,7 @@ STEPS:
EX: JIS 1st is in the range 33-94, so we execute step 3(a). JIS 1st = 76
(is NOT odd), so JIS 2nd = 150 ((76/2) + 112)
JIS 1st: 150
JIS 2nd: 162
@ -561,7 +561,7 @@ INTL_BOOL CVJIS_check_euc(charset* cs, ULONG euc_len, const UCHAR* euc_str, ULON
* Functional description
* This is a cousin of the KANJI_check_sjis routine.
* Make sure that the euc string does not have any truncated 2 byte
* character at the end. * If we have a truncated character then,
* character at the end. * If we have a truncated character then,
* return false.
* else return true;
**************************************/
@ -598,9 +598,9 @@ INTL_BOOL CVJIS_check_sjis(charset* cs, ULONG sjis_len, const UCHAR* sjis_str, U
*
* Functional description
* This is a cousin of the KANJI_check_euc routine.
* Make sure that the sjis string does not have any truncated 2 byte
* Make sure that the sjis string does not have any truncated 2 byte
* character at the end. * If we have a truncated character then,
* return 1.
* return 1.
* else return(0);
**************************************/
const UCHAR* start = sjis_str;

View File

@ -29,7 +29,7 @@
/*
* KSC-5601 -> unicode
* % KSC-5601 is same to EUC cs1(codeset 1). Then converting
* % KSC-5601 is same to EUC cs1(codeset 1). Then converting
* KSC-5601 to EUC is not needed.
*/
@ -156,7 +156,7 @@ ULONG CVKSC_unicode_to_ksc(csconvert* obj,
const int tmp1 = ksc_ch / 256;
const int tmp2 = ksc_ch % 256;
if (tmp1 == 0) { /* ASCII character */
fb_assert((UCHAR(tmp2) & 0x80) == 0);
*ksc_str++ = tmp2;

View File

@ -167,7 +167,7 @@ static fss_size_t fss_mbtowc( fss_wchar_t* p, const UCHAR* s, fss_size_t n)
int nc = 0;
if (n <= nc)
return -1;
const int c0 = *s & 0xff;
long l = c0;
for (const Fss_table* t = fss_sequence_table; t->cmask; t++) {
@ -265,7 +265,7 @@ ULONG CS_UTFFSS_fss_to_unicode_cc(csconvert* obj,
fb_assert(obj != NULL);
fb_assert(obj->csconvert_fn_convert == CS_UTFFSS_fss_to_unicode_cc);
return fss_to_unicode(src_len, src_ptr,
return fss_to_unicode(src_len, src_ptr,
dest_len, Firebird::OutAligner<UNICODE>(dest_ptr, dest_len), err_code, err_position);
}

View File

@ -55,15 +55,15 @@ USHORT KANJI_check_euc(const UCHAR* euc_str, USHORT euc_len)
{
/**************************************
*
* K A N J I _ c h e c k _ e u c
* K A N J I _ c h e c k _ e u c
*
**************************************
*
* Functional description
* This is a cousin of the KANJI_check_sjis routine.
* Make sure that the euc string does not have any truncated 2 byte
* character at the end. * If we have a truncated character then,
* return 1.
* character at the end. * If we have a truncated character then,
* return 1.
* else return(0);
**************************************/
while (euc_len--) {
@ -93,9 +93,9 @@ USHORT KANJI_check_sjis(const UCHAR* sjis_str, USHORT sjis_len)
*
* Functional description
* This is a cousin of the KANJI_check_euc routine.
* Make sure that the sjis string does not have any truncated 2 byte
* Make sure that the sjis string does not have any truncated 2 byte
* character at the end. * If we have a truncated character then,
* return 1.
* return 1.
* else return(0);
**************************************/
while (sjis_len--) {

View File

@ -121,7 +121,7 @@ static inline bool FAMILY_ASCII(texttype* cache,
TextTypeImpl* impl = FB_NEW(*getDefaultMemoryPool()) TextTypeImpl;
cache->texttype_impl = impl;
memset(&impl->cs, 0, sizeof(impl->cs));
LD_lookup_charset(&impl->cs, cs_name, config_info);
@ -504,7 +504,7 @@ USHORT famasc_key_length(texttype* obj, USHORT inLen)
*
* For ASCII type collation (codepoint collation) this mearly
* involves stripping the space character off the key.
*
*
* RETURN:
* Length, in bytes, of returned key
*/
@ -569,7 +569,7 @@ SSHORT famasc_compare(texttype* obj, ULONG l1, const BYTE* s1, ULONG l2, const B
return 1;
if (s1[i] < s2[i])
return -1;
return 1;
}

View File

@ -1,7 +1,7 @@
/*
* PROGRAM: InterBase International support
* MODULE: lc_big5.cpp
* DESCRIPTION: Language Drivers in the BIG5 family.
* DESCRIPTION: Language Drivers in the BIG5 family.
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file

View File

@ -1,7 +1,7 @@
/*
* PROGRAM: InterBase International support
* MODULE: lc_gb2312.cpp
* DESCRIPTION: Language Drivers in the GB2312 family.
* DESCRIPTION: Language Drivers in the GB2312 family.
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file

View File

@ -81,7 +81,7 @@ const UINT16 NULL_TERTIARY = 0;
* + 2 * ns
* + 3 * nt
* + 3 * (nc/2)
* + 3 * 2 * ne
* + 3 * 2 * ne
* + 2 * nsp
* + 1 (if nsp > 0, for separating keys from special keys)
*
@ -161,7 +161,7 @@ static ULONG do_debug = 0;
/*
*
* Convert a user string to a sequence that will collate bytewise.
*
*
* RETURN:
* Length, in bytes, of returned key
*/
@ -205,7 +205,7 @@ USHORT LC_NARROW_string_to_key(texttype* obj, USHORT iInLen, const BYTE* pInChar
}
iInLen = (inbuff - pInChar + 1);
USHORT i;
for (i = 0; i < iInLen; i++, pInChar++) {
@ -546,7 +546,7 @@ static const SortOrderTblEntry* get_coltab_entry(texttype* obj, const UCHAR** p,
#define XOR ^ /* C bitwise XOR operator - defined for readability */
SSHORT LC_NARROW_compare(texttype* obj, ULONG l1, const BYTE* s1, ULONG l2, const BYTE* s2,
SSHORT LC_NARROW_compare(texttype* obj, ULONG l1, const BYTE* s1, ULONG l2, const BYTE* s2,
INTL_BOOL* error_flag)
{
fb_assert(obj != NULL);
@ -583,7 +583,7 @@ SSHORT LC_NARROW_compare(texttype* obj, ULONG l1, const BYTE* s1, ULONG l2, cons
coltab_status stat1, stat2;
stat1.stat_flags = 0;
stat2.stat_flags = 0;
const SortOrderTblEntry* col1 = 0;
const SortOrderTblEntry* col2 = 0;
@ -689,7 +689,7 @@ static SSHORT old_fam2_compare(texttype* obj, ULONG l1, const BYTE* s1,
return (-1);
if (len1 > len2)
return (1);
return (0);
}
#endif /* DEBUG_COMPARE */

View File

@ -528,7 +528,7 @@ INTL_BOOL FB_DLL_EXPORT LD_lookup_texttype(texttype* tt, const ASCII* texttype_n
{
if (LD_lookup_charset(&cs, charset_name, configInfo))
break;
return false;
}
}
@ -563,7 +563,7 @@ ULONG FB_DLL_EXPORT LD_setup_attributes(
{
Firebird::string specificAttributes((const char*) src, srcLen);
Firebird::string newSpecificAttributes = specificAttributes;
if (!LCICU_setup_attributes(textTypeName, charSetName, configInfo,
specificAttributes, newSpecificAttributes))
{

View File

@ -48,7 +48,7 @@ No errors
#include "../intl/cs_iso8859_1.h"
*/
/*
/*
-- Multibyte character sets --
#include "../intl/cs_big5.h"
#include "../intl/cs_gb2312.h"

View File

@ -28,7 +28,7 @@
ColList::item::item(const char* name, int len)
: col_len(len), next(0)
: col_len(len), next(0)
{
fb_utils::copy_terminate(col_name, name, sizeof(col_name));
}

View File

@ -93,17 +93,17 @@ void Extender::grow(size_t n)
alloc(n);
return;
}
if (m_size < n)
{
const size_t old_pos = getUsed();
char* const old_buf = m_buf;
m_buf = new char[m_size = n];
memcpy(m_buf, old_buf, old_pos); // Copy only the used bytes.
m_pos = m_buf + old_pos; // Reposition the current insertion point.
m_pos[0] = 0; // Same as alloc().
delete[] old_buf;
}
}

View File

@ -33,7 +33,7 @@ int OptionsBase::getCommand(const char* cmd) const
const size_t swlen = strlen(cmd);
if (!swlen)
return m_wrong;
for (int i = 0; i < m_size; ++i)
{
const optionsMap& item = m_options[i];
@ -64,10 +64,10 @@ void OptionsBase::showCommands(FILE* out) const
const optionsMap& item = m_options[i];
if (item.text[0] != cap)
continue;
const size_t swlen = strlen(item.text);
fb_assert(swlen >= item.abbrlen || !item.abbrlen);
if (!item.abbrlen)
fprintf(out, "%-25s", item.text);
else
@ -84,11 +84,11 @@ void OptionsBase::showCommands(FILE* out) const
fputc(c, out);
}
for (; j < 25; ++j)
fputc(' ', out);
}
if (newline == 2)
{
fputc('\n', out);
@ -98,7 +98,7 @@ void OptionsBase::showCommands(FILE* out) const
++newline;
}
}
if (newline) // Last line was without newline.
fputc('\n', out);
}

View File

@ -69,7 +69,7 @@ scrollkeys key2scroll[] = {
{VK_RIGHT, WM_HSCROLL, SB_PAGEDOWN}
};
// data initialized by first instance
// data initialized by first instance
struct tagSETUPDATA {
SCHAR appName[20];
@ -79,27 +79,27 @@ struct tagSETUPDATA {
};
typedef tagSETUPDATA SETUPDATA;
// various temp file names
// various temp file names
static SCHAR defInputFile[MAXPATHLEN]; // default input file name
static SCHAR defOutputFile[MAXPATHLEN]; // default output file name
static SCHAR defHistFile[MAXPATHLEN]; // command history file name
static SCHAR defSessionFile[MAXPATHLEN]; // SQL session file
static FILE *ipf; // input file
static FILE *opf; // output file
static FILE *chf; // command history
static FILE *sss; // SQL session
static SCHAR defInputFile[MAXPATHLEN]; // default input file name
static SCHAR defOutputFile[MAXPATHLEN]; // default output file name
static SCHAR defHistFile[MAXPATHLEN]; // command history file name
static SCHAR defSessionFile[MAXPATHLEN]; // SQL session file
static FILE *ipf; // input file
static FILE *opf; // output file
static FILE *chf; // command history
static FILE *sss; // SQL session
// global flags
// global flags
static SSHORT gflags;
const SSHORT DBINITED = 1; // database initilized flag
const SSHORT DEFINPUT = 2; // default input file exists flag
const SSHORT DEFOUTPUT = 4; // default output file exists flag
const SSHORT COMHIST = 8; // command history file exists flag
const SSHORT OVERWRITE = 16; // overwrite/append to window
const SSHORT SESSFILE = 32; // SQL session file exists flag
const SSHORT DBINITED = 1; // database initilized flag
const SSHORT DEFINPUT = 2; // default input file exists flag
const SSHORT DEFOUTPUT = 4; // default output file exists flag
const SSHORT COMHIST = 8; // command history file exists flag
const SSHORT OVERWRITE = 16; // overwrite/append to window
const SSHORT SESSFILE = 32; // SQL session file exists flag
SETUPDATA SetUpData;
@ -108,44 +108,44 @@ SETUPDATA SetUpData;
program but not passed to other instances
*/
HINSTANCE hInst; // hInstance of application
HWND hWndMain; // hWnd of main window
HINSTANCE hInst; // hInstance of application
HWND hWndMain; // hWnd of main window
int xChar, yChar, yCharnl; // character size
int xClient, yClient; // client window size
int xChar, yChar, yCharnl; // character size
int xClient, yClient; // client window size
LOGFONT cursfont; // font structure
HFONT holdsfont; // handle of original font
HFONT hnewsfont; // handle of new fixed font
SCHAR tmpDialogParam[1024]; // used by dialog boxes
LOGFONT cursfont; // font structure
HFONT holdsfont; // handle of original font
HFONT hnewsfont; // handle of new fixed font
SCHAR tmpDialogParam[1024]; // used by dialog boxes
// window scroll/paint stuff
// window scroll/paint stuff
int nVscrollMax, nHscrollMax; // scroll ranges
int nVscrollPos, nHscrollPos; // current scroll positions
int numlines; // number of lines in file
int maxwidth; // width of display format
int nVscrollInc, nHscrollInc; // scroll increments
int nPageMaxLines; // max lines on screen
int nVscrollMax, nHscrollMax; // scroll ranges
int nVscrollPos, nHscrollPos; // current scroll positions
int numlines; // number of lines in file
int maxwidth; // width of display format
int nVscrollInc, nHscrollInc; // scroll increments
int nPageMaxLines; // max lines on screen
// arguments passed to ISQL
// arguments passed to ISQL
int ISQL_argc; // argument count
char *ISQL_argv[20]; // argument vector
char ISQL_args[1024]; // space for arguments
char *ISQL_cursor; // cursor into arguments
int ISQL_argc; // argument count
char *ISQL_argv[20]; // argument vector
char ISQL_args[1024]; // space for arguments
char *ISQL_cursor; // cursor into arguments
// database startup parameters
// database startup parameters
static SCHAR newDataBase[256];
static SCHAR newUserName[32];
static SCHAR newPassword[16];
// script parameters
// script parameters
static SCHAR scriptName[256];
static SCHAR scriptOutput[256];
// extract parameters
// extract parameters
static SCHAR extractDbName[256];
static SCHAR extractOutput[256];
static SCHAR extractTarget[256];
@ -216,8 +216,8 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
* depends on message.
*
********************************************************************/
DLGPROC lpproc; // pointer to thunk for dialog box
SCHAR buf[1024]; // temp buffer
DLGPROC lpproc; // pointer to thunk for dialog box
SCHAR buf[1024]; // temp buffer
SCHAR pwbuf[50];
SCHAR unbuf[50];
SSHORT i;
@ -232,18 +232,18 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
case WM_COMMAND:
switch (GET_WM_COMMAND_ID(wParam, lParam)) {
case IDM_QUIT:
// User selected Quit on menu
// User selected Quit on menu
PostMessage(hWnd, WM_CLOSE, 0, 0L);
break;
case IDM_HOME:
// Used to implement home to topleft from keyboard.
// Used to implement home to topleft from keyboard.
SendMessage(hWnd, WM_HSCROLL, GET_WM_HSCROLL_MPS(SB_TOP, 0, 0));
SendMessage(hWnd, WM_VSCROLL, GET_WM_VSCROLL_MPS(SB_TOP, 0, 0));
break;
case IDM_ABOUT:
// Display about box.
// Display about box.
lpproc =
(DLGPROC) MakeProcInstance((FARPROC) aboutDlgProc, hInst);
DialogBox(hInst, MAKEINTRESOURCE(ABOUT), hWnd, lpproc);
@ -356,7 +356,7 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
DialogBox(hInst, MAKEINTRESOURCE(EXEC_SCRIPT), hWnd, lpproc);
FreeProcInstance((FARPROC) lpproc);
if (ret) {
// generate an argc/argv
// generate an argc/argv
ISQL_cursor = ISQL_args;
ISQL_argc = 0;
@ -365,7 +365,7 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
pusharg(scriptName);
pusharg("-output");
// use specified output file, or default
// use specified output file, or default
if (scriptOutput[0])
pusharg(scriptOutput);
@ -391,7 +391,7 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
}
ISQL_main(ISQL_argc, ISQL_argv);
// reopen default files and database
// reopen default files and database
ipf = fopen(defInputFile, "r");
opf = fopen(defOutputFile, "a");
@ -412,7 +412,7 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
ret = DialogBox(hInst, MAKEINTRESOURCE(EXTRACT_DB), hWnd, lpproc);
FreeProcInstance((FARPROC) lpproc);
if (ret) {
// create an argument vector for ISQL
// create an argument vector for ISQL
ISQL_cursor = ISQL_args;
ISQL_argc = 0;
@ -434,7 +434,7 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
ISQL_main(ISQL_argc, ISQL_argv);
ISQL_exit_db();
// reopen default files and database
// reopen default files and database
ipf = fopen(defInputFile, "r");
opf = fopen(defOutputFile, "a");
@ -457,7 +457,7 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
gflags |= OVERWRITE;
break;
// Send the proper frontend commands for these:
// Send the proper frontend commands for these:
case IDM_BLOB_TYPE:
tmpDialogParam[0] = '\0';
@ -531,7 +531,7 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
}
break;
// Send the proper show commands for these:
// Send the proper show commands for these:
case IDM_SHOW_VERSION:
test_overwrite();
@ -648,15 +648,15 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
break;
case WM_SIZE:
// Save size of window client area.
// Save size of window client area.
if (lParam) {
yClient = HIWORD(lParam);
xClient = LOWORD(lParam);
yClient = (yClient / yCharnl + 1) * yCharnl;
lParam = MAKELONG(xClient, yClient);
// Go setup scroll ranges and file display area based upon
// client area size.
// Go setup scroll ranges and file display area based upon
// client area size.
setup_scroll(hWnd);
return DefWindowProc(hWnd, message, wParam, lParam);
@ -664,7 +664,7 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
break;
case WM_VSCROLL:
// React to the various vertical scroll related actions.
// React to the various vertical scroll related actions.
switch (GET_WM_VSCROLL_CODE(wParam, lParam)) {
case SB_TOP:
@ -705,7 +705,7 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
break;
case WM_HSCROLL:
// React to the various horizontal scroll related actions.
// React to the various horizontal scroll related actions.
switch (GET_WM_HSCROLL_CODE(wParam, lParam)) {
case SB_LINEUP:
@ -740,8 +740,8 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
break;
case WM_KEYDOWN:
// Translate various keydown messages to appropriate horizontal
// and vertical scroll actions.
// Translate various keydown messages to appropriate horizontal
// and vertical scroll actions.
for (i = 0; i < FB_NELEM(key2scroll); i++) {
if (wParam == key2scroll[i].wVirtkey) {
@ -753,31 +753,31 @@ LRESULT CALLBACK _export ISQLWndProc(HWND hWnd,
break;
case WM_PAINT:
// Go paint the client area of the window with the appropriate
// part of the selected file.
// Go paint the client area of the window with the appropriate
// part of the selected file.
paint_isql(hWnd);
break;
case WM_DESTROY:
// This is the end if we were closed by a DestroyWindow call.
close_isql(); // take any necessary wrapup action.
PostQuitMessage(0); // this is the end...
// This is the end if we were closed by a DestroyWindow call.
close_isql(); // take any necessary wrapup action.
PostQuitMessage(0); // this is the end...
break;
case WM_QUERYENDSESSION:
// If we return TRUE we are saying it's ok with us to end the
// windows session.
close_isql(); // take any necessary wrapup action.
return (long) TRUE; // we agree to end session.
// If we return TRUE we are saying it's ok with us to end the
// windows session.
close_isql(); // take any necessary wrapup action.
return (long) TRUE; // we agree to end session.
case WM_CLOSE:
// Tell windows to destroy our window.
// Tell windows to destroy our window.
DestroyWindow(hWnd);
break;
default:
// Let windows handle all messages we choose to ignore.
// Let windows handle all messages we choose to ignore.
return DefWindowProc(hWnd, message, wParam, lParam);
}
@ -857,28 +857,28 @@ static int cmdline_isql( HINSTANCE hInstance, LPSTR pCmdLine)
* return from ISQL
*
********************************************************************/
FILE *inputfile; // input file
FILE *outputfile; // output file
SCHAR inputfilename[MAXPATHLEN]; // input file name
SCHAR outputfilename[MAXPATHLEN]; // output file name
SCHAR arg[MAXPATHLEN]; // current argument
FILE *inputfile; // input file
FILE *outputfile; // output file
SCHAR inputfilename[MAXPATHLEN]; // input file name
SCHAR outputfilename[MAXPATHLEN]; // output file name
SCHAR arg[MAXPATHLEN]; // current argument
const SCHAR *cp; // command line cursor
SCHAR *ap; // current argument cursor
SCHAR *ap; // current argument cursor
// create default input and output files
// create default input and output files
if (!open_temp_file
(hInstance, &inputfile, inputfilename, IDS_TEMP_IN_FILE)) return 0;
if (!open_temp_file
(hInstance, &outputfile, outputfilename, IDS_TEMP_OUT_FILE)) return 0;
// create failsafe input file
// create failsafe input file
fprintf(inputfile, "QUIT;\n");
fclose(inputfile);
fclose(outputfile);
// create an argument vector, including the default files and command line args
// create an argument vector, including the default files and command line args
ISQL_cursor = ISQL_args;
ISQL_argc = 0;
@ -922,7 +922,7 @@ static void display_page( HWND hWnd)
***************************************************************/
FILE *fh;
// Determine file size and some display paramaters.
// Determine file size and some display paramaters.
nVscrollPos = numlines;
numlines = 0;
maxwidth = 0;
@ -939,11 +939,11 @@ static void display_page( HWND hWnd)
}
opf = fopen(defOutputFile, "a");
// Go setup scroll ranges for this file.
// Go setup scroll ranges for this file.
setup_scroll(hWnd);
// Show first part of file.
// Show first part of file.
InvalidateRect(hWnd, NULL, TRUE);
UpdateWindow(hWnd);
@ -980,7 +980,7 @@ static SSHORT init_isql(
DLGPROC dlgProc;
int iReturn;
// perform instance dependant Windows initialization
// perform instance dependant Windows initialization
if (!hPrevInstance)
init_isql_first(hInstance);
@ -989,11 +989,11 @@ static SSHORT init_isql(
init_isql_added(hPrevInstance);
#endif
// perform common instance Windows initialization
// perform common instance Windows initialization
init_isql_every(hInstance, cmdShow);
// open all the files
// open all the files
if (!open_temp_file(hInstance, &ipf, defInputFile, IDS_DEF_IN_FILE))
return FALSE;
@ -1042,7 +1042,7 @@ static void init_isql_added( HINSTANCE hPrevInstance)
*
*********************************************************************/
// get the results of the initialization of first instance
// get the results of the initialization of first instance
GetInstanceData(hPrevInstance, (BYTE *) & SetUpData, sizeof(SETUPDATA));
}
@ -1071,28 +1071,28 @@ static void init_isql_every( HINSTANCE hInstance, int cmdShow)
TEXTMETRIC tm;
HDC hDC;
hInst = hInstance; // save for use by window procs
hInst = hInstance; // save for use by window procs
// Create applications main window.
// Create applications main window.
hWndMain = CreateWindow(SetUpData.appName, // window class name
SetUpData.appName, // window title
WS_OVERLAPPEDWINDOW | // type of window
WS_HSCROLL | WS_VSCROLL, CW_USEDEFAULT, // x window location
CW_USEDEFAULT, // y
CW_USEDEFAULT, // cx and size
CW_USEDEFAULT, // cy
NULL, // no parent for this window
NULL, // use the class menu
hInstance, // who created this window
NULL // no parms to pass on
hWndMain = CreateWindow(SetUpData.appName, // window class name
SetUpData.appName, // window title
WS_OVERLAPPEDWINDOW | // type of window
WS_HSCROLL | WS_VSCROLL, CW_USEDEFAULT, // x window location
CW_USEDEFAULT, // y
CW_USEDEFAULT, // cx and size
CW_USEDEFAULT, // cy
NULL, // no parent for this window
NULL, // use the class menu
hInstance, // who created this window
NULL // no parms to pass on
);
// Get the display context.
// Get the display context.
hDC = GetDC(hWndMain);
// Build fixed screen font.
// Build fixed screen font.
cursfont.lfHeight = 14;
cursfont.lfWidth = 9;
@ -1111,11 +1111,11 @@ static void init_isql_every( HINSTANCE hInstance, int cmdShow)
hnewsfont = CreateFontIndirect((LPLOGFONT) & cursfont);
// Install the font in the current display context.
// Install the font in the current display context.
holdsfont = SelectObject(hDC, hnewsfont);
// get text metrics for paint
// get text metrics for paint
GetTextMetrics(hDC, &tm);
xChar = tm.tmAveCharWidth;
@ -1123,11 +1123,11 @@ static void init_isql_every( HINSTANCE hInstance, int cmdShow)
yCharnl = tm.tmHeight;
numlines = 0;
// Release the display context.
// Release the display context.
ReleaseDC(hWndMain, hDC);
// Update display of main window.
// Update display of main window.
ShowWindow(hWndMain, cmdShow);
UpdateWindow(hWndMain);
@ -1152,14 +1152,14 @@ static void init_isql_first( HINSTANCE hInstance)
********************************************************************/
WNDCLASS wcISQLClass;
// Get string from resource with application name.
// Get string from resource with application name.
LoadString(hInstance, IDS_NAME, (LPSTR) SetUpData.appName, 20);
LoadString(hInstance, IDS_MENUNAME, (LPSTR) SetUpData.menuName, 20);
LoadString(hInstance, IDS_ICONNAME, (LPSTR) SetUpData.iconName, 20);
LoadString(hInstance, IDS_ERROR, (LPSTR) SetUpData.errorString, 20);
// Define the window class for this application.
// Define the window class for this application.
wcISQLClass.lpszClassName = SetUpData.appName;
wcISQLClass.hInstance = hInstance;
@ -1172,7 +1172,7 @@ static void init_isql_first( HINSTANCE hInstance)
wcISQLClass.cbClsExtra = 0;
wcISQLClass.cbWndExtra = 0;
// Register the class
// Register the class
RegisterClass(&wcISQLClass);
}
@ -1238,12 +1238,12 @@ static int windows_isql(
********************************************************************/ \
MSG msg;
// Go init this application.
// Go init this application.
if (!init_isql(hInstance, hPrevInstance, cmdShow))
return 0;
// Get and dispatch messages for this applicaton.
// Get and dispatch messages for this applicaton.
while (GetMessage(&msg, NULL, NULL, NULL)) {
TranslateMessage(&msg);
@ -1281,28 +1281,28 @@ static void paint_isql( HWND hWnd)
BeginPaint(hWnd, (LPPAINTSTRUCT) & ps);
hDC = ps.hdc;
// Establish fixed font in display context.
// Establish fixed font in display context.
SelectObject(hDC, hnewsfont);
if (numlines) {
// Open the file to display
// (files should not stay open over multiple windows messages)
// Open the file to display
// (files should not stay open over multiple windows messages)
hfile = fopen(defOutputFile, "r");
if (hfile) {
// Skip lines outside window limits
// Skip lines outside window limits
for (i = 0; i < nVscrollPos; i++)
fgets(buf, sizeof(buf), hfile);
// Read visible lines
// Read visible lines
for (i = 0; i < nPageMaxLines; i++) {
if (!fgets(buf, sizeof(buf), hfile))
break;
// figure out shortest text to put
// figure out shortest text to put
for (e = strlen(buf); e >= 0; e--)
if (buf[e] > ' ' && buf[e] <= '~')
@ -1363,7 +1363,7 @@ static void setup_scroll( HWND hWnd)
*
*********************************************************************/
// numlines established during open
// numlines established during open
nVscrollMax = max(0, numlines - yClient / yChar);
nVscrollPos = min(nVscrollPos, nVscrollMax);
@ -1665,7 +1665,7 @@ BOOL CALLBACK _export createDbDlgProc(HWND hDlg,
break;
case IDCANCEL:
// Terminate this dialog box.
// Terminate this dialog box.
EndDialog(hDlg, FALSE);
break;
@ -1739,7 +1739,7 @@ BOOL CALLBACK _export dbNameDlgProc(HWND hDlg,
break;
case IDCANCEL:
// Terminate this dialog box.
// Terminate this dialog box.
EndDialog(hDlg, FALSE);
break;
@ -1795,7 +1795,7 @@ BOOL CALLBACK _export dropDbDlgProc(HWND hDlg,
break;
case IDCANCEL:
// Terminate this dialog box.
// Terminate this dialog box.
EndDialog(hDlg, FALSE);
break;
@ -1963,7 +1963,7 @@ BOOL CALLBACK _export extractDlgProc(HWND hDlg,
break;
case IDCANCEL:
// Terminate this dialog box.
// Terminate this dialog box.
EndDialog(hDlg, FALSE);
break;
@ -2173,7 +2173,7 @@ BOOL CALLBACK _export scriptDlgProc(HWND hDlg,
break;
case IDCANCEL:
// Terminate this dialog box.
// Terminate this dialog box.
EndDialog(hDlg, FALSE);
break;

View File

@ -527,7 +527,7 @@ private:
{
if (aux(obj, flags, search, end_search, match, end_match))
return true;
if (search < end_search)
{
const CharType d = *search++;
@ -545,18 +545,18 @@ private:
{
if (search >= end_search)
return false;
search++;
}
else {
if (++match >= end_match)
return true;
for (;;)
{
if (aux(obj, flags, search, end_search, match, end_match))
return true;
if (++search >= end_search)
return false;
}
@ -581,7 +581,7 @@ private:
{
if (aux(obj, flags, search, end_search, match, end_match))
return true;
if (search < end_search)
{
if (!className(obj, flags, char_class, end_class, *search++))
@ -622,7 +622,7 @@ private:
// Japanese version operates on short-based buffer,
// instead of SCHAR-based.
static bool className(Jrd::TextType* obj, USHORT flags,
const CharType* char_class, const CharType* const end_class,
const CharType* char_class, const CharType* const end_class,
CharType character)
{
fb_assert(char_class != NULL);
@ -656,9 +656,9 @@ private:
}
// Merge the matching pattern and control strings to give a cannonical
// matching pattern. Return the length of the combined string.
// matching pattern. Return the length of the combined string.
//
// What this routine does is to take the language template, strip off
// What this routine does is to take the language template, strip off
// the prefix and put it in the output string, then parse the definitions
// into an array of character pointers. The index array is the defined
// character. The routine then takes the actual match pattern and uses
@ -738,7 +738,7 @@ private:
while (*p)
*comb++ = *p++;
// if we've got the definition of a quote character,
// if we've got the definition of a quote character,
// slurp the next character too
if (comb > combined && comb[-1] == *(CharType*) obj->getCanonicalChar(CHAR_GDML_QUOTE) && *match)
@ -932,7 +932,7 @@ Collation* Collation::createInstance(MemoryPool& pool, TTYPE_ID id, texttype* tt
MatchesMatcherULongCanonical, SleuthMatcherULongCanonical>(id, tt, cs);
}
fb_assert(false);
fb_assert(false);
return NULL; // compiler silencer
}

View File

@ -1,5 +1,5 @@
/*
* PROGRAM:
* PROGRAM:
* MODULE: DataTypeUtil.cpp
* DESCRIPTION: Data Type Utility functions
*
@ -40,7 +40,7 @@ using namespace Firebird;
SSHORT DataTypeUtilBase::getResultBlobSubType(const dsc* value1, const dsc* value2)
{
{
SSHORT subType1 = value1->getBlobSubType();
SSHORT subType2 = value2->getBlobSubType();
@ -71,40 +71,40 @@ USHORT DataTypeUtilBase::getResultTextType(const dsc* value1, const dsc* value2)
void DataTypeUtilBase::makeFromList(dsc* result, const char* expressionName, int argsCount, const dsc** args)
{
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// [Arno Brinkman] 2003-08-23
//
//
// This function is made to determine a output descriptor from a given list
// of expressions according to the latest SQL-standard that was available.
// (ISO/ANSI SQL:200n WG3:DRS-013 H2-2002-358 August, 2002)
//
// (ISO/ANSI SQL:200n WG3:DRS-013 H2-2002-358 August, 2002)
//
// If any datatype has a character type then :
// - the output will always be a character type except unconvertable types.
// (dtype_text, dtype_cstring, dtype_varying, dtype_blob sub_type TEXT)
// !! Currently engine cannot convert string to BLOB therefor BLOB isn't allowed. !!
// - first character-set and collation are used as output descriptor.
// - if all types have datatype CHAR then output should be CHAR else
// - if all types have datatype CHAR then output should be CHAR else
// VARCHAR and with the maximum length used from the given list.
//
// If all of the datatypes are EXACT numeric then the output descriptor
// shall be EXACT numeric with the maximum scale and the maximum precision
//
// If all of the datatypes are EXACT numeric then the output descriptor
// shall be EXACT numeric with the maximum scale and the maximum precision
// used. (dtype_byte, dtype_short, dtype_long, dtype_int64)
//
//
// If any of the datatypes is APPROXIMATE numeric then each datatype in the
// list shall be numeric else a error is thrown and the output descriptor
// list shall be numeric else a error is thrown and the output descriptor
// shall be APPROXIMATE numeric. (dtype_real, dtype_double, dtype_d_float)
//
//
// If any of the datatypes is a datetime type then each datatype in the
// list shall be the same datetime type else a error is thrown.
// numeric. (dtype_sql_date, dtype_sql_time, dtype_timestamp)
//
//
// If any of the datatypes is a BLOB datatype then :
// - all types should be a BLOB else throw error.
// - all types should have the same sub_type else throw error.
// - when TEXT type then use first character-set and collation as output
// descriptor.
// (dtype_blob)
//
//
//--------------------------------------------------------------------------
// Initialize values.
@ -161,10 +161,10 @@ void DataTypeUtilBase::makeFromList(dsc* result, const char* expressionName, int
}
else {
if (all_equal) {
all_equal =
all_equal =
(max_dtype == arg->dsc_dtype) &&
(max_scale == arg->dsc_scale) &&
(max_length == arg->dsc_length) &&
(max_scale == arg->dsc_scale) &&
(max_length == arg->dsc_length) &&
(max_sub_type == arg->dsc_sub_type);
}
}
@ -175,7 +175,7 @@ void DataTypeUtilBase::makeFromList(dsc* result, const char* expressionName, int
// Is there any approximate numeric?
if (DTYPE_IS_APPROX(arg->dsc_dtype)) {
any_approx = true;
// Dialect 1 NUMERIC and DECIMAL are stored as sub-types
// Dialect 1 NUMERIC and DECIMAL are stored as sub-types
// 1 and 2 from float types dtype_real, dtype_double
if (!any_float) {
any_float = (arg->dsc_sub_type == 0);
@ -218,11 +218,11 @@ void DataTypeUtilBase::makeFromList(dsc* result, const char* expressionName, int
if (DTYPE_IS_TEXT(arg->dsc_dtype) ||
(arg->dsc_dtype == dtype_blob && arg->dsc_sub_type == isc_blob_text))
{
// Pick first characterset-collate from args-list
//
// Is there an better way to determine the
// characterset / collate from the list ?
// Maybe first according SQL-standard which has an order
// Pick first characterset-collate from args-list
//
// Is there an better way to determine the
// characterset / collate from the list ?
// Maybe first according SQL-standard which has an order
// UTF32 -> UTF16 -> UTF8 then by a Firebird specified order
//
// At least give any first charset other than ASCII/NONE precedence
@ -351,7 +351,7 @@ void DataTypeUtilBase::makeFromList(dsc* result, const char* expressionName, int
// If all of the arguments are from type text use a text type.
// Firebird behaves a little bit different than standard here, because
// any datatype (except BLOB) can be converted to a character-type we
// allow to use numeric and datetime types together with a
// allow to use numeric and datetime types together with a
// character-type, but output will always be varying !
if (all_text || (any_text && (any_numeric || any_datetime))) {
if (any_text_blob)

View File

@ -960,7 +960,7 @@ void DatabaseSnapshot::putDatabase(const Database* database,
// SQL dialect
temp = (database->dbb_flags & DBB_DB_SQL_dialect_3) ? 3 : 1;
writer.insertInt(f_mon_db_dialect, temp);
// shutdown mode
if (database->dbb_ast_flags & DBB_shutdown_full)
temp = shut_mode_full;

View File

@ -54,7 +54,7 @@ void DBG_parse_debug_info(USHORT length, const UCHAR* data, Firebird::DbgInfo& d
bad_format = true;
}
while (!bad_format && (data < end))
while (!bad_format && (data < end))
{
switch (*data++)
{

View File

@ -45,7 +45,7 @@
using namespace Firebird;
namespace
namespace
{
class ModulesMap : public GenericMap<Pair<Left<PathName, ModuleLoader::Module*> > >
{
@ -243,7 +243,7 @@ const IntlManager::CharSetAliasDefinition IntlManager::defaultCharSetAliases[] =
{"GB2312", CS_GB2312},
{"DOS_936", CS_GB2312},
{"WIN_936", CS_GB2312},
{NULL, 0}
{NULL, 0}
};
const IntlManager::CollationDefinition IntlManager::defaultCollations[] =
@ -566,7 +566,7 @@ bool IntlManager::lookupCharSet(const Firebird::string& charSetName, charset* cs
else
{
ModuleLoader::Module* module;
if (modules->get(externalInfo.moduleName, module) && module)
module->findSymbol(STRINGIZE(CHARSET_ENTRYPOINT), lookupFunction);
}
@ -601,7 +601,7 @@ bool IntlManager::lookupCollation(const Firebird::string& collationName,
else
{
ModuleLoader::Module* module;
if (modules->get(collationExternalInfo.moduleName, module) && module)
module->findSymbol(STRINGIZE(TEXTTYPE_ENTRYPOINT), lookupFunction);
}
@ -638,7 +638,7 @@ bool IntlManager::setupCollationAttributes(
else
{
ModuleLoader::Module* module;
if (modules->get(collationExternalInfo.moduleName, module) && module)
module->findSymbol(STRINGIZE(INTL_SETUP_ATTRIBUTES_ENTRYPOINT), attributesFunction);
}

View File

@ -144,7 +144,7 @@ bool IntlUtil::parseSpecificAttributes(
while (p < end)
{
uSize = cs->getConvToUnicode().convert(size, p, sizeof(uc), uc);
if (uSize == 2 &&
((*(USHORT*)uc >= 'A' && *(USHORT*)uc <= 'Z') ||
(*(USHORT*)uc >= 'a' && *(USHORT*)uc <= 'z') ||
@ -478,7 +478,7 @@ ULONG IntlUtil::toLower(Jrd::CharSet* cs, ULONG srcLen, const UCHAR* src, ULONG
// convert to lowercase
Firebird::HalfStaticArray<UCHAR, BUFFER_SMALL> lower_str;
srcLen = UnicodeUtil::utf16LowerCase(srcLen, Firebird::Aligner<USHORT>(utf16_ptr, srcLen),
utf16_length, Firebird::OutAligner<USHORT>(lower_str.getBuffer(utf16_length), utf16_length),
utf16_length, Firebird::OutAligner<USHORT>(lower_str.getBuffer(utf16_length), utf16_length),
exceptions);
// convert to original character set
@ -504,7 +504,7 @@ ULONG IntlUtil::toUpper(Jrd::CharSet* cs, ULONG srcLen, const UCHAR* src, ULONG
// convert to uppercase
Firebird::HalfStaticArray<UCHAR, BUFFER_SMALL> upper_str;
srcLen = UnicodeUtil::utf16UpperCase(srcLen, Firebird::Aligner<USHORT>(utf16_ptr, srcLen),
utf16_length, Firebird::OutAligner<USHORT>(upper_str.getBuffer(utf16_length), utf16_length),
utf16_length, Firebird::OutAligner<USHORT>(upper_str.getBuffer(utf16_length), utf16_length),
exceptions);
// convert to original character set
@ -580,7 +580,7 @@ string IntlUtil::escapeAttribute(Jrd::CharSet* cs, const string& s)
{
*(USHORT*)uc = '\\';
UCHAR bytes[sizeof(ULONG)];
ULONG bytesSize = cs->getConvFromUnicode().convert(
sizeof(USHORT), uc, sizeof(bytes), bytes);

Some files were not shown because too many files have changed in this diff Show More