]> git.tokkee.org Git - inkscape.git/commitdiff

Code

Cleaned up virtual destructor problem and compile warnings.
authorjoncruz <joncruz@users.sourceforge.net>
Mon, 2 Oct 2006 08:34:42 +0000 (08:34 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Mon, 2 Oct 2006 08:34:42 +0000 (08:34 +0000)
src/extension/internal/libwpg/WPG1Parser.cpp
src/extension/internal/libwpg/WPG2Parser.cpp
src/extension/internal/libwpg/WPGPaintInterface.h
src/extension/internal/libwpg/WPGStream.h
src/extension/internal/libwpg/WPGXParser.h

index 372aa052cfe94bcb08e6de4ae819fa91ea5d6626..9f4a05148082938e856002c244f5aa4b54e3c843 100644 (file)
@@ -191,6 +191,9 @@ bool WPG1Parser::parse()
                int recordType = readU8();
                int length = readVariableLengthInteger();
                long nextPos = m_input->tell() + length;
+#if !defined(DEBUG)
+               (void)recordPos;
+#endif // !defined(DEBUG)
 
                // search function to handler this record
                int index = -1;
@@ -236,6 +239,8 @@ void WPG1Parser::handleStartWPG()
 {
        unsigned char version = readU8();
        unsigned char bitFlags = readU8();
+       (void)version;
+       (void)bitFlags;
        m_width = readU16();
        m_height = readU16();
 
@@ -260,7 +265,7 @@ void WPG1Parser::handleColormap()
        unsigned numEntries = readU16();
 
        WPG_DEBUG_MSG(("Colormap\n"));
-       for(int i = 0; i < numEntries; i++)
+       for(int i = 0; i < static_cast<int>(numEntries); i++)
        {
                WPGColor color;
                color.red = readU8();
index 8b6a4a674e53193dde77fc6d0be28c9ead1ccd0b..e0b642f0ed5fc0c20309803c0aacce059abce467 100644 (file)
@@ -181,12 +181,12 @@ public:
                rotate(false),
                hasObjectId(false),
                editLock(false),
-               objectId(0),
-               lockFlags(0),
                windingRule(false),
                filled(false),
                closed(false),
                framed(true),
+               objectId(0),
+               lockFlags(0),
                rotationAngle(0),
                sxcos(0),
                sycos(0),
@@ -319,6 +319,10 @@ bool WPG2Parser::parse()
                int extension = readVariableLengthInteger();
                int length = readVariableLengthInteger();
                long nextPos = m_input->tell() + length;
+#if !defined(DEBUG)
+               (void)recordPos;
+               (void)recordClass;
+#endif // !defined(DEBUG)
                
                // inside a subgroup, one less sub record
                if(!m_groupStack.empty())
@@ -395,6 +399,7 @@ bool WPG2Parser::parse()
        return m_success;
 }
 
+#if defined(DEBUG)
 static const char* describePrecision(unsigned char precision)
 {
        const char* result = "Unknown";
@@ -427,6 +432,7 @@ static const char* describeGradient(unsigned char gradientType)
        }
        return result;
 }
+#endif // defined(DEBUG)
 
 #define TO_DOUBLE(x) ( (m_doublePrecision) ? ((double)(x)/65536.0) : (double)(x) )
 #define TRANSFORM_XY(x,y) { m_matrix.transform((x),(y)); (x)-= m_xofs; (y)-= m_yofs; (y)=m_height-(y); }
@@ -460,6 +466,12 @@ void WPG2Parser::handleStartWPG()
        long viewportY1 = (m_doublePrecision) ? readS32() : readS16();
        long viewportX2 = (m_doublePrecision) ? readS32() : readS16();
        long viewportY2 = (m_doublePrecision) ? readS32() : readS16();
+#if !defined(DEBUG)
+       (void)viewportX1;
+       (void)viewportY1;
+       (void)viewportX2;
+       (void)viewportY2;
+#endif // !defined(DEBUG)
        
        long imageX1 = (m_doublePrecision) ? readS32() : readS16();
        long imageY1 = (m_doublePrecision) ? readS32() : readS16();
@@ -516,7 +528,7 @@ void WPG2Parser::handleStartWPG()
        
        // create default pen styles
        int styleNo = 0;
-       for(int i = 0; i < sizeof(WPG2_defaultPenDashes)/sizeof(WPG2_defaultPenDashes[0]);)
+       for(int i = 0; i < static_cast<int>(sizeof(WPG2_defaultPenDashes)/sizeof(WPG2_defaultPenDashes[0]));)
        {
                int segments = 2 * WPG2_defaultPenDashes[i++];
                if(segments == 0) break;
@@ -624,7 +636,7 @@ void WPG2Parser::handleDPColorPalette()
        unsigned startIndex = readU16();
        unsigned numEntries = readU16();
 
-       for(int i = 0; i < numEntries; i++)
+       for(int i = 0; i < static_cast<int>(numEntries); i++)
        {
                WPGColor color;
                color.red = readU16() >> 8 ;
@@ -730,6 +742,10 @@ void WPG2Parser::handleBrushGradient()
        unsigned flag = readU16();
        bool granular = (flag & (1<<6)) == 1;
        bool anchor = (flag & (1<<7)) == 1;
+#if !defined(DEBUG)
+       (void)granular;
+       (void)anchor;
+#endif // !defined(DEBUG)
        
        // TODO: get gradient extent
        
@@ -752,6 +768,10 @@ void WPG2Parser::handleDPBrushGradient()
        unsigned flag = readU16();
        bool granular = (flag & (1<<6)) == 1;
        bool anchor = (flag & (1<<7)) == 1;
+#if !defined(DEBUG)
+       (void)granular;
+       (void)anchor;
+#endif // !defined(DEBUG)
        
        // TODO: get gradient extent (in double precision)
        
@@ -923,6 +943,9 @@ void WPG2Parser::handleDPBrushBackColor()
 void WPG2Parser::handleBrushPattern()
 {
        unsigned int pattern = readU16();
+#if !defined(DEBUG)
+       (void)pattern;
+#endif // !defined(DEBUG)
 
        // TODO
 
@@ -1081,7 +1104,7 @@ void WPG2Parser::handlePolycurve()
 
        WPGPointArray vertices;
        WPGPointArray controlPoints;
-       for(int i = 0; i < count; i++ )
+       for(int i = 0; i < static_cast<int>(count); i++ )
        {
                long ix = (m_doublePrecision) ? readS32() : readS16();
                long iy = (m_doublePrecision) ? readS32() : readS16();
index 71f4a7adf9478de197084f4bd25187fe59777ebe..7866bd44817da9499ac5fb0ed1924049b13983aa 100644 (file)
@@ -38,6 +38,7 @@ namespace libwpg
 
 class WPGPaintInterface {
 public:
+       virtual ~WPGPaintInterface() {}
 
        // none of the other callback functions will be called before this function is called
        virtual void startDocument(double width, double height) = 0;
index 1b6a46c0aebb0f646a60b3bb7962704c1ed92e21..781c698547d1b9bd87f0a3dc2b91cb1e8de8a660 100644 (file)
@@ -32,6 +32,7 @@ namespace libwpg
 class WPGInputStream
 {
 public:
+       virtual ~WPGInputStream() {}
        virtual unsigned char getc() = 0;
        virtual long read(long n, char* buffer) = 0;
        virtual long tell() = 0;
index d98fd0ba4302ac5d79912dc0ba9de62d696418fc..71c78d2c0c44e1aa55040eefcc8e0d0e25ebf69f 100644 (file)
@@ -40,6 +40,7 @@ class WPGXParser
 {\r
 public:\r
        WPGXParser(WPGInputStream *input, WPGPaintInterface* painter);\r
+       virtual ~WPGXParser() {}\r
        virtual bool parse() = 0;\r
        \r
        unsigned char readU8();\r