Package: vnc4
Version: 4.0-8
Severity: minor
Tags: patch
When building vnc4, gcc emits lots of warnings like this:
warning: 'class <foo>' has virtual functions but non-virtual destructor
Providing a virtual destructor is usually a good idea (see [1]), and I
believe it should be done in a later release (after the current FTBFS
problems are solved).
With the attached patch, all these warnings disappear and no new build
errors are introduced.
[1] http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.7
* Add virtual destructors in classes which use virtual functions.
--- vnc4-4.0.orig/tx/TXWindow.h
+++ vnc4-4.0/tx/TXWindow.h
@@ -40,6 +40,8 @@
class TXWindow;
class TXDeleteWindowCallback {
public:
+ virtual ~TXDeleteWindowCallback() {}
+
virtual void deleteWindow(TXWindow* w) = 0;
};
@@ -48,6 +50,8 @@
// handlers.
class TXEventHandler {
public:
+ virtual ~TXEventHandler() {}
+
virtual void handleEvent(TXWindow* w, XEvent* ev) = 0;
};
--- vnc4-4.0.orig/tx/TXButton.h
+++ vnc4-4.0/tx/TXButton.h
@@ -34,6 +34,8 @@
class TXButton;
class TXButtonCallback {
public:
+ virtual ~TXButtonCallback() {}
+
virtual void buttonActivate(TXButton* button)=0;
};
--- vnc4-4.0.orig/tx/TXCheckbox.h
+++ vnc4-4.0/tx/TXCheckbox.h
@@ -41,6 +41,8 @@
class TXCheckbox;
class TXCheckboxCallback {
public:
+ virtual ~TXCheckboxCallback() {}
+
virtual void checkboxSelect(TXCheckbox* checkbox)=0;
};
--- vnc4-4.0.orig/tx/TXMenu.h
+++ vnc4-4.0/tx/TXMenu.h
@@ -33,6 +33,8 @@
class TXMenu;
class TXMenuCallback {
public:
+ virtual ~TXMenuCallback() {}
+
virtual void menuSelect(long id, TXMenu* menu)=0;
};
--- vnc4-4.0.orig/tx/Timer.h
+++ vnc4-4.0/tx/Timer.h
@@ -45,6 +45,8 @@
class TimerCallback {
public:
+ virtual ~TimerCallback() {}
+
virtual void timerCallback(Timer* timer) = 0;
};
--- vnc4-4.0.orig/tx/TXScrollbar.h
+++ vnc4-4.0/tx/TXScrollbar.h
@@ -77,6 +77,8 @@
class TXScrollbarCallback {
public:
+ virtual ~TXScrollbarCallback() {}
+
virtual void scrollbarPos(int x, int y, TXScrollbar* sb)=0;
};
#endif
--- vnc4-4.0.orig/tx/TXEntry.h
+++ vnc4-4.0/tx/TXEntry.h
@@ -40,6 +40,9 @@
class TXEntryCallback {
public:
enum Detail { ENTER, NEXT_FOCUS, PREV_FOCUS };
+
+ virtual ~TXEntryCallback() {}
+
virtual void entryCallback(TXEntry* entry, Detail detail, Time time)=0;
};
--- vnc4-4.0.orig/rdr/Exception.h
+++ vnc4-4.0/rdr/Exception.h
@@ -37,6 +37,8 @@
type_[0] = 0;
strncat(type_, e, len-1);
}
+ virtual ~Exception() {}
+
virtual const char* str() const { return str_; }
virtual const char* type() const { return type_; }
};
--- vnc4-4.0.orig/rdr/FdInStream.h
+++ vnc4-4.0/rdr/FdInStream.h
@@ -29,6 +29,8 @@
class FdInStreamBlockCallback {
public:
+ virtual ~FdInStreamBlockCallback() {}
+
virtual void blockCallback() = 0;
};
--- vnc4-4.0.orig/rfb/UserPasswdGetter.h
+++ vnc4-4.0/rfb/UserPasswdGetter.h
@@ -20,6 +20,8 @@
namespace rfb {
class UserPasswdGetter {
public:
+ virtual ~UserPasswdGetter() {}
+
// getUserPasswd gets the username and password. This might
// involve a dialog, getpass(), etc. The user buffer pointer
// can be null, in which case no user name will be retrieved.
--- vnc4-4.0.orig/rfb/ColourMap.h
+++ vnc4-4.0/rfb/ColourMap.h
@@ -28,6 +28,8 @@
class ColourMap {
public:
+ virtual ~ColourMap() {}
+
virtual void lookup(int index, int* r, int* g, int* b)=0;
};
}
--- vnc4-4.0.orig/rfb/SSecurityVncAuth.h
+++ vnc4-4.0/rfb/SSecurityVncAuth.h
@@ -32,6 +32,8 @@
class VncAuthPasswdGetter {
public:
+ virtual ~VncAuthPasswdGetter() {}
+
// getPasswd() returns a string or null if unsuccessful. The
// SSecurityVncAuth object delete[]s the string when done.
virtual char* getVncAuthPasswd()=0;
--- vnc4-4.0.orig/rfb/SMsgWriter.h
+++ vnc4-4.0/rfb/SMsgWriter.h
@@ -39,6 +39,8 @@
class WriteSetCursorCallback {
public:
+ virtual ~WriteSetCursorCallback() {}
+
virtual void writeSetCursorCallback() = 0;
};
--- vnc4-4.0.orig/rfb/ImageGetter.h
+++ vnc4-4.0/rfb/ImageGetter.h
@@ -23,6 +23,8 @@
namespace rfb {
class ImageGetter {
public:
+ virtual ~ImageGetter() {}
+
virtual void getImage(void* imageBuf,
const Rect& r, int stride=0) = 0;
};
--- vnc4-4.0.orig/vncviewer/OptionsDialog.h
+++ vnc4-4.0/vncviewer/OptionsDialog.h
@@ -31,6 +31,8 @@
class OptionsDialogCallback {
public:
+ virtual ~OptionsDialogCallback() {}
+
virtual void setOptions() = 0;
virtual void getOptions() = 0;
};
--- vnc4-4.0.orig/network/Socket.h
+++ vnc4-4.0/network/Socket.h
@@ -68,6 +68,8 @@
class ConnectionFilter {
public:
+ virtual ~ConnectionFilter() {}
+
virtual bool verifyConnection(Socket* s) = 0;
virtual bool queryUserAcceptConnection(Socket*) {return false;}
};