[Libreoffice-commits] core.git: 2 commits - cppu/qa unoidl/source
Stephan Bergmann
sbergman at redhat.com
Wed Sep 18 23:16:53 PDT 2013
cppu/qa/cppumaker/test_cppumaker.cxx | 3 ---
cppu/qa/cppumaker/types.idl | 1 -
unoidl/source/sourceprovider-parser.y | 20 ++++++++++++--------
3 files changed, 12 insertions(+), 12 deletions(-)
New commits:
commit ca78613fa015c03ea2c554247924c165a7aa34e7
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Sep 19 08:16:18 2013 +0200
Unlike idlc, unoidl doesn't support out-of-range byte consts
Change-Id: Ib1c98ea10a2d05e74a3aae9b2868a69c66efa543
diff --git a/cppu/qa/cppumaker/test_cppumaker.cxx b/cppu/qa/cppumaker/test_cppumaker.cxx
index f29c5ea..8dfe84a 100644
--- a/cppu/qa/cppumaker/test_cppumaker.cxx
+++ b/cppu/qa/cppumaker/test_cppumaker.cxx
@@ -533,9 +533,6 @@ void Test::testConstants() {
CPPUNIT_ASSERT_EQUAL(
SAL_MAX_INT8, test::codemaker::cppumaker::Constants::byteMax);
CPPUNIT_ASSERT_EQUAL(
- static_cast< sal_Int8 >(-1),
- test::codemaker::cppumaker::Constants::byteNeg);
- CPPUNIT_ASSERT_EQUAL(
SAL_MIN_INT16, test::codemaker::cppumaker::Constants::shortMin);
CPPUNIT_ASSERT_EQUAL(
SAL_MAX_INT16, test::codemaker::cppumaker::Constants::shortMax);
diff --git a/cppu/qa/cppumaker/types.idl b/cppu/qa/cppumaker/types.idl
index 2c0a055..f22d52f 100644
--- a/cppu/qa/cppumaker/types.idl
+++ b/cppu/qa/cppumaker/types.idl
@@ -690,7 +690,6 @@ exception TestException2: TestException1 {};
constants Constants {
const byte byteMin = -128;
const byte byteMax = 127;
- const byte byteNeg = 255;
const short shortMin = -32768;
const short shortMax = 32767;
const unsigned short unsignedShortMin = 0;
commit dc331015a5620815ef9349e69816a7fd300158eb
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Sep 19 08:15:03 2013 +0200
Handle special case -(2^63) correctly
Change-Id: Ia3d8931341b2d47ef76265d94410d83f51a068c0
diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y
index 9c7e00e..4d4f8e6 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -3078,15 +3078,19 @@ unaryExpr:
$$ = unoidl::detail::SourceProviderExpr::Int(-$2.ival);
break;
case unoidl::detail::SourceProviderExpr::TYPE_UINT:
- if ($2.uval > SAL_MAX_INT64) {
- error(
- @2, yyscanner,
- ("cannot negate out-of-range value "
- + OUString::number($2.uval)));
- YYERROR;
+ if ($2.uval == SAL_CONST_UINT64(0x8000000000000000)) {
+ $$ = unoidl::detail::SourceProviderExpr::Int(SAL_MIN_INT64);
+ } else {
+ if ($2.uval > SAL_MAX_INT64) {
+ error(
+ @2, yyscanner,
+ ("cannot negate out-of-range value "
+ + OUString::number($2.uval)));
+ YYERROR;
+ }
+ $$ = unoidl::detail::SourceProviderExpr::Int(
+ -static_cast<sal_Int64>($2.uval));
}
- $$ = unoidl::detail::SourceProviderExpr::Int(
- -static_cast<sal_Int64>($2.uval));
break;
case unoidl::detail::SourceProviderExpr::TYPE_FLOAT:
$$ = unoidl::detail::SourceProviderExpr::Float(-$2.fval);
More information about the Libreoffice-commits
mailing list