From: Fridrich S. <str...@us...> - 2008-12-30 08:54:09
|
Update of /cvsroot/libwpg/libwpg/src/lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15431/src/lib Modified Files: WPG1Parser.cpp WPG2Parser.cpp WPGHeader.cpp WPGInternalStream.cpp WPGInternalStream.h WPGSVGGenerator.cpp WPGXParser.cpp WPGraphics.cpp WPGraphics.h Log Message: adapting to the non-use of size_t in libwpd Index: WPGXParser.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGXParser.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- WPGXParser.cpp 28 Nov 2008 11:53:03 -0000 1.17 +++ WPGXParser.cpp 30 Dec 2008 08:53:57 -0000 1.18 @@ -42,7 +42,7 @@ { if (!m_input || m_input->atEOS()) return (unsigned char)0; - size_t numBytesRead; + unsigned long numBytesRead; unsigned char const * p = m_input->read(sizeof(unsigned char), numBytesRead); if (p && numBytesRead == 1) Index: WPGHeader.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGHeader.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- WPGHeader.cpp 16 Nov 2007 20:19:26 -0000 1.6 +++ WPGHeader.cpp 30 Dec 2008 08:53:57 -0000 1.7 @@ -67,7 +67,7 @@ { input->seek(0, WPX_SEEK_SET); - size_t n = 0; + unsigned long n = 0; unsigned char * prefix = (unsigned char *) input->read(26, n); if(n < 26) return false; Index: WPGraphics.h =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGraphics.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- WPGraphics.h 24 Nov 2008 10:16:19 -0000 1.13 +++ WPGraphics.h 30 Dec 2008 08:53:57 -0000 1.14 @@ -27,7 +27,6 @@ #define __WPGRAPHICS_H__ #include <libwpd/WPXString.h> -#include <stdio.h> class WPXInputStream; @@ -44,10 +43,10 @@ static bool isSupported(WPXInputStream* input); static bool parse(WPXInputStream* input, WPGPaintInterface* painter, WPGFileFormat fileFormat = WPG_AUTODETECT); - static bool parse(const unsigned char* data, const size_t size, WPGPaintInterface* painter, WPGFileFormat fileFormat = WPG_AUTODETECT); + static bool parse(const unsigned char* data, unsigned long size, WPGPaintInterface* painter, WPGFileFormat fileFormat = WPG_AUTODETECT); static bool generateSVG(WPXInputStream* input, WPXString& output, WPGFileFormat fileFormat = WPG_AUTODETECT); - static bool generateSVG(const unsigned char* data, const size_t size, WPXString& output, WPGFileFormat fileFormat = WPG_AUTODETECT); + static bool generateSVG(const unsigned char* data, unsigned long size, WPXString& output, WPGFileFormat fileFormat = WPG_AUTODETECT); }; } // namespace libwpg Index: WPGraphics.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGraphics.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- WPGraphics.cpp 24 Nov 2008 10:16:19 -0000 1.15 +++ WPGraphics.cpp 30 Dec 2008 08:53:57 -0000 1.16 @@ -156,7 +156,7 @@ return retval; } -bool libwpg::WPGraphics::parse(const unsigned char* data, const size_t size, libwpg::WPGPaintInterface* painter, libwpg::WPGFileFormat fileFormat) +bool libwpg::WPGraphics::parse(const unsigned char* data, unsigned long size, libwpg::WPGPaintInterface* painter, libwpg::WPGFileFormat fileFormat) { WPGInternalInputStream tmpStream(data, size); return libwpg::WPGraphics::parse(&tmpStream, painter, fileFormat); @@ -180,7 +180,7 @@ return result; } -bool libwpg::WPGraphics::generateSVG(const unsigned char* data, const size_t size, WPXString& output, libwpg::WPGFileFormat fileFormat) +bool libwpg::WPGraphics::generateSVG(const unsigned char* data, unsigned long size, WPXString& output, libwpg::WPGFileFormat fileFormat) { WPGInternalInputStream tmpStream(data, size); return libwpg::WPGraphics::generateSVG(&tmpStream, output, fileFormat); Index: WPGInternalStream.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGInternalStream.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- WPGInternalStream.cpp 23 Nov 2007 21:32:38 -0000 1.6 +++ WPGInternalStream.cpp 30 Dec 2008 08:53:57 -0000 1.7 @@ -25,7 +25,7 @@ #include "WPGInternalStream.h" -WPGInternalInputStream::WPGInternalInputStream(const unsigned char *data, const size_t size) : +WPGInternalInputStream::WPGInternalInputStream(const unsigned char *data, unsigned long size) : WPXInputStream(), m_offset(0), m_size(size), @@ -40,7 +40,7 @@ delete [] m_tmpBuf; } -const unsigned char * WPGInternalInputStream::read(size_t numBytes, size_t &numBytesRead) +const unsigned char * WPGInternalInputStream::read(unsigned long numBytes, unsigned long &numBytesRead) { numBytesRead = 0; @@ -64,7 +64,7 @@ return 0; m_tmpBuf = new unsigned char[numBytesToRead]; - for (size_t i=0; (long)i<(long)numBytesToRead; i++) + for (unsigned long i=0; (long)i<(long)numBytesToRead; i++) { m_tmpBuf[i] = m_data[m_offset]; m_offset++; Index: WPGSVGGenerator.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGSVGGenerator.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- WPGSVGGenerator.cpp 10 Dec 2008 12:54:28 -0000 1.31 +++ WPGSVGGenerator.cpp 30 Dec 2008 08:53:57 -0000 1.32 @@ -103,7 +103,7 @@ m_outputSink << " <stop offset=\"" << ofs << "%\""; // set stream to %02x formatting - size_t old_stream_size = m_outputSink.width(2); + unsigned long old_stream_size = m_outputSink.width(2); m_outputSink << std::hex; m_outputSink << " stop-color=\"" << color.cstr() << "\""; Index: WPGInternalStream.h =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGInternalStream.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- WPGInternalStream.h 19 Oct 2007 19:09:09 -0000 1.4 +++ WPGInternalStream.h 30 Dec 2008 08:53:57 -0000 1.5 @@ -29,20 +29,20 @@ class WPGInternalInputStream : public WPXInputStream { public: - WPGInternalInputStream(const unsigned char *data, const size_t size); + WPGInternalInputStream(const unsigned char *data, unsigned long size); virtual ~WPGInternalInputStream(); virtual bool isOLEStream() { return false; } virtual WPXInputStream * getDocumentOLEStream(const char* /*name*/) { return 0; } - const virtual unsigned char *read(size_t numBytes, size_t &numBytesRead); + const virtual unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead); virtual int seek(long offset, WPX_SEEK_TYPE seekType); virtual long tell(); virtual bool atEOS(); private: long m_offset; - const size_t m_size; + unsigned long m_size; const unsigned char *m_data; unsigned char *m_tmpBuf; WPGInternalInputStream(const WPGInternalInputStream&); Index: WPG2Parser.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPG2Parser.cpp,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- WPG2Parser.cpp 10 Dec 2008 12:54:28 -0000 1.97 +++ WPG2Parser.cpp 30 Dec 2008 08:53:57 -0000 1.98 @@ -1908,7 +1908,7 @@ { if (!m_graphicsStarted) return; - if ((size_t)m_binaryData.objectIndex >= m_binaryData.mimeTypes.size()) + if ((unsigned long)m_binaryData.objectIndex >= m_binaryData.mimeTypes.size()) return; unsigned accessoryDataLength = readU16(); m_input->seek(accessoryDataLength, WPX_SEEK_CUR); @@ -1935,8 +1935,8 @@ if (f) { const char *tmpBinaryBuffer = binaryData.getDataBuffer(); - const size_t tmpBufferSize = binaryData.size(); - for (size_t k = 0; k < tmpBufferSize; k++) + unsigned long tmpBufferSize = binaryData.size(); + for (unsigned long k = 0; k < tmpBufferSize; k++) fprintf(f, "%c",tmpBinaryBuffer[k]); fclose(f); } Index: WPG1Parser.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPG1Parser.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- WPG1Parser.cpp 5 Dec 2008 15:17:25 -0000 1.58 +++ WPG1Parser.cpp 30 Dec 2008 08:53:57 -0000 1.59 @@ -730,7 +730,7 @@ std::vector<unsigned char> buffer; decodeRLE(buffer, width, height, depth); - if (buffer.size() && buffer.size() == (size_t)((width*depth + 7)/8)*height) + if (buffer.size() && buffer.size() == (unsigned long)((width*depth + 7)/8)*height) { fillPixels(bitmap, &buffer[0], width, height, depth); m_painter->drawImageObject(propList, bitmap.getDIB()); @@ -799,7 +799,7 @@ std::vector<unsigned char> buffer; decodeRLE(buffer, width, height, depth); - if (buffer.size() && buffer.size() == (size_t)((width*depth + 7)/8)*height) + if (buffer.size() && buffer.size() == (unsigned long)((width*depth + 7)/8)*height) { fillPixels(bitmap, &buffer[0], width, height, depth); m_painter->drawImageObject(propList, bitmap.getDIB()); |