8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 10:03:03 +01:00
This commit is contained in:
brodsom 2003-09-22 14:13:54 +00:00
parent 679eeb2be1
commit c595b5fa4b
5 changed files with 59 additions and 45 deletions

View File

@ -24,7 +24,7 @@
//
//____________________________________________________________
//
// $Id: alice.cpp,v 1.35 2003-09-18 10:56:32 brodsom Exp $
// $Id: alice.cpp,v 1.36 2003-09-22 14:11:14 brodsom Exp $
//
// 2001.07.06 Sean Leyne - Code Cleanup, removed "#ifdef READONLY_DATABASE"
// conditionals, as the engine now fully supports
@ -198,7 +198,7 @@ int common_main(int argc,
fAnsiCP = (GetConsoleCP() == GetACP());
#endif
volatile tgbl* tdgbl = (tgbl*) gds__alloc(sizeof(*tdgbl));
volatile tgbl* tdgbl = (tgbl*) gds__alloc(sizeof(tgbl));
if (!tdgbl) {
// NOMEM: return error, FREE: during function exit in the SETJMP
return FINI_ERROR;
@ -206,7 +206,7 @@ int common_main(int argc,
SET_THREAD_DATA;
SVC_PUTSPECIFIC_DATA;
memset((void *) tdgbl, 0, sizeof(*tdgbl));
memset((void *) tdgbl, 0, sizeof(tgbl));
tdgbl->output_proc = output_proc;
tdgbl->output_data = output_data;
tdgbl->ALICE_permanent_pool = NULL;

View File

@ -125,7 +125,7 @@ const char* SWITCH_CHAR = "-";
#endif
const char* OUTPUT_SUPPRESS = "SUPPRESS";
const char* output_suppress = "SUPPRESS";
const int BURP_MSG_FAC = 12;
enum gbak_action
@ -161,7 +161,7 @@ const ULONG GBYTE = MBYTE * KBYTE;
static bool fAnsiCP = false;
static inline void translate_cp(SCHAR *a){
if (!fAnsiCP)
AnsiToOem(a, a)
AnsiToOem(a, a);
}
#else
static inline void translate_cp(SCHAR *a){
@ -281,7 +281,7 @@ int CLIB_ROUTINE main(int argc, char* argv[])
if (!string[1])
string = "-*NONE*";
const in_sw_tab_t* in_sw_tab = burp_in_sw_table;
const TEXT *q;
const TEXT *q;
for (; q = in_sw_tab->in_sw_name; in_sw_tab++)
{
TEXT c;
@ -423,7 +423,7 @@ int common_main(int argc,
//tgbl thd_context;
volatile gbak_action action = QUIT;
volatile tgbl *tdgbl = (tgbl*) gds__alloc(sizeof(*tdgbl));
volatile tgbl *tdgbl = (tgbl*) gds__alloc(sizeof(tgbl));
// NOMEM: return error, FREE: during function exit in the SETJMP
if (tdgbl == NULL)
{
@ -435,7 +435,7 @@ int common_main(int argc,
SET_THREAD_DATA;
SVC_PUTSPECIFIC_DATA;
memset((void *) tdgbl, 0, sizeof(*tdgbl));
memset((void *) tdgbl, 0, sizeof(tgbl));
tdgbl->burp_env = reinterpret_cast<UCHAR*>(env);
tdgbl->file_desc = INVALID_HANDLE_VALUE;
tdgbl->output_proc = output_proc;
@ -692,10 +692,10 @@ int common_main(int argc,
const TEXT *p = redirect;
TEXT c;
string = const_cast<TEXT*>(OUTPUT_SUPPRESS);
const TEXT *q = output_suppress;
tdgbl->sw_redirect = NOOUTPUT;
while (c = *p++) {
if (UPPER(c) != *string++) {
if (UPPER(c) != *q++) {
tdgbl->sw_redirect = REDIRECT;
break;
}
@ -2002,7 +2002,7 @@ static int api_gbak(int argc,
tgbl ldgbl;
tgbl* tdgbl = &ldgbl;
SET_THREAD_DATA;
memset((void *) tdgbl, 0, sizeof(*tdgbl));
memset((void *) tdgbl, 0, sizeof(tgbl));
tdgbl->output_proc = output_main;
TEXT *usr, *pswd;

View File

@ -41,11 +41,11 @@
#include <unistd.h>
#endif
static inline UCHAR* BURP_alloc(int size){
return MISC_alloc_burp((ULONG) size);
static inline UCHAR* BURP_alloc(ULONG size){
return MISC_alloc_burp(size);
}
static inline UCHAR* BURP_alloc_zero(int size){
return MISC_alloc_burp((ULONG) size);
static inline UCHAR* BURP_alloc_zero(ULONG size){
return MISC_alloc_burp(size);
}
static inline void BURP_free(void *block){
MISC_free_burp(block);
@ -613,7 +613,7 @@ typedef struct gfld {
USHORT gfld_flags;
} *GFLD;
enum gfld_flags_vals{
enum gfld_flags_vals {
GFLD_validation_blr = 1,
GFLD_validation_source = 2,
GFLD_validation_source2 = 4
@ -931,7 +931,7 @@ inline static ULONG BURP_UP_TO_BLOCK(ULONG size)
/* Burp Messages */
enum burp_messages_vals{
enum burp_messages_vals {
msgVerbose_write_charsets = 211,
msgVerbose_write_collations = 212,
msgErr_restore_charset = 213,

View File

@ -28,7 +28,7 @@
*
*/
/*
$Id: canonical.cpp,v 1.26 2003-09-18 21:56:26 brodsom Exp $
$Id: canonical.cpp,v 1.27 2003-09-22 14:13:53 brodsom Exp $
*/
#include "firebird.h"
@ -78,7 +78,7 @@ static xdr_t::xdr_ops burp_ops =
burp_destroy
};
const int INCREMENT = 1024;
const int increment = 1024;
ULONG CAN_encode_decode(BURP_REL relation,
@ -464,7 +464,7 @@ static bool_t expand_buffer( XDR * xdrs)
LSTRING *buffer;
buffer = (LSTRING *) xdrs->x_public;
length = (xdrs->x_private - xdrs->x_base) + xdrs->x_handy + INCREMENT;
length = (xdrs->x_private - xdrs->x_base) + xdrs->x_handy + increment;
buffer->lstr_allocated = buffer->lstr_length = length;
caddr_t new_ = (caddr_t) BURP_alloc(length);
@ -476,7 +476,7 @@ static bool_t expand_buffer( XDR * xdrs)
xdrs->x_base = new_;
xdrs->x_private = p;
xdrs->x_handy += INCREMENT;
xdrs->x_handy += increment;
buffer->lstr_address = (UCHAR *) new_;

View File

@ -24,7 +24,7 @@
* 2003.08.17 Claudio Valderrama: Fix SF Bug #750659.
*/
/*
$Id: restore.epp,v 1.45 2003-09-20 23:24:14 brodsom Exp $
$Id: restore.epp,v 1.46 2003-09-22 14:13:52 brodsom Exp $
*/
#include "firebird.h"
@ -122,11 +122,6 @@ const struct s_t_cvtbl {
{230, CS_EUCJ, 0} /* codepoint collation */
};
/* When skipping started, scan_next_attr will be changed from NO_SKIP */
/* to BEFORE_SKIP. When scanning for next valid attribute after skipping, */
/* it will flip-flop between BEFORE_SKIP and AFTER_SKIP. When next valid */
/* attribute is found, it will be changed back to NO_SKIP by 'SKIP_SCAN' */
enum scan_attr_t {
NO_SKIP = 0, /* Not in skipping and scanning mode */
BEFORE_SKIP = 1, /* After skipping, before scanning next byte for valid attribute */
@ -238,10 +233,16 @@ inline UCHAR* get_block(tgbl* tdgbl, UCHAR* p, ULONG n)
return MVOL_read_block(tdgbl, p, n);
}
// When skipping started, scan_next_attr will be changed from NO_SKIP
// to BEFORE_SKIP. When scanning for next valid attribute after skipping,
// it will flip-flop between BEFORE_SKIP and AFTER_SKIP. When next valid
// attribute is found, it will be changed back to NO_SKIP by 'SKIP_SCAN'
static inline void SKIP_INIT(scan_attr_t *scan_next_attr)
{
*scan_next_attr = NO_SKIP;
}
static inline bool SKIP_SCAN(scan_attr_t *scan_next_attr)
{
return (*scan_next_attr == AFTER_SKIP ?
@ -452,8 +453,11 @@ int RESTORE_restore (TEXT *file_name,
if (gds_status [1])
general_on_error ();
/* Check to see if there is a warning */
if (gds_status [0] == gds_arg_gds && gds_status [1] == 0 && gds_status [2] != gds_arg_end)
BURP_print_warning (gds_status);
if (gds_status [0] == gds_arg_gds && gds_status [1] == 0
&& gds_status [2] != gds_arg_end)
{
BURP_print_warning (gds_status);
}
}
EXEC SQL SET TRANSACTION ISOLATION LEVEL READ COMMITTED NO_AUTO_UNDO;
@ -550,8 +554,11 @@ int RESTORE_restore (TEXT *file_name,
END_ERROR;
/* Check to see if there is a warning */
if (gds_status [0] == gds_arg_gds && gds_status [1] == 0 && gds_status [2] != gds_arg_end)
if (gds_status [0] == gds_arg_gds && gds_status [1] == 0
&& gds_status [2] != gds_arg_end)
{
BURP_print_warning (gds_status);
}
BURP_verbose (88, NULL, NULL, NULL, NULL, NULL);
/* msg 88 finishing, closing, and going home */
@ -592,7 +599,8 @@ int RESTORE_restore (TEXT *file_name,
/* set sync writes to engine default */
*d++ = (UCHAR) gds_dpb_force_write;
*d++ = 1;
*d++ = (UCHAR) tdgbl->hdr_forced_writes; /* set forced writes to the value which was in the header */
*d++ = (UCHAR) tdgbl->hdr_forced_writes;
// set forced writes to the value which was in the header
SSHORT l = d - dpb;
// long? Are you sure? Why not FRBRD* ???
@ -711,8 +719,9 @@ void add_files (const UCHAR *file_name)
file->fil_length -= start - 1;
else
{
BURP_print (96, (void*) file->fil_length, (void*) (start - 1), NULL, NULL, NULL);
/* msg 96 length given for initial file (%ld) is less than minimum (%ld) */
BURP_print (96, (void*) file->fil_length, (void*) (start - 1), NULL,
NULL, NULL);
// msg 96 length given for initial file (%ld) is less than minimum (%ld)
file->fil_length = 0;
}
@ -767,7 +776,8 @@ void bad_attribute (scan_attr_t scan_next_attr,
if (!tdgbl->gbl_sw_skip_count)
{
gds__msg_format (NULL, 12, type, sizeof(t_name), t_name, NULL, NULL, NULL, NULL, NULL);
gds__msg_format(NULL, 12, type, sizeof(t_name), t_name, NULL, NULL,
NULL, NULL, NULL);
BURP_print (80, t_name, (void*) bad_attr, NULL, NULL, NULL);
/* msg 80 don't recognize %s attribute %ld -- continuing */
skip_l = get(tdgbl);
@ -919,7 +929,8 @@ void create_database (const TEXT *file_name)
if (tdgbl->gbl_sw_page_size &&
(tdgbl->gbl_sw_page_size < page_size))
{
BURP_print (110, (void*) page_size, (void*) (ULONG) tdgbl->gbl_sw_page_size, NULL, NULL, NULL);
BURP_print (110, (void*) page_size,
(void*) (ULONG) tdgbl->gbl_sw_page_size, NULL, NULL, NULL);
/* msg 110 Reducing the database page size from %ld bytes to %ld bytes */
}
@ -1593,7 +1604,8 @@ void get_array (BURP_REL relation,
for (range = field->fld_ranges, count = 0; range < end_ranges;
range += 2, count++)
{
stuff(&blr, gds_sdl_do2); stuff(&blr, count);
stuff(&blr, gds_sdl_do2);
stuff(&blr, count);
//
// Normally we loop through all dimensions chopping off slices
// and writing them. This works fine but this also means that
@ -2095,7 +2107,8 @@ bool get_character_set (void)
case att_charset_name:
X.RDB$CHARACTER_SET_NAME.NULL = FALSE;
GET_TEXT(X.RDB$CHARACTER_SET_NAME);
BURP_verbose (msgVerbose_restore_charset, X.RDB$CHARACTER_SET_NAME, NULL, NULL, NULL, NULL);
BURP_verbose (msgVerbose_restore_charset,
X.RDB$CHARACTER_SET_NAME, NULL, NULL, NULL, NULL);
break;
case att_charset_form:
@ -2238,7 +2251,8 @@ bool get_collation (void)
case att_coll_name:
X.RDB$COLLATION_NAME.NULL = FALSE;
GET_TEXT(X.RDB$COLLATION_NAME);
BURP_verbose (msgVerbose_restore_collation, X.RDB$COLLATION_NAME, NULL, NULL, NULL, NULL);
BURP_verbose(msgVerbose_restore_collation, X.RDB$COLLATION_NAME,
NULL, NULL, NULL, NULL);
break;
case att_coll_id:
@ -3203,29 +3217,29 @@ bool get_files (void)
/* msg 116 restoring file %s */
X.RDB$FILE_NAME, NULL, NULL, NULL, NULL);
break;
case att_file_sequence:
X.RDB$FILE_SEQUENCE = (USHORT) get_numeric();
break;
case att_file_start:
X.RDB$FILE_START = get_numeric();
break;
case att_file_length:
X.RDB$FILE_LENGTH = get_numeric();
break;
case att_file_flags:
X.RDB$FILE_FLAGS |= get_numeric();
break;
case att_shadow_number:
X.RDB$SHADOW_NUMBER = (USHORT) get_numeric();
if (tdgbl->gbl_sw_kill && X.RDB$SHADOW_NUMBER)
X.RDB$FILE_FLAGS |= FILE_inactive;
break;
default:
bad_attribute (scan_next_attr, attribute, 85);
/* msg 85 file */
@ -3392,7 +3406,7 @@ bool get_function (void)
return true;
}
void get_function_arg (void)
void get_function_arg()
{
/**************************************
*