Kaydet (Commit) 9389f7bc authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix loplugin warnings in sqlflex.l

(Normally hidden by T_LEXFLAGS containing -L in connectivity/Library_dbtools.mk
suppressing #line directives; some loplugin:literaltoboolconversion warning
would remain in a flex-provided occurrence of ECHO that is apparently not
properly prefixed by #line at least with flex 2.6.0.)

Change-Id: Id5693d6bd9e5b565dd9820e3cbea8e88e7967dd5
üst 30dd4ac3
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include <connectivity/internalnode.hxx> #include <connectivity/internalnode.hxx>
#ifndef _CONNECTIVITY_SQLYACC_HXX #ifndef INCLUDED_CONNECTIVITY_SOURCE_PARSE_SQLFLEX_L
#define _CONNECTIVITY_SQLYACC_HXX #define INCLUDED_CONNECTIVITY_SOURCE_PARSE_SQLFLEX_L
#ifndef SQLYYDEBUG #ifndef SQLYYDEBUG
#define SQLYYDEBUG 1 #define SQLYYDEBUG 1
...@@ -66,7 +66,7 @@ static sal_Int32 gatherString(int delim, sal_Int32 nTyp); ...@@ -66,7 +66,7 @@ static sal_Int32 gatherString(int delim, sal_Int32 nTyp);
static sal_Int32 gatherName(const sal_Char*); static sal_Int32 gatherName(const sal_Char*);
static sal_Int32 gatherNamePre(const sal_Char* ); static sal_Int32 gatherNamePre(const sal_Char* );
// has to be set before the parser starts // has to be set before the parser starts
OSQLScanner* xxx_pGLOBAL_SQLSCAN = NULL; OSQLScanner* xxx_pGLOBAL_SQLSCAN = nullptr;
#define SQL_NEW_NODE(text, token) \ #define SQL_NEW_NODE(text, token) \
SQLyylval.pParseNode = new OSQLInternalNode(text, token); SQLyylval.pParseNode = new OSQLInternalNode(text, token);
...@@ -688,9 +688,9 @@ using namespace connectivity; ...@@ -688,9 +688,9 @@ using namespace connectivity;
static bool IN_SQLyyerror; static bool IN_SQLyyerror;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
OSQLScanner::OSQLScanner() OSQLScanner::OSQLScanner()
: m_pContext(NULL) : m_pContext(nullptr)
, m_nCurrentPos(0) , m_nCurrentPos(0)
, m_bInternational(sal_False) , m_bInternational(false)
, m_nRule(0) // 0 is INITIAL , m_nRule(0) // 0 is INITIAL
{ {
IN_SQLyyerror = false; IN_SQLyyerror = false;
...@@ -712,11 +712,11 @@ void OSQLScanner::SQLyyerror(char const *fmt) ...@@ -712,11 +712,11 @@ void OSQLScanner::SQLyyerror(char const *fmt)
m_sErrorMessage = ::rtl::OUString(fmt,strlen(fmt),RTL_TEXTENCODING_UTF8); m_sErrorMessage = ::rtl::OUString(fmt,strlen(fmt),RTL_TEXTENCODING_UTF8);
if (m_nCurrentPos < m_sStatement.getLength()) if (m_nCurrentPos < m_sStatement.getLength())
{ {
m_sErrorMessage += ::rtl::OUString(": "); m_sErrorMessage += ": ";
::rtl::OUString aError; ::rtl::OUString aError;
static sal_Int32 BUFFERSIZE = 256; static sal_Int32 BUFFERSIZE = 256;
static sal_Char* Buffer = 0; static sal_Char* Buffer = nullptr;
if(!Buffer) if(!Buffer)
Buffer = new sal_Char[BUFFERSIZE]; Buffer = new sal_Char[BUFFERSIZE];
...@@ -754,7 +754,7 @@ void OSQLScanner::SQLyyerror(char const *fmt) ...@@ -754,7 +754,7 @@ void OSQLScanner::SQLyyerror(char const *fmt)
} }
m_sErrorMessage += aError; m_sErrorMessage += aError;
delete[] Buffer; delete[] Buffer;
Buffer = NULL; Buffer = nullptr;
} }
IN_SQLyyerror = false; IN_SQLyyerror = false;
YY_FLUSH_BUFFER; YY_FLUSH_BUFFER;
...@@ -794,7 +794,7 @@ sal_Int32 OSQLScanner::GetDATERule() { return DATE; } ...@@ -794,7 +794,7 @@ sal_Int32 OSQLScanner::GetDATERule() { return DATE; }
sal_Int32 OSQLScanner::GetSTRINGRule() { return STRING; } sal_Int32 OSQLScanner::GetSTRINGRule() { return STRING; }
void OSQLScanner::setScanner(bool _bNull) void OSQLScanner::setScanner(bool _bNull)
{ {
xxx_pGLOBAL_SQLSCAN = _bNull ? NULL : this; xxx_pGLOBAL_SQLSCAN = _bNull ? nullptr : this;
} }
sal_Int32 OSQLScanner::SQLlex() sal_Int32 OSQLScanner::SQLlex()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment