[Libreoffice-commits] .: 3 commits - binaryurp/qa rsc/Executable_rsc.mk tools/source

Tor Lillqvist tml at kemper.freedesktop.org
Tue Oct 4 01:08:22 PDT 2011


 binaryurp/qa/test-unmarshal.cxx |   12 ++++++------
 rsc/Executable_rsc.mk           |    2 ++
 tools/source/stream/stream.cxx  |   10 +++++-----
 3 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 588a0d58d238e33a937641252b64020cec2a2af7
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 4 11:07:46 2011 +0300

    Silly attempts at humour not appreciated

diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 6cc226a..afaa917 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1154,7 +1154,7 @@ sal_Size SvStream::SeekRel( sal_sSize nPos )
 
 SvStream& SvStream::operator>>(sal_uInt16& r)
 {
-    sal_uInt16 n = 666;
+    sal_uInt16 n = 0;
     READNUMBER_WITHOUT_SWAP(sal_uInt16, n)
     if (good())
     {
@@ -1167,7 +1167,7 @@ SvStream& SvStream::operator>>(sal_uInt16& r)
 
 SvStream& SvStream::operator>>(sal_uInt32& r)
 {
-    sal_uInt32 n = 42;
+    sal_uInt32 n = 0;
     READNUMBER_WITHOUT_SWAP(sal_uInt32, n)
     if (good())
     {
@@ -1181,7 +1181,7 @@ SvStream& SvStream::operator>>(sal_uInt32& r)
 
 SvStream& SvStream::operator>>(sal_uInt64& r)
 {
-    sal_uInt64 n = 0xDEADCAFEBABE;
+    sal_uInt64 n = 0;
     READNUMBER_WITHOUT_SWAP(sal_uInt64, n)
     if (good())
     {
@@ -1200,7 +1200,7 @@ SvStream& SvStream::operator >>(long& r) //puke!, kill this
     if (good())
         r = n;
 #else
-    long n = 0; // Ran out of "fun" numbers
+    long n = 0;
     READNUMBER_WITHOUT_SWAP(long, n)
     if (good())
     {
@@ -1287,7 +1287,7 @@ SvStream& SvStream::operator>>( unsigned char& r )
 
 SvStream& SvStream::operator>>(float& r)
 {
-    float n = 3.14159265358979323846f;
+    float n = 0;
     READNUMBER_WITHOUT_SWAP(float, n)
     if (good())
     {
commit 40b0fcec20a027ed5fe1db552cdad3220f39f586
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 4 11:04:01 2011 +0300

    WaE: 'static_cast' : truncation of constant value

diff --git a/binaryurp/qa/test-unmarshal.cxx b/binaryurp/qa/test-unmarshal.cxx
index 74ee12c..3e8aac3 100644
--- a/binaryurp/qa/test-unmarshal.cxx
+++ b/binaryurp/qa/test-unmarshal.cxx
@@ -69,9 +69,9 @@ private:
 void Test::testTypeOfBooleanSequence() {
     binaryurp::ReaderState state;
     css::uno::Sequence< sal_Int8 > buf(13);
-    buf[0] = static_cast< sal_Int8 >(20 | 0x80); // sequence type | cache flag
-    buf[1] = static_cast< sal_Int8 >(binaryurp::cache::ignore >> 8);
-    buf[2] = static_cast< sal_Int8 >(binaryurp::cache::ignore & 0xFF);
+    buf[0] = static_cast< sal_Int8 >(static_cast< sal_uInt8 >(20 | 0x80)); // sequence type | cache flag
+    buf[1] = static_cast< sal_Int8 >(static_cast< sal_uInt8 >(binaryurp::cache::ignore >> 8));
+    buf[2] = static_cast< sal_Int8 >(static_cast< sal_uInt8 >(binaryurp::cache::ignore & 0xFF));
     buf[3] = RTL_CONSTASCII_LENGTH("[]boolean");
     buf[4] = '[';
     buf[5] = ']';
@@ -94,9 +94,9 @@ void Test::testTypeOfBooleanSequence() {
 void Test::testTypeOfVoidSequence() {
     binaryurp::ReaderState state;
     css::uno::Sequence< sal_Int8 > buf(10);
-    buf[0] = static_cast< sal_Int8 >(20 | 0x80); // sequence type | cache flag
-    buf[1] = static_cast< sal_Int8 >(binaryurp::cache::ignore >> 8);
-    buf[2] = static_cast< sal_Int8 >(binaryurp::cache::ignore & 0xFF);
+    buf[0] = static_cast< sal_Int8 >(static_cast< sal_uInt8 >(20 | 0x80)); // sequence type | cache flag
+    buf[1] = static_cast< sal_Int8 >(static_cast< sal_uInt8 >(binaryurp::cache::ignore >> 8));
+    buf[2] = static_cast< sal_Int8 >(static_cast< sal_uInt8 >(binaryurp::cache::ignore & 0xFF));
     buf[3] = RTL_CONSTASCII_LENGTH("[]void");
     buf[4] = '[';
     buf[5] = ']';
commit 9b45575e89e09db5df0750da29f8c88c479805bd
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Tue Oct 4 10:52:43 2011 +0300

    WaE: C++ exception handler used, but unwind semantics are not enabled
    
    So override the T_CXXFLAGS for the yacc-generated source file to use
    gb_LinkTarget_EXCEPTIONFLAGS. Seems to work.

diff --git a/rsc/Executable_rsc.mk b/rsc/Executable_rsc.mk
index 651677d..c95678d 100644
--- a/rsc/Executable_rsc.mk
+++ b/rsc/Executable_rsc.mk
@@ -58,6 +58,8 @@ $(eval $(call gb_Executable_add_grammars,rsc,\
 	rsc/source/parser/rscyacc \
 ))
 
+$(call gb_YaccObject_get_target,rsc/source/parser/rscyacc): T_CXXFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS) $(gb_LinkTarget_CXXFLAGS) $(CXXFLAGS)
+
 $(eval $(call gb_Executable_add_exception_objects,rsc,\
 	rsc/source/parser/erscerr \
 	rsc/source/parser/rscdb \


More information about the Libreoffice-commits mailing list