summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-05-16 15:43:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-05-17 14:03:25 +0100
commit120cd2b5789246d7992af7dacfd796a4fd3d8e05 (patch)
tree8de39d88bab142541b2ed51ccf3e093ff33a9797 /sdext
parent86ebc34dad026d9a32adca562b4604070e36a7a7 (diff)
WaE: MSVC2008 C4309 truncation of constant data
Change-Id: I7cae514cfd3c51bde5e8e0df2c51bed23904569d
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/pdfimport/pdfparse/pdfentries.cxx4
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx6
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx2
3 files changed, 7 insertions, 5 deletions
diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
index 9c36cf803128..0d650c940c7d 100644
--- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
@@ -225,8 +225,8 @@ bool PDFString::emit( EmitContext& rWriteContext ) const
// check for string or hex string
const sal_Char* pStr = aFiltered.getStr();
if( aFiltered.getLength() > 1 &&
- ( (pStr[0] == sal_Char(0xff) && pStr[1] == sal_Char(0xfe)) ||
- (pStr[0] == sal_Char(0xfe) && pStr[1] == sal_Char(0xff)) ) )
+ ( ((unsigned char)pStr[0] == 0xff && (unsigned char)pStr[1] == 0xfe) ||
+ ((unsigned char)pStr[0] == 0xfe && (unsigned char)pStr[1] == 0xff) ) )
{
static const char pHexTab[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index c8c7f209993c..87c0ab2afa0d 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -181,7 +181,8 @@ void writePbm_(OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, b
o_rOutputBuf[0] = 'P';
o_rOutputBuf[1] = '4';
o_rOutputBuf[2] = 0x0A;
- int nOutLen = snprintf(&o_rOutputBuf[3], WRITE_BUFFER_SIZE-10, "%d %d", width, height);
+ char *pAsCharPtr = reinterpret_cast<char *>(&o_rOutputBuf[3]);
+ int nOutLen = snprintf(pAsCharPtr, WRITE_BUFFER_SIZE-10, "%d %d", width, height);
if( nOutLen < 0 )
nOutLen = WRITE_BUFFER_SIZE-10;
o_rOutputBuf[3+nOutLen] =0x0A;
@@ -228,7 +229,8 @@ void writePpm_( OutputBuffer& o_rOutputBuf,
o_rOutputBuf[0] = 'P';
o_rOutputBuf[1] = '6';
o_rOutputBuf[2] = '\n';
- int nOutLen = snprintf(&o_rOutputBuf[3], WRITE_BUFFER_SIZE-10, "%d %d", width, height);
+ char *pAsCharPtr = reinterpret_cast<char *>(&o_rOutputBuf[3]);
+ int nOutLen = snprintf(pAsCharPtr, WRITE_BUFFER_SIZE-10, "%d %d", width, height);
if( nOutLen < 0 )
nOutLen = WRITE_BUFFER_SIZE-10;
o_rOutputBuf[3+nOutLen] ='\n';
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index f24dd9f5380d..bba8f58c9f71 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -295,7 +295,7 @@ extern FILE* g_binary_out;
// note: if you ever hcange Output_t, please keep in mind that the current code
// relies on it being of 8 bit size
-typedef char Output_t;
+typedef Guchar Output_t;
typedef std::vector< Output_t > OutputBuffer;
#endif /* INCLUDED_PDFI_OUTDEV_HXX */