mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 21:23:03 +01:00
fixed some gcc warning
This commit is contained in:
parent
4b5a7a89c3
commit
2200a681f8
@ -310,7 +310,7 @@ void SafeArg::dump(const TEXT* target[], size_t v_size) const
|
||||
// is returned.
|
||||
const safe_cell& SafeArg::getCell(size_t index) const
|
||||
{
|
||||
static safe_cell aux_cell = {safe_cell::at_none, 0};
|
||||
static safe_cell aux_cell = {safe_cell::at_none, {0}};
|
||||
|
||||
if (index < m_count)
|
||||
return m_arguments[index];
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include "gen/iberror.h"
|
||||
|
||||
#include "../jrd/gdsassert.h"
|
||||
@ -152,11 +151,11 @@ class DummyException {};
|
||||
|
||||
#ifndef NATIVE_QUAD
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
static const SQUAD quad_min_int = { 0, LONG_MIN };
|
||||
static const SQUAD quad_max_int = { -1, LONG_MAX };
|
||||
static const SQUAD quad_min_int = { 0, SLONG_MIN };
|
||||
static const SQUAD quad_max_int = { -1, SLONG_MAX };
|
||||
#else
|
||||
static const SQUAD quad_min_int = { LONG_MIN, 0 };
|
||||
static const SQUAD quad_max_int = { LONG_MAX, -1 };
|
||||
static const SQUAD quad_min_int = { SLONG_MIN, 0 };
|
||||
static const SQUAD quad_max_int = { SLONG_MAX, -1 };
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -935,7 +934,7 @@ SLONG CVT_get_long(const dsc* desc, SSHORT scale, ErrorFunction err)
|
||||
|
||||
if (d < (double) LONG_MIN_real) {
|
||||
if (d > (double) LONG_MIN_real - 1.)
|
||||
return LONG_MIN;
|
||||
return SLONG_MIN;
|
||||
err(Arg::Gds(isc_arith_except) << Arg::Gds(isc_numeric_out_of_range));
|
||||
}
|
||||
if (d > (double) LONG_MAX_real) {
|
||||
|
@ -32,13 +32,19 @@
|
||||
#ifndef INCLUDE_FB_TYPES_H
|
||||
#define INCLUDE_FB_TYPES_H
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#if SIZEOF_LONG == 8
|
||||
/* EKU: Firebird requires (S)LONG to be 32 bit */
|
||||
typedef int SLONG;
|
||||
typedef unsigned int ULONG;
|
||||
const SLONG SLONG_MIN = INT_MIN;
|
||||
const SLONG SLONG_MAX = INT_MAX;
|
||||
#elif SIZEOF_LONG == 4
|
||||
typedef long SLONG;
|
||||
typedef unsigned long ULONG;
|
||||
const SLONG SLONG_MIN = LONG_MIN;
|
||||
const SLONG SLONG_MAX = LONG_MAX;
|
||||
#else
|
||||
#error compile_time_failure: SIZEOF_LONG not specified
|
||||
#endif
|
||||
|
@ -854,9 +854,9 @@ struct in_sw_tab_t
|
||||
int in_sw;
|
||||
int in_spb_sw;
|
||||
const TEXT* in_sw_name;
|
||||
ULONG in_sw_value; /* alice specific field */
|
||||
ULONG in_sw_requires; /* alice specific field */
|
||||
ULONG in_sw_incompatibilities; /* alice specific field */
|
||||
SINT64 in_sw_value; /* alice specific field */
|
||||
SINT64 in_sw_requires; /* alice specific field */
|
||||
SINT64 in_sw_incompatibilities; /* alice specific field */
|
||||
bool in_sw_state;
|
||||
USHORT in_sw_msg;
|
||||
USHORT in_sw_min_length;
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include "../jrd/jrd.h"
|
||||
#include "../jrd/req.h"
|
||||
#include "../jrd/val.h"
|
||||
@ -288,7 +287,7 @@ UCHAR CVT_get_numeric(const UCHAR* string,
|
||||
}
|
||||
|
||||
if ((sign == -1) && (-value == LONG_MIN_int64)) {
|
||||
*(SLONG *) ptr = LONG_MIN;
|
||||
*(SLONG *) ptr = SLONG_MIN;
|
||||
return dtype_long;
|
||||
}
|
||||
|
||||
|
@ -592,9 +592,9 @@ struct win {
|
||||
SSHORT win_scans;
|
||||
USHORT win_flags;
|
||||
// explicit win(SLONG wp) : win_page(wp), win_flags(0) {}
|
||||
explicit win(const PageNumber& wp) : win_page(wp), win_flags(0), win_bdb(NULL) {}
|
||||
explicit win(const PageNumber& wp) : win_page(wp), win_bdb(NULL), win_flags(0) {}
|
||||
win(const USHORT pageSpaceID, const SLONG pageNum) :
|
||||
win_page(pageSpaceID, pageNum), win_flags(0), win_bdb(NULL) {}
|
||||
win_page(pageSpaceID, pageNum), win_bdb(NULL), win_flags(0) {}
|
||||
};
|
||||
|
||||
typedef win WIN;
|
||||
|
@ -402,7 +402,7 @@ static USHORT do_msgs( const TEXT* filename, const TEXT* locale, bool sw_warning
|
||||
leaf_node = leaf;
|
||||
}
|
||||
|
||||
leaf_node->msgrec_code = -1UL;
|
||||
leaf_node->msgrec_code = ~0;
|
||||
leaf_node->msgrec_length = 0;
|
||||
leaf_node->msgrec_flags = 0;
|
||||
n = (SCHAR *) leaf_node - (SCHAR *) leaf;
|
||||
@ -414,7 +414,7 @@ static USHORT do_msgs( const TEXT* filename, const TEXT* locale, bool sw_warning
|
||||
|
||||
for (msgnod** ptr = nodes, **ptr2 = buckets; *ptr; ptr++, ptr2++) {
|
||||
msgnod* node = *ptr;
|
||||
node->msgnod_code = -1UL;
|
||||
node->msgnod_code = ~0;
|
||||
node->msgnod_seek = position;
|
||||
n = (SCHAR *) (node + 1) - (SCHAR *) * ptr2;
|
||||
position = write_bucket(*ptr2, n);
|
||||
|
@ -866,7 +866,7 @@ static qli_nod* compile_function( qli_nod* node, qli_req* old_request,
|
||||
|
||||
qli_nod* list = node->nod_arg[e_fun_args];
|
||||
|
||||
qli_nod** ptr = ptr = list->nod_arg;
|
||||
qli_nod** ptr = list->nod_arg;
|
||||
for (const qli_nod* const* const end = ptr + list->nod_count; ptr < end; ptr++)
|
||||
compile_expression(*ptr, request, true);
|
||||
|
||||
|
@ -421,7 +421,7 @@ void MET_define_sql_relation( qli_rel* relation)
|
||||
END_ERROR;
|
||||
|
||||
qli_rlb* rlb = NULL;
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
|
||||
STUFF(isc_dyn_version_1);
|
||||
STUFF(isc_dyn_begin);
|
||||
@ -601,7 +601,7 @@ void MET_delete_field( DBB database, NAM name)
|
||||
FLD IN DB.RDB$FIELDS WITH FLD.RDB$FIELD_NAME EQ name->nam_string
|
||||
|
||||
qli_rlb* rlb = NULL;
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
STUFF(isc_dyn_version_1);
|
||||
STUFF(isc_dyn_delete_dimensions);
|
||||
STUFF_STRING(FLD.RDB$FIELD_NAME);
|
||||
@ -694,7 +694,7 @@ void MET_delete_relation( qli_rel* relation)
|
||||
|
||||
qli_symbol* symbol = relation->rel_symbol;
|
||||
qli_rlb* rlb = NULL;
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
STUFF(isc_dyn_version_1);
|
||||
STUFF(isc_dyn_delete_rel);
|
||||
STUFF_STRING(symbol->sym_string);
|
||||
@ -1518,7 +1518,7 @@ void MET_sql_alter_table( qli_rel* relation, qli_fld* fields)
|
||||
ERRQ_print_error(414, symbol->sym_string); // Msg237 Relation %s is lost
|
||||
|
||||
qli_rlb* rlb = NULL;
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
|
||||
STUFF(isc_dyn_version_1);
|
||||
STUFF(isc_dyn_begin);
|
||||
@ -1566,7 +1566,7 @@ void MET_sql_cr_view( qli_syntax* node)
|
||||
qli_symbol* symbol = relation->rel_symbol;
|
||||
|
||||
qli_rlb* rlb = NULL;
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
STUFF(isc_dyn_version_1);
|
||||
STUFF(isc_dyn_begin);
|
||||
|
||||
@ -1756,7 +1756,7 @@ static void add_sql_field( qli_rel* relation, qli_fld* field, USHORT position,
|
||||
* Add a SQL field to a relation via dyn.
|
||||
*
|
||||
**************************************/
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
DBB database = relation->rel_database;
|
||||
const qli_symbol* relation_name = relation->rel_symbol;
|
||||
const qli_symbol* field_name = field->fld_name;
|
||||
@ -1810,7 +1810,7 @@ static void add_sql_field( qli_rel* relation, qli_fld* field, USHORT position,
|
||||
STUFF_WORD(position);
|
||||
}
|
||||
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
|
||||
if (field->fld_flags & FLD_not_null) {
|
||||
STUFF(isc_dyn_fld_validation_blr);
|
||||
@ -2113,7 +2113,7 @@ static void clone_fields( qli_rel* target, qli_rel* source)
|
||||
clone_global_fields(target, source);
|
||||
|
||||
qli_rlb* rlb = NULL;
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
|
||||
STUFF(isc_dyn_version_1);
|
||||
STUFF(isc_dyn_begin);
|
||||
@ -2340,7 +2340,7 @@ static void clone_global_fields( qli_rel* target, qli_rel* source)
|
||||
continue;
|
||||
|
||||
if (first_field) {
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
STUFF(isc_dyn_version_1);
|
||||
STUFF(isc_dyn_begin);
|
||||
first_field = false;
|
||||
@ -3515,7 +3515,7 @@ static void sql_grant_revoke( qli_syntax* node, USHORT type)
|
||||
const TEXT* relation_name = relation->rel_symbol->sym_string;
|
||||
|
||||
qli_rlb* rlb = NULL;
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
|
||||
STUFF(isc_dyn_version_1);
|
||||
STUFF(isc_dyn_begin);
|
||||
@ -3593,7 +3593,7 @@ static void stuff_priv(
|
||||
* Stuff a privilege for grant/revoke.
|
||||
*
|
||||
**************************************/
|
||||
rlb = CHECK_RLB(rlb);
|
||||
CHECK_RLB(rlb);
|
||||
STUFF(type);
|
||||
|
||||
// Stuff privileges first
|
||||
|
Loading…
Reference in New Issue
Block a user