Kaydet (Commit) 120cd2b5 authored tarafından Caolán McNamara's avatar Caolán McNamara

WaE: MSVC2008 C4309 truncation of constant data

Change-Id: I7cae514cfd3c51bde5e8e0df2c51bed23904569d
üst 86ebc34d
...@@ -225,8 +225,8 @@ bool PDFString::emit( EmitContext& rWriteContext ) const ...@@ -225,8 +225,8 @@ bool PDFString::emit( EmitContext& rWriteContext ) const
// check for string or hex string // check for string or hex string
const sal_Char* pStr = aFiltered.getStr(); const sal_Char* pStr = aFiltered.getStr();
if( aFiltered.getLength() > 1 && if( aFiltered.getLength() > 1 &&
( (pStr[0] == sal_Char(0xff) && pStr[1] == sal_Char(0xfe)) || ( ((unsigned char)pStr[0] == 0xff && (unsigned char)pStr[1] == 0xfe) ||
(pStr[0] == sal_Char(0xfe) && pStr[1] == sal_Char(0xff)) ) ) ((unsigned char)pStr[0] == 0xfe && (unsigned char)pStr[1] == 0xff) ) )
{ {
static const char pHexTab[16] = { '0', '1', '2', '3', '4', '5', '6', '7', static const char pHexTab[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
......
...@@ -181,7 +181,8 @@ void writePbm_(OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, b ...@@ -181,7 +181,8 @@ void writePbm_(OutputBuffer& o_rOutputBuf, Stream* str, int width, int height, b
o_rOutputBuf[0] = 'P'; o_rOutputBuf[0] = 'P';
o_rOutputBuf[1] = '4'; o_rOutputBuf[1] = '4';
o_rOutputBuf[2] = 0x0A; 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 ) if( nOutLen < 0 )
nOutLen = WRITE_BUFFER_SIZE-10; nOutLen = WRITE_BUFFER_SIZE-10;
o_rOutputBuf[3+nOutLen] =0x0A; o_rOutputBuf[3+nOutLen] =0x0A;
...@@ -228,7 +229,8 @@ void writePpm_( OutputBuffer& o_rOutputBuf, ...@@ -228,7 +229,8 @@ void writePpm_( OutputBuffer& o_rOutputBuf,
o_rOutputBuf[0] = 'P'; o_rOutputBuf[0] = 'P';
o_rOutputBuf[1] = '6'; o_rOutputBuf[1] = '6';
o_rOutputBuf[2] = '\n'; 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 ) if( nOutLen < 0 )
nOutLen = WRITE_BUFFER_SIZE-10; nOutLen = WRITE_BUFFER_SIZE-10;
o_rOutputBuf[3+nOutLen] ='\n'; o_rOutputBuf[3+nOutLen] ='\n';
......
...@@ -295,7 +295,7 @@ extern FILE* g_binary_out; ...@@ -295,7 +295,7 @@ extern FILE* g_binary_out;
// note: if you ever hcange Output_t, please keep in mind that the current code // note: if you ever hcange Output_t, please keep in mind that the current code
// relies on it being of 8 bit size // relies on it being of 8 bit size
typedef char Output_t; typedef Guchar Output_t;
typedef std::vector< Output_t > OutputBuffer; typedef std::vector< Output_t > OutputBuffer;
#endif /* INCLUDED_PDFI_OUTDEV_HXX */ #endif /* INCLUDED_PDFI_OUTDEV_HXX */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment