diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-13 20:42:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-14 10:13:46 +0200 |
commit | 8e39ef66928a3e37c618d3a70a631e71266db274 (patch) | |
tree | 8cab0264e58c885ae7d78a77d90fd041bcdbe15d /idlc | |
parent | d7e06e46acc2ee17101cef63e59b9f5efcbfab14 (diff) |
extend loplugin useuniqueptr to POD types
Change-Id: I6ff24f048bd8f75bf87a78b718f37b57855d4781
Reviewed-on: https://gerrit.libreoffice.org/39932
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'idlc')
-rw-r--r-- | idlc/inc/astexpression.hxx | 5 | ||||
-rw-r--r-- | idlc/source/astexpression.cxx | 21 |
2 files changed, 13 insertions, 13 deletions
diff --git a/idlc/inc/astexpression.hxx b/idlc/inc/astexpression.hxx index 955ffa49a233..eec117379b6f 100644 --- a/idlc/inc/astexpression.hxx +++ b/idlc/inc/astexpression.hxx @@ -103,7 +103,7 @@ public: // Data Accessors AstExprValue* getExprValue() - { return m_exprValue; } + { return m_exprValue.get(); } // Evaluation and value coercion bool coerce(ExprType type); @@ -129,7 +129,8 @@ private: ExprComb m_combOperator; AstExpression* m_subExpr1; AstExpression* m_subExpr2; - AstExprValue* m_exprValue; + std::unique_ptr<AstExprValue> + m_exprValue; OString* m_pSymbolicName; }; diff --git a/idlc/source/astexpression.cxx b/idlc/source/astexpression.cxx index 8615c7962f7e..0840ccf756d9 100644 --- a/idlc/source/astexpression.cxx +++ b/idlc/source/astexpression.cxx @@ -49,7 +49,7 @@ AstExpression::AstExpression(sal_Int32 l) { fillDefinitionDetails(); - m_exprValue = new AstExprValue; + m_exprValue.reset( new AstExprValue ); m_exprValue->et = ET_long; m_exprValue->u.lval = l; } @@ -63,7 +63,7 @@ AstExpression::AstExpression(sal_Int32 l, ExprType et) { fillDefinitionDetails(); - m_exprValue = new AstExprValue; + m_exprValue.reset( new AstExprValue ); m_exprValue->et = et; m_exprValue->u.lval = l; } @@ -77,7 +77,7 @@ AstExpression::AstExpression(sal_Int64 h) { fillDefinitionDetails(); - m_exprValue = new AstExprValue; + m_exprValue.reset( new AstExprValue ); m_exprValue->et = ET_hyper; m_exprValue->u.hval = h; } @@ -91,7 +91,7 @@ AstExpression::AstExpression(sal_uInt64 uh) { fillDefinitionDetails(); - m_exprValue = new AstExprValue; + m_exprValue.reset( new AstExprValue ); m_exprValue->et = ET_uhyper; m_exprValue->u.uhval = uh; } @@ -105,7 +105,7 @@ AstExpression::AstExpression(double d) { fillDefinitionDetails(); - m_exprValue = new AstExprValue; + m_exprValue.reset( new AstExprValue ); m_exprValue->et = ET_double; m_exprValue->u.dval = d; } @@ -122,7 +122,6 @@ AstExpression::AstExpression(OString* scopedName) AstExpression::~AstExpression() { - delete m_exprValue; delete m_subExpr1; delete m_subExpr2; delete m_pSymbolicName; @@ -753,7 +752,7 @@ bool AstExpression::coerce(ExprType t) copy = nullptr; } - m_exprValue = copy; + m_exprValue.reset( copy ); return m_exprValue != nullptr; } @@ -804,21 +803,21 @@ void AstExpression::evaluate() case ExprComb::Mul: case ExprComb::Div: case ExprComb::Mod: - m_exprValue = eval_bin_op().release(); + m_exprValue = eval_bin_op(); break; case ExprComb::Or: case ExprComb::Xor: case ExprComb::And: case ExprComb::Left: case ExprComb::Right: - m_exprValue = eval_bit_op().release(); + m_exprValue = eval_bit_op(); break; case ExprComb::UPlus: case ExprComb::UMinus: - m_exprValue = eval_un_op().release(); + m_exprValue = eval_un_op(); break; case ExprComb::Symbol: - m_exprValue = eval_symbol(); + m_exprValue.reset( eval_symbol() ); break; case ExprComb::NONE: break; |