libwpd: MSVC warning C4310: cast truncates constant value

Change-Id: Ibd6c7299b612d05d4c00ddfe47b51f45e3ae07d8
This commit is contained in:
Michael Stahl
2012-09-10 15:31:59 +02:00
parent 886a299b02
commit fcf415df47
2 changed files with 25 additions and 0 deletions
+1
View File
@@ -14,6 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,wpd,$(WPD_TARBALL)))
$(eval $(call gb_UnpackedTarball_add_patches,wpd,\
libwpd/libwpd-0.9.4.patch \
libwpd/libwpd-0.9.4-warning.patch \
libwpd/libwpd-0.9.4-msvc-warning.patch \
))
# libwpd/libwpd-0.9.4-warning.patch: -Werror,-Wunused-private-field
+24
View File
@@ -0,0 +1,24 @@
MSVC warning C4310: cast truncates constant value
diff -ru foo/UnpackedTarball/wpd/src/lib/WP3PageFormatGroup.cpp wpd_fix/src/lib/WP3PageFormatGroup.cpp
--- foo/UnpackedTarball/wpd/src/lib/WP3PageFormatGroup.cpp 2011-10-28 15:37:47.000000000 +0200
+++ foo/UnpackedTarball/wpd_fix/src/lib/WP3PageFormatGroup.cpp 2012-09-10 15:09:06.222400000 +0200
@@ -56,6 +56,7 @@
{
// this group can contain different kinds of data, thus we need to read
// the contents accordingly
+ uint8_t tmpTmp = 0xff;
int8_t tmpTabType = 0;
double tmpTabPosition = 0.0;
WPXTabStop tmpTabStop = WPXTabStop();
@@ -93,8 +94,9 @@
m_isRelative = (readU8(input, encryption) & 0x01);
- while ((tmpTabType = (int8_t)readU8(input, encryption)) != (int8_t)0xff)
+ while ((tmpTmp = readU8(input, encryption)) != 0xff)
{
+ tmpTabType = (int8_t) tmpTmp;
if (input->atEOS())
throw FileException();
tmpTabPosition = fixedPointToDouble(readU32(input, encryption, true)) / 72.0;