Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
373c3878
Commit
373c3878
authored
Jun 16, 2014
by
peastman
Browse files
Merge pull request #485 from chrisdembia/fix-parsed-expression-warning
Fix Clang warning about unhandled enum values.
parents
6e5b3866
debf09a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
libraries/lepton/src/ParsedExpression.cpp
libraries/lepton/src/ParsedExpression.cpp
+8
-0
No files found.
libraries/lepton/src/ParsedExpression.cpp
View file @
373c3878
...
@@ -269,7 +269,15 @@ ExpressionTreeNode ParsedExpression::substituteSimplerExpression(const Expressio
...
@@ -269,7 +269,15 @@ ExpressionTreeNode ParsedExpression::substituteSimplerExpression(const Expressio
return
ExpressionTreeNode
(
new
Operation
::
Constant
(
dynamic_cast
<
const
Operation
::
MultiplyConstant
*>
(
&
node
.
getOperation
())
->
getValue
()
*
getConstantValue
(
children
[
0
])));
return
ExpressionTreeNode
(
new
Operation
::
Constant
(
dynamic_cast
<
const
Operation
::
MultiplyConstant
*>
(
&
node
.
getOperation
())
->
getValue
()
*
getConstantValue
(
children
[
0
])));
if
(
children
[
0
].
getOperation
().
getId
()
==
Operation
::
NEGATE
)
// Combine a multiply and a negate into a single multiply
if
(
children
[
0
].
getOperation
().
getId
()
==
Operation
::
NEGATE
)
// Combine a multiply and a negate into a single multiply
return
ExpressionTreeNode
(
new
Operation
::
MultiplyConstant
(
-
dynamic_cast
<
const
Operation
::
MultiplyConstant
*>
(
&
node
.
getOperation
())
->
getValue
()),
children
[
0
].
getChildren
()[
0
]);
return
ExpressionTreeNode
(
new
Operation
::
MultiplyConstant
(
-
dynamic_cast
<
const
Operation
::
MultiplyConstant
*>
(
&
node
.
getOperation
())
->
getValue
()),
children
[
0
].
getChildren
()[
0
]);
break
;
}
}
default:
{
// If operation ID is not one of the above,
// we don't substitute a simpler expression.
break
;
}
}
}
return
ExpressionTreeNode
(
node
.
getOperation
().
clone
(),
children
);
return
ExpressionTreeNode
(
node
.
getOperation
().
clone
(),
children
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment