summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-06-08 15:16:12 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-06-09 12:26:26 +0200
commit5f9a90a939de600952707edeeb309c6badd757c6 (patch)
tree12d10f56486b53fd757e6ac4ad286df7af43179e /connectivity
parentc3325e8d7eae59ba1064546038ea2c6abeed9db6 (diff)
-Werror,-Wunused-but-set-variable (Clang 13 trunk)
The only read of aParamterName in the OOperandParam ctor had been commented out and marked "todo" ever since at least 8b1efd34bf563a1a8de9d7e78e52cdab8086cb38 "moved from ..\..\parse", so lets clean all of that effectively dead code away completely for now, and just leave a comment for later. Change-Id: Ia5ee51cd6c45e8bc50bdd4e892ed0a4dfdc690a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116839 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/file/fcode.cxx30
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx2
-rw-r--r--connectivity/source/inc/file/fcode.hxx2
3 files changed, 8 insertions, 26 deletions
diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx
index 36cba4a73485..6e1a0cdf54e5 100644
--- a/connectivity/source/drivers/file/fcode.cxx
+++ b/connectivity/source/drivers/file/fcode.cxx
@@ -63,32 +63,14 @@ void OOperandValue::setValue(const ORowSetValue& _rVal)
m_aValue = _rVal;
}
-OOperandParam::OOperandParam(OSQLParseNode const * pNode, sal_Int32 _nPos)
+OOperandParam::OOperandParam(sal_Int32 _nPos)
: OOperandRow(static_cast<sal_uInt16>(_nPos), DataType::VARCHAR) // Standard-Type
{
- OSL_ENSURE(SQL_ISRULE(pNode,parameter),"Argument is not a parameter");
- OSL_ENSURE(pNode->count() > 0,"Error in Parse Tree");
- OSQLParseNode *pMark = pNode->getChild(0);
-
- OUString aParameterName;
- if (SQL_ISPUNCTUATION(pMark, "?"))
- aParameterName = "?";
- else if (SQL_ISPUNCTUATION(pMark, ":"))
- aParameterName = pNode->getChild(1)->getTokenValue();
- else
- {
- SAL_WARN( "connectivity.drivers","Error in Parse Tree");
- }
-
- // set up Parameter-Column with default type, can be specified more precisely later using Describe-Parameter
-
- // save Identity (not especially necessary here, just for the sake of symmetry)
-
- // todo
- // OColumn* pColumn = new OFILEColumn(aParameterName,eDBType,255,0,SQL_FLAGS_NULLALLOWED);
- // rParamColumns->AddColumn(pColumn);
-
- // the value will be set just before the evaluation
+ //TODO: Actually do something here (the current state of OOperandParam appears to be "the
+ // remains of the very beginnings of a never finished implementation of support for parameters
+ // in this code", as Lionel put it in the comments at <https://gerrit.libreoffice.org/c/core/+/
+ // 116839/1#message-7b2bbf3543f559a0b67dc35cd940e2ab8829c274> "-Werror,-Wunused-but-set-variable
+ // (Clang 13 trunk)").
}
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index 44d175be69f3..be01a70ed360 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -457,7 +457,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode const * pPredicateNo
}
else if (SQL_ISRULE(pPredicateNode,parameter))
{
- pOperand = new OOperandParam(pPredicateNode, ++m_nParamCounter);
+ pOperand = new OOperandParam(++m_nParamCounter);
}
else if (pPredicateNode->getNodeType() == SQLNodeType::String ||
pPredicateNode->getNodeType() == SQLNodeType::IntNum ||
diff --git a/connectivity/source/inc/file/fcode.hxx b/connectivity/source/inc/file/fcode.hxx
index f1b4e55815ff..c78461743c27 100644
--- a/connectivity/source/inc/file/fcode.hxx
+++ b/connectivity/source/inc/file/fcode.hxx
@@ -96,7 +96,7 @@ namespace connectivity
class OOperandParam : public OOperandRow
{
public:
- OOperandParam(connectivity::OSQLParseNode const * pNode, sal_Int32 _nPos);
+ OOperandParam(sal_Int32 _nPos);
};
// Value operands