[Libreoffice-commits] .: 2 commits - libwps/libwps.gcc.warnings.patch libwps/libwps.msvc.warnings.patch libwps/UnpackedTarball_wps.mk
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Oct 29 06:58:28 PDT 2012
libwps/UnpackedTarball_wps.mk | 7 +++
libwps/libwps.gcc.warnings.patch | 15 ++++++++
libwps/libwps.msvc.warnings.patch | 71 ++++++++++++++++++++++++++++++++++++++
3 files changed, 93 insertions(+)
New commits:
commit 573af9266c4d17445f0c75e1a71b629c845b83b8
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Oct 29 14:49:39 2012 +0100
libwps: fix gcc warning too [-Wsign-promo]
Change-Id: I23e32cfc100441530691e0dcdc71eac37b3fbf0d
diff --git a/libwps/UnpackedTarball_wps.mk b/libwps/UnpackedTarball_wps.mk
index 269adf0..e573928 100644
--- a/libwps/UnpackedTarball_wps.mk
+++ b/libwps/UnpackedTarball_wps.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,wps,1))
$(eval $(call gb_UnpackedTarball_add_patches,wps,\
libwps/libwps.msvc.warnings.patch \
+ libwps/libwps.gcc.warnings.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/libwps/libwps.gcc.warnings.patch b/libwps/libwps.gcc.warnings.patch
new file mode 100644
index 0000000..d9692d4
--- /dev/null
+++ b/libwps/libwps.gcc.warnings.patch
@@ -0,0 +1,15 @@
+warning: passing âlibwps::Justificationâ chooses âintâ over âunsigned intâ
+
+diff -ru wps.old/src/lib/WPSParagraph.cpp wps/src/lib/WPSParagraph.cpp
+--- wps.old/src/lib/WPSParagraph.cpp 2012-10-29 14:44:09.135977333 +0100
++++ wps/src/lib/WPSParagraph.cpp 2012-10-29 14:44:13.649981497 +0100
+@@ -137,7 +137,8 @@
+ o << "just=fullAllLines, ";
+ break;
+ default:
+- o << "just=" << pp.m_justify << ", ";
++ assert(false); // unhandled Justification enum value
++ o << "just=" << static_cast<unsigned>(pp.m_justify) << ", ";
+ break;
+ }
+
commit 424bd89ac2a11ba6dd2ede9454c3af90a5ca7f9c
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Oct 29 14:37:01 2012 +0100
libwps: fix sundry MSVC warnings
Change-Id: I4d8ee9e339139716e549000dd22d02ab8b963d9d
diff --git a/libwps/UnpackedTarball_wps.mk b/libwps/UnpackedTarball_wps.mk
index c5698f7..269adf0 100644
--- a/libwps/UnpackedTarball_wps.mk
+++ b/libwps/UnpackedTarball_wps.mk
@@ -11,4 +11,10 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,wps))
$(eval $(call gb_UnpackedTarball_set_tarball,wps,$(WPS_TARBALL)))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,wps,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,wps,\
+ libwps/libwps.msvc.warnings.patch \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/libwps/libwps.msvc.warnings.patch b/libwps/libwps.msvc.warnings.patch
new file mode 100644
index 0000000..5d41d5e
--- /dev/null
+++ b/libwps/libwps.msvc.warnings.patch
@@ -0,0 +1,71 @@
+fix MSVC warnings:
+
+* various C4946 reinterpret_cast between related classes
+* silly C4305 truncation from double to float
+* C4806: no value of type 'bool' promoted to type 'int'
+ can equal the given constant (real bug?)
+* C4701: pot. uninitialized variable 'ucs4Character'
+
+diff -ru wps.old/src/lib/WPS4.cpp wps/src/lib/WPS4.cpp
+--- wps.old/src/lib/WPS4.cpp 2012-05-31 14:14:13.000000000 +0200
++++ wps/src/lib/WPS4.cpp 2012-10-29 14:13:08.241600000 +0100
+@@ -116,7 +116,7 @@
+ return;
+ }
+
+- WPS4Parser *mnParser = reinterpret_cast<WPS4Parser *>(m_parser);
++ WPS4Parser *mnParser = dynamic_cast<WPS4Parser *>(m_parser);
+ mnParser->send(m_entry, subDocumentType);
+ }
+
+diff -ru wps.old/src/lib/WPS4Text.cpp wps/src/lib/WPS4Text.cpp
+--- wps.old/src/lib/WPS4Text.cpp 2012-05-31 14:14:13.000000000 +0200
++++ wps/src/lib/WPS4Text.cpp 2012-10-29 14:22:16.004400000 +0100
+@@ -212,7 +212,7 @@
+ //! operator<< for font properties
+ std::ostream &operator<<(std::ostream &o, Font const &ft)
+ {
+- o << reinterpret_cast<WPSFont const &>(ft) << ",";
++ o << dynamic_cast<WPSFont const &>(ft) << ",";
+
+ if (ft.m_special)
+ {
+@@ -822,7 +822,7 @@
+ WPSEntry ent = m_state->m_dosLinkList[id].m_pos;
+ ent.setType("TEXT");
+ ent.setId(WPS4TextInternal::Z_DLink);
+- WPSPosition pos_(Vec2f(),Vec2f(3.0,0.2));
++ WPSPosition pos_(Vec2f(),Vec2f(3.0f,0.2f));
+ pos_.setRelativePosition(WPSPosition::Paragraph, WPSPosition::XCenter);
+ pos_.m_wrapping = WPSPosition::WNone;
+ WPXPropertyList extras;
+@@ -1729,7 +1729,7 @@
+ int underlinePos = libwps::readU8(m_input);
+ if (underlinePos)
+ {
+- if (!what & 0x20) f << "undFl,";
++ if (!(what & 0x20)) f << "undFl,";
+ what &= 0xdf;
+ attributes |= WPS_UNDERLINE_BIT;
+ }
+diff -ru wps.old/src/lib/WPS8.cpp wps/src/lib/WPS8.cpp
+--- wps.old/src/lib/WPS8.cpp 2012-05-31 14:14:13.000000000 +0200
++++ wps/src/lib/WPS8.cpp 2012-10-29 14:19:31.206000000 +0100
+@@ -94,7 +94,7 @@
+ }
+
+ long actPos = m_input->tell();
+- WPS8Parser *mnParser = reinterpret_cast<WPS8Parser *>(m_parser);
++ WPS8Parser *mnParser = dynamic_cast<WPS8Parser *>(m_parser);
+ if (type == libwps::DOC_NOTE)
+ mnParser->sendNote(m_input, m_id, m_type == Endnote);
+ else
+@@ -337,7 +337,7 @@
+ uint16_t high_surrogate = 0;
+ bool fail = false;
+ uint16_t readVal;
+- uint32_t ucs4Character;
++ uint32_t ucs4Character(0);
+ while (true)
+ {
+ if (input->atEOS())
More information about the Libreoffice-commits
mailing list