summaryrefslogtreecommitdiff
path: root/rsc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-04-16 14:09:33 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-04-16 14:13:47 +0200
commit1c27bb5237ed6067bba70d7ffe63ed9967098b19 (patch)
treeee6998224e06b70adf75529098199b3cf3cae1ec /rsc
parent4586d79d7421d0b4289096330c8ae0045023b313 (diff)
Some trivial -fsanitize=undefined adaptions
Change-Id: I60f6e2b5f041919319cb6b72684b8b7b8504560c
Diffstat (limited to 'rsc')
-rw-r--r--rsc/inc/rscdef.hxx2
-rw-r--r--rsc/source/rscpp/cpp5.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx
index d85657f89ebe..c38f3d9682a2 100644
--- a/rsc/inc/rscdef.hxx
+++ b/rsc/inc/rscdef.hxx
@@ -63,7 +63,7 @@ public:
sal_Int32 GetLong() const
{
return aExp.aLong.nLo |
- ((sal_Int32)aExp.aLong.nHi << 16);
+ ((sal_uInt32)aExp.aLong.nHi << 16);
}
bool Evaluate( sal_Int32 * pValue ) const;
void AppendMacro( OStringBuffer & ) const;
diff --git a/rsc/source/rscpp/cpp5.c b/rsc/source/rscpp/cpp5.c
index 92587fe91dae..091b594f3deb 100644
--- a/rsc/source/rscpp/cpp5.c
+++ b/rsc/source/rscpp/cpp5.c
@@ -291,16 +291,15 @@ again: ;
}
opp->op = (char)op;
opp->prec = (char)prec;
- skip = (valp[-1] != 0); /* Short-circuit tester */
/*
* Do the short-circuit stuff here. Short-circuiting
* stops automagically when operators are evaluated.
*/
- if ((op == OP_ANA && !skip)
- || (op == OP_ORO && skip))
+ if ((op == OP_ANA && valp[-1] == 0)
+ || (op == OP_ORO && valp[-1] != 0))
opp->skip = S_ANDOR; /* And/or skip starts */
else if (op == OP_QUE) /* Start of ?: operator */
- opp->skip = (char)((op1 & S_ANDOR) | ((!skip) ? S_QUEST : 0));
+ opp->skip = (char)((op1 & S_ANDOR) | ((valp[-1] == 0) ? S_QUEST : 0));
else if (op == OP_COL) { /* : inverts S_QUEST */
opp->skip = (char)((op1 & S_ANDOR)
| (((op1 & S_QUEST) != 0) ? 0 : S_QUEST));