mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:03:03 +01:00
Misc + gcc warning hunting
This commit is contained in:
parent
2eb7007e75
commit
6e735f7c53
@ -52,9 +52,9 @@ static int foo = init();
|
||||
|
||||
int init()
|
||||
{
|
||||
charTable['<'] = quoted;
|
||||
charTable['>'] = quoted;
|
||||
charTable['&'] = quoted;
|
||||
charTable[(UCHAR)'<'] = quoted;
|
||||
charTable[(UCHAR)'>'] = quoted;
|
||||
charTable[(UCHAR)'&'] = quoted;
|
||||
|
||||
for (int n = 0; n < 10; ++n)
|
||||
charTable[n] = illegal;
|
||||
|
@ -202,8 +202,10 @@ static void field_unknown(const TEXT*, const TEXT*, const dsql_nod*);
|
||||
static dsql_par* find_dbkey(const dsql_req*, const dsql_nod*);
|
||||
static dsql_par* find_record_version(const dsql_req*, const dsql_nod*);
|
||||
static dsql_ctx* get_context(const dsql_nod* node);
|
||||
#ifdef NOT_USED_OR_REPLACED
|
||||
static bool get_object_and_field(const dsql_nod* node,
|
||||
const char** obj_name, const char** fld_name, bool do_collation);
|
||||
#endif
|
||||
static bool invalid_reference(const dsql_ctx*, const dsql_nod*,
|
||||
const dsql_nod*, bool, bool);
|
||||
static bool node_match(const dsql_nod*, const dsql_nod*, bool);
|
||||
@ -825,7 +827,7 @@ dsql_nod* PASS1_node(dsql_req* request, dsql_nod* input, bool proc_flag)
|
||||
// ordering behavior unconditionally.
|
||||
(USHORT)(IPTR) input->nod_arg[e_par_index],
|
||||
NULL);
|
||||
node->nod_arg[e_par_index] = (dsql_nod*) ((dsql_par*) node->nod_arg[e_par_parameter])->par_index;
|
||||
node->nod_arg[e_par_index] = (dsql_nod*) (IPTR) ((dsql_par*) node->nod_arg[e_par_parameter])->par_index;
|
||||
return node;
|
||||
|
||||
case nod_param_val:
|
||||
@ -1049,7 +1051,7 @@ dsql_nod* PASS1_node(dsql_req* request, dsql_nod* input, bool proc_flag)
|
||||
dsql_nod* const_node = input->nod_arg[0];
|
||||
if (const_node) {
|
||||
fb_assert(const_node->nod_type == nod_constant);
|
||||
const int precision = (int)(IPTR) const_node->nod_arg[0];
|
||||
const size_t precision = (size_t) (IPTR) const_node->nod_arg[0];
|
||||
fb_assert(precision >= 0);
|
||||
if (precision > MAX_TIME_PRECISION) {
|
||||
ERRD_post(isc_invalid_time_precision,
|
||||
@ -2442,7 +2444,7 @@ static dsql_nod* explode_outputs( dsql_req* request, const dsql_prc* procedure)
|
||||
p_node->nod_count = 0;
|
||||
dsql_par* parameter =
|
||||
MAKE_parameter(request->req_receive, true, true, 0, NULL);
|
||||
p_node->nod_arg[e_par_index] = (dsql_nod*) parameter->par_index;
|
||||
p_node->nod_arg[e_par_index] = (dsql_nod*) (IPTR) parameter->par_index;
|
||||
p_node->nod_arg[e_par_parameter] = (dsql_nod*) parameter;
|
||||
MAKE_desc_from_field(¶meter->par_desc, field);
|
||||
parameter->par_name = parameter->par_alias = field->fld_name;
|
||||
@ -2703,6 +2705,7 @@ static dsql_ctx* get_context(const dsql_nod* node)
|
||||
}
|
||||
|
||||
|
||||
#ifdef NOT_USED_OR_REPLACED
|
||||
/**
|
||||
|
||||
get_object_and_field
|
||||
@ -2755,6 +2758,7 @@ static bool get_object_and_field(const dsql_nod* node,
|
||||
|
||||
return obj_name && fld_name;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
@ -3856,7 +3860,7 @@ static dsql_nod* pass1_cursor_reference( dsql_req* request,
|
||||
temp->nod_count = 0;
|
||||
dsql_par* parameter = request->req_dbkey =
|
||||
MAKE_parameter(request->req_send, false, false, 0, NULL);
|
||||
temp->nod_arg[e_par_index] = (dsql_nod*) parameter->par_index;
|
||||
temp->nod_arg[e_par_index] = (dsql_nod*) (IPTR) parameter->par_index;
|
||||
temp->nod_arg[e_par_parameter] = (dsql_nod*) parameter;
|
||||
parameter->par_desc = source->par_desc;
|
||||
|
||||
@ -3869,7 +3873,7 @@ static dsql_nod* pass1_cursor_reference( dsql_req* request,
|
||||
temp->nod_count = 0;
|
||||
parameter = request->req_rec_version =
|
||||
MAKE_parameter(request->req_send, false, false, 0, NULL);
|
||||
temp->nod_arg[e_par_index] = (dsql_nod*) parameter->par_index;
|
||||
temp->nod_arg[e_par_index] = (dsql_nod*) (IPTR) parameter->par_index;
|
||||
temp->nod_arg[e_par_parameter] = (dsql_nod*) parameter;
|
||||
parameter->par_desc = rv_source->par_desc;
|
||||
|
||||
@ -7057,7 +7061,7 @@ static dsql_nod* pass1_returning(dsql_req* request,
|
||||
|
||||
dsql_nod* p_node = MAKE_node(nod_parameter, e_par_count);
|
||||
p_node->nod_count = 0;
|
||||
p_node->nod_arg[e_par_index] = (dsql_nod*) parameter->par_index;
|
||||
p_node->nod_arg[e_par_index] = (dsql_nod*) (IPTR) parameter->par_index;
|
||||
p_node->nod_arg[e_par_parameter] = (dsql_nod*) parameter;
|
||||
|
||||
dsql_nod* temp = MAKE_node(nod_assign, e_asgn_count);
|
||||
@ -9432,7 +9436,7 @@ static bool set_parameter_type(dsql_req* request, dsql_nod* in_node, dsql_nod* n
|
||||
true, true,
|
||||
(USHORT)(IPTR) in_node->nod_arg[e_par_index],
|
||||
NULL));
|
||||
in_node->nod_arg[e_par_index] = (dsql_nod*) parameter->par_index;
|
||||
in_node->nod_arg[e_par_index] = (dsql_nod*) (IPTR) parameter->par_index;
|
||||
}
|
||||
|
||||
DEV_BLKCHK(parameter, dsql_type_par);
|
||||
|
@ -563,7 +563,6 @@ bool CCH_exclusive_attachment(thread_db* tdbb, USHORT level, SSHORT wait_flag)
|
||||
THREAD_ENTER();
|
||||
}
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
if (tdbb->tdbb_attachment->att_flags & ATT_cancel_raise) {
|
||||
if (JRD_reschedule(tdbb, 0, false)) {
|
||||
tdbb->tdbb_attachment->att_flags &=
|
||||
@ -571,7 +570,6 @@ bool CCH_exclusive_attachment(thread_db* tdbb, USHORT level, SSHORT wait_flag)
|
||||
ERR_punt();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
tdbb->tdbb_attachment->att_flags &=
|
||||
|
@ -82,10 +82,10 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define CANCEL_OPERATION
|
||||
|
||||
#ifdef SUPERSERVER
|
||||
#define GOVERNOR
|
||||
#define CANCEL_OPERATION
|
||||
#define FB_ARCHITECTURE isc_info_db_class_server_access
|
||||
#else
|
||||
#define FB_ARCHITECTURE isc_info_db_class_classic_access
|
||||
|
@ -757,7 +757,7 @@ ENTRYPOINT("isc_rollback_retaining", jrd8_rollback_retaining,
|
||||
/**** PSI5_rollback_retaining ***/ y_valve_no_entrypoint,
|
||||
"_jrd8_rollback_retaining",
|
||||
IPI_rollback_retaining, (ISC_STATUS *, jrd_tra**))
|
||||
#ifdef CANCEL_OPERATION
|
||||
|
||||
ENTRYPOINT("gds_cancel_operation", jrd8_cancel_operation,
|
||||
/*** "jrd5_cancel_operation" ***/ NULL,
|
||||
/*** REM_cancel_operation ***/ y_valve_no_entrypoint,
|
||||
@ -769,20 +769,6 @@ ENTRYPOINT("gds_cancel_operation", jrd8_cancel_operation,
|
||||
/*** "_jrd8_cancel_operation" ***/ NULL,
|
||||
/*** IPI_cancel_operation ***/ y_valve_no_entrypoint,
|
||||
(ISC_STATUS *, Attachment**, USHORT))
|
||||
#else
|
||||
ENTRYPOINT("gds_cancel_operation",
|
||||
/*** jrd8_cancel_operation ***/ y_valve_no_entrypoint,
|
||||
/*** "jrd5_cancel_operation" ***/ NULL,
|
||||
/*** REM_cancel_operation ***/ y_valve_no_entrypoint,
|
||||
/*** "REM_cancel_operation" ***/ NULL,
|
||||
/*** CSI_cancel_operation ***/ y_valve_no_entrypoint,
|
||||
/*** RDB_cancel_operation ***/ y_valve_no_entrypoint,
|
||||
/*** PSI_cancel_operation ***/ y_valve_no_entrypoint,
|
||||
/*** PSI5_cancel_operation ***/ y_valve_no_entrypoint,
|
||||
/*** "_jrd8_cancel_operation" ***/ NULL,
|
||||
/*** IPI_cancel_operation ***/ y_valve_no_entrypoint,
|
||||
(ISC_STATUS *, Attachment**, USHORT))
|
||||
#endif
|
||||
|
||||
ENTRYPOINT("gds_intl_function", jrd8_intl_function,
|
||||
/*** "jrd5_intl_function" ***/ NULL,
|
||||
@ -1451,7 +1437,6 @@ ENTRYPOINT( "isc_rollback_retaining",
|
||||
"_jrd8_rollback_retaining",
|
||||
IPI_rollback_retaining)
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
ENTRYPOINT( "gds_cancel_operation",
|
||||
jrd8_cancel_operation,
|
||||
/*** "jrd5_cancel_operation" ***/ NULL,
|
||||
@ -1463,19 +1448,6 @@ ENTRYPOINT( "gds_cancel_operation",
|
||||
/*** PSI5_cancel_operation ***/ no_entrypoint,
|
||||
/*** "_jrd8_cancel_operation" ***/ NULL,
|
||||
/*** IPI_cancel_operation ***/ no_entrypoint)
|
||||
#else
|
||||
ENTRYPOINT( "gds_cancel_operation",
|
||||
/*** jrd8_cancel_operation ***/ no_entrypoint,
|
||||
/*** "jrd5_cancel_operation" ***/ NULL,
|
||||
/*** REM_cancel_operation ***/ no_entrypoint,
|
||||
/*** "REM_cancel_operation" ***/ NULL,
|
||||
/*** CSI_cancel_operation ***/ no_entrypoint,
|
||||
/*** RDB_cancel_operation ***/ no_entrypoint,
|
||||
/*** PSI_cancel_operation ***/ no_entrypoint,
|
||||
/*** PSI5_cancel_operation ***/ no_entrypoint,
|
||||
/*** "_jrd8_cancel_operation" ***/ NULL,
|
||||
/*** IPI_cancel_operation ***/ no_entrypoint)
|
||||
#endif
|
||||
|
||||
ENTRYPOINT( "gds_intl_function",
|
||||
jrd8_intl_function,
|
||||
|
@ -2418,17 +2418,17 @@ void* API_ROUTINE gds__temp_file(
|
||||
if (stdio_flag)
|
||||
{
|
||||
FILE* result = fopen(filename.c_str(), "w+b");
|
||||
return result ? result : (void*) -1;
|
||||
return result ? result : (void*) (IPTR) (-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (void*) open(filename.c_str(), O_RDWR | O_EXCL | O_TRUNC);
|
||||
return (void*) (IPTR) open(filename.c_str(), O_RDWR | O_EXCL | O_TRUNC);
|
||||
}
|
||||
|
||||
}
|
||||
catch (const Firebird::Exception&)
|
||||
{
|
||||
return (void*) -1;
|
||||
return (void*) (IPTR) (-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1525,7 +1525,6 @@ ISC_STATUS GDS_CANCEL_EVENTS(ISC_STATUS* user_status,
|
||||
}
|
||||
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
ISC_STATUS GDS_CANCEL_OPERATION(ISC_STATUS* user_status,
|
||||
Attachment** handle,
|
||||
USHORT option)
|
||||
@ -1585,7 +1584,6 @@ ISC_STATUS GDS_CANCEL_OPERATION(ISC_STATUS* user_status,
|
||||
|
||||
return FB_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
ISC_STATUS GDS_CLOSE_BLOB(ISC_STATUS * user_status, blb** blob_handle)
|
||||
@ -2362,9 +2360,7 @@ ISC_STATUS GDS_DETACH(ISC_STATUS* user_status, Attachment** handle)
|
||||
|
||||
V4_JRD_MUTEX_LOCK(dbb->dbb_mutexes + DBB_MUTX_init_fini);
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
attachment->att_flags |= ATT_cancel_disable;
|
||||
#endif
|
||||
|
||||
#ifdef GOVERNOR
|
||||
const ULONG attachment_flags = attachment->att_flags;
|
||||
@ -2503,9 +2499,7 @@ ISC_STATUS GDS_DROP_DATABASE(ISC_STATUS* user_status, Attachment** handle)
|
||||
isc_arg_string, "DATABASE", 0);
|
||||
}
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
attachment->att_flags |= ATT_cancel_disable;
|
||||
#endif
|
||||
|
||||
/* Here we have database locked in exclusive mode.
|
||||
Just mark the header page with an 0 ods version so that no other
|
||||
@ -4605,7 +4599,6 @@ bool JRD_reschedule(thread_db* tdbb, SLONG quantum, bool punt)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#ifdef CANCEL_OPERATION
|
||||
|
||||
// If a cancel has been raised, defer its acknowledgement
|
||||
// when executing in the context of an internal request or
|
||||
@ -4632,7 +4625,6 @@ bool JRD_reschedule(thread_db* tdbb, SLONG quantum, bool punt)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Handle request cancellation
|
||||
@ -4971,7 +4963,6 @@ static ISC_STATUS check_database(thread_db* tdbb, Attachment* attachment, ISC_ST
|
||||
return error(user_status);
|
||||
}
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
if ((attachment->att_flags & ATT_cancel_raise) &&
|
||||
!(attachment->att_flags & ATT_cancel_disable))
|
||||
{
|
||||
@ -4982,7 +4973,6 @@ static ISC_STATUS check_database(thread_db* tdbb, Attachment* attachment, ISC_ST
|
||||
*ptr++ = isc_arg_end;
|
||||
return error(user_status);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Enable signal handler for the monitoring stuff
|
||||
|
||||
|
@ -588,6 +588,7 @@ const ULONG ATT_gbak_attachment = 256; // Indicate GBAK attachment
|
||||
#ifdef GOVERNOR
|
||||
const ULONG ATT_security_db = 512; // Indicates an implicit attachment to the security db
|
||||
#endif
|
||||
|
||||
#ifdef GARBAGE_THREAD
|
||||
const ULONG ATT_notify_gc = 1024; // Notify garbage collector to expunge, purge ..
|
||||
const ULONG ATT_disable_notify_gc = 2048; // Temporarily perform own garbage collection
|
||||
@ -598,11 +599,8 @@ const ULONG ATT_NO_CLEANUP = (ATT_no_cleanup | ATT_notify_gc);
|
||||
const ULONG ATT_NO_CLEANUP = ATT_no_cleanup;
|
||||
#endif
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
const ULONG ATT_cancel_raise = 8192; // Cancel currently running operation
|
||||
const ULONG ATT_cancel_disable = 16384; // Disable cancel operations
|
||||
#endif
|
||||
|
||||
const ULONG ATT_gfix_attachment = 32768; // Indicate a GFIX attachment
|
||||
const ULONG ATT_gstat_attachment = 65536; // Indicate a GSTAT attachment
|
||||
const ULONG ATT_no_db_triggers = 131072; // Don't execute database triggers
|
||||
|
@ -48,13 +48,13 @@ ISC_STATUS jrd8_blob_info(ISC_STATUS*, Jrd::blb**, SSHORT,
|
||||
const SCHAR*, SSHORT, SCHAR*);
|
||||
ISC_STATUS jrd8_cancel_blob(ISC_STATUS *, Jrd::blb **);
|
||||
ISC_STATUS jrd8_cancel_events(ISC_STATUS *, Jrd::Attachment**, SLONG *);
|
||||
#ifdef CANCEL_OPERATION
|
||||
|
||||
#define CANCEL_disable 1
|
||||
#define CANCEL_enable 2
|
||||
#define CANCEL_raise 3
|
||||
ISC_STATUS jrd8_cancel_operation(ISC_STATUS *, Jrd::Attachment**,
|
||||
USHORT);
|
||||
#endif
|
||||
|
||||
ISC_STATUS jrd8_close_blob(ISC_STATUS *, Jrd::blb **);
|
||||
ISC_STATUS jrd8_commit_transaction(ISC_STATUS *, Jrd::jrd_tra **);
|
||||
ISC_STATUS jrd8_commit_retaining(ISC_STATUS *, Jrd::jrd_tra **);
|
||||
|
@ -112,7 +112,9 @@ static void par_procedure_parms(thread_db*, CompilerScratch*, jrd_prc*, jrd_nod*
|
||||
static jrd_nod* par_relation(thread_db*, CompilerScratch*, SSHORT, bool);
|
||||
static jrd_nod* par_rse(thread_db*, CompilerScratch*, SSHORT);
|
||||
static jrd_nod* par_sort(thread_db*, CompilerScratch*, bool);
|
||||
#ifdef NOT_USED_OR_REPLACED
|
||||
static jrd_nod* par_stream(thread_db*, CompilerScratch*);
|
||||
#endif
|
||||
static jrd_nod* par_union(thread_db*, CompilerScratch*);
|
||||
static USHORT par_word(CompilerScratch*);
|
||||
static jrd_nod* parse(thread_db*, CompilerScratch*, USHORT, USHORT expected_optional = 0);
|
||||
@ -2389,6 +2391,7 @@ static jrd_nod* par_sort(thread_db* tdbb, CompilerScratch* csb, bool flag)
|
||||
}
|
||||
|
||||
|
||||
#ifdef NOT_USED_OR_REPLACED
|
||||
static jrd_nod* par_stream(thread_db* tdbb, CompilerScratch* csb)
|
||||
{
|
||||
/**************************************
|
||||
@ -2422,6 +2425,7 @@ static jrd_nod* par_stream(thread_db* tdbb, CompilerScratch* csb)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static jrd_nod* par_union(thread_db* tdbb, CompilerScratch* csb)
|
||||
|
@ -1318,7 +1318,6 @@ ISC_STATUS API_ROUTINE GDS_CANCEL_EVENTS(ISC_STATUS * user_status,
|
||||
}
|
||||
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
ISC_STATUS API_ROUTINE GDS_CANCEL_OPERATION(ISC_STATUS * user_status,
|
||||
FB_API_HANDLE * handle,
|
||||
USHORT option)
|
||||
@ -1349,7 +1348,6 @@ ISC_STATUS API_ROUTINE GDS_CANCEL_OPERATION(ISC_STATUS * user_status,
|
||||
|
||||
return status[1];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
ISC_STATUS API_ROUTINE GDS_CLOSE_BLOB(ISC_STATUS * user_status,
|
||||
|
@ -253,12 +253,10 @@ ISC_STATUS API_ROUTINE isc_wait_for_event(ISC_STATUS*, FB_API_HANDLE*, USHORT,
|
||||
#endif /* JRD_IBASE_H */
|
||||
#endif /* WHY_NO_API */
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
#define CANCEL_disable 1
|
||||
#define CANCEL_enable 2
|
||||
#define CANCEL_raise 3
|
||||
ISC_STATUS API_ROUTINE gds__cancel_operation(ISC_STATUS*, FB_API_HANDLE*, USHORT);
|
||||
#endif
|
||||
|
||||
typedef void AttachmentCleanupRoutine(FB_API_HANDLE*, void*);
|
||||
typedef void TransactionCleanupRoutine(FB_API_HANDLE, void*);
|
||||
|
@ -76,7 +76,7 @@ class tsec *gdsec;
|
||||
static int common_main(int, const char**, Jrd::pfn_svc_output, Jrd::Service*);
|
||||
static void util_output(const SCHAR*, ...);
|
||||
static int util_print(const SCHAR*, ...);
|
||||
static int vutil_print(SCHAR*, va_list);
|
||||
static int vutil_print(const SCHAR*, va_list);
|
||||
|
||||
static void data_print(void*, const internal_user_data*, bool);
|
||||
static bool get_line(int*, SCHAR**, TEXT*, size_t);
|
||||
|
Loading…
Reference in New Issue
Block a user