-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 8b1efd34bf
"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>
This commit is contained in:
Stephan Bergmann
2021-06-09 12:26:26 +02:00
parent c3325e8d7e
commit 5f9a90a939
3 changed files with 8 additions and 26 deletions
+6 -24
View File
@@ -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)").
}
+1 -1
View File
@@ -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 ||
+1 -1
View File
@@ -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