From 28c6bcc9b6d653c4790dc8cc14433ce5d13a7c50 Mon Sep 17 00:00:00 2001 From: DRC Date: Thu, 3 Nov 2011 00:53:57 +0000 Subject: [PATCH] Fix compiler warnings uncovered with -Wall git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4752 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/rfb/ColourMap.h | 3 ++- common/rfb/ImageGetter.h | 1 + common/rfb/PixelFormat.cxx | 2 -- common/rfb/TightEncoder.cxx | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/common/rfb/ColourMap.h b/common/rfb/ColourMap.h index 22d6789c..c024adce 100644 --- a/common/rfb/ColourMap.h +++ b/common/rfb/ColourMap.h @@ -30,12 +30,13 @@ namespace rfb { class ColourMap { public: virtual void lookup(int index, int* r, int* g, int* b)=0; + virtual ~ColourMap() {} }; class SimpleColourMap : public ColourMap { public: SimpleColourMap(int size = 256) { table = new Colour[size]; }; - ~SimpleColourMap() { delete [] table; }; + virtual ~SimpleColourMap() { delete [] table; }; void lookup(int index, int* r, int* g, int* b) { *r = table[index].r; *g = table[index].g; *b = table[index].b; }; diff --git a/common/rfb/ImageGetter.h b/common/rfb/ImageGetter.h index 290249f6..2e7bf376 100644 --- a/common/rfb/ImageGetter.h +++ b/common/rfb/ImageGetter.h @@ -25,6 +25,7 @@ namespace rfb { public: virtual void getImage(void* imageBuf, const Rect& r, int stride=0) = 0; + virtual ~ImageGetter() {} }; } #endif diff --git a/common/rfb/PixelFormat.cxx b/common/rfb/PixelFormat.cxx index b51adab2..c5bec825 100644 --- a/common/rfb/PixelFormat.cxx +++ b/common/rfb/PixelFormat.cxx @@ -299,8 +299,6 @@ void PixelFormat::rgbFromBuffer(rdr::U8* dst, const rdr::U8* src, int pixels, Co void PixelFormat::rgbFromBuffer(rdr::U8* dst, const rdr::U8* src, int w, int pitch, int h, ColourMap* cm) const { - rdr::U8 *rowptr, *colptr; - if (is888()) { // Optimised common case int rindex, gindex, bindex; diff --git a/common/rfb/TightEncoder.cxx b/common/rfb/TightEncoder.cxx index b7ef2236..1b37c8ad 100644 --- a/common/rfb/TightEncoder.cxx +++ b/common/rfb/TightEncoder.cxx @@ -317,7 +317,6 @@ bool TightEncoder::writeRect(const Rect& _r, TransImageGetter* _ig, Rect sr, bestr; int dx, dy, dw, dh; rdr::U32 colorValue; - int maxRectSize = pconf->maxRectSize; int maxRectWidth = pconf->maxRectWidth; int nMaxWidth = (w > maxRectWidth) ? maxRectWidth : w; int nMaxRows = pconf->maxRectSize / nMaxWidth; -- 2.39.5