From fc41c54a62a54d91cf7da848041fd312c569643b Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Fri, 21 Jan 2011 17:16:13 +0000 Subject: [PATCH] warnings --- src/dsql/ExprNodes.cpp | 2 +- src/dsql/Nodes.h | 2 +- src/dsql/StmtNodes.cpp | 4 ++-- src/dsql/parse.y | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dsql/ExprNodes.cpp b/src/dsql/ExprNodes.cpp index b3affb9582..554b57c15a 100644 --- a/src/dsql/ExprNodes.cpp +++ b/src/dsql/ExprNodes.cpp @@ -4797,7 +4797,7 @@ ValueExprNode* FieldNode::pass1(thread_db* tdbb, CompilerScratch* csb) if (!map) { map = local_map; - fb_assert(stream + 2 <= MAX_STREAMS); + fb_assert(stream + 2u <= MAX_STREAMS); local_map[0] = (UCHAR) stream; map[1] = stream + 1; map[2] = stream + 2; diff --git a/src/dsql/Nodes.h b/src/dsql/Nodes.h index b0e23c27d0..9595c5933d 100644 --- a/src/dsql/Nodes.h +++ b/src/dsql/Nodes.h @@ -53,7 +53,7 @@ const int MAX_CONJUNCTS = 32000; // limit is NOT negotiable so long as we use an array of UCHAR, where index 0 // tells how many streams are in the array (and the streams themselves are // identified by a UCHAR). -const int MAX_STREAMS = 255; +const unsigned int MAX_STREAMS = 255; // This is number of ULONG's needed to store bit-mapped flags for all streams // OPT_STREAM_BITS = (MAX_STREAMS + 1) / sizeof(ULONG) diff --git a/src/dsql/StmtNodes.cpp b/src/dsql/StmtNodes.cpp index 605ba66bc1..432ebd8e30 100644 --- a/src/dsql/StmtNodes.cpp +++ b/src/dsql/StmtNodes.cpp @@ -3851,8 +3851,8 @@ DmlNode* ModifyNode::parse(thread_db* tdbb, MemoryPool& pool, CompilerScratch* c if (context >= csb->csb_rpt.getCount() || !(csb->csb_rpt[context].csb_flags & csb_used)) PAR_error(csb, Arg::Gds(isc_ctxnotdef)); - const SSHORT orgStream = csb->csb_rpt[context].csb_stream; - const SSHORT newStream = csb->nextStream(false); + const USHORT orgStream = csb->csb_rpt[context].csb_stream; + const USHORT newStream = csb->nextStream(false); if (newStream >= MAX_STREAMS) PAR_error(csb, Arg::Gds(isc_too_many_contexts)); diff --git a/src/dsql/parse.y b/src/dsql/parse.y index 73431b35dc..7ef1812efe 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -6887,7 +6887,7 @@ int Parser::yylexAux() gds__free (buffer); yyabandon(-104, isc_token_too_long); } - else if (p - buffer > MAX_SQL_IDENTIFIER_LEN) + else if (p > &buffer[MAX_SQL_IDENTIFIER_LEN]) { if (buffer != string) gds__free (buffer); @@ -7415,7 +7415,7 @@ int Parser::yylexAux() return sym->sym_keyword; } - if (p - string > MAX_SQL_IDENTIFIER_LEN) + if (p > &string[MAX_SQL_IDENTIFIER_LEN]) yyabandon(-104, isc_dyn_name_longer); yylval.legacyNode = (dsql_nod*) MAKE_string(string, p - string);