From ca44a024da3b95f46c3a8422b29314defd4ae64b Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 28 Jan 2010 04:50:27 +0000 Subject: Avoiding warnings from cppcheck. Mostly removing bodies of private copy constructors and operator=. Also ensuring initialisation for some fields, reducing scope where possible, and passing by const reference. --- gtk/PlatGTK.cxx | 8 ++++---- gtk/ScintillaGTK.cxx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gtk') diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index d01c89bbc..30d8d7da2 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -352,6 +352,7 @@ static void GenerateFontSpecStrings(const char *fontName, int characterSet, char tmp[300]; char *d1 = NULL, *d2 = NULL, *d3 = NULL; strncpy(tmp, fontName, sizeof(tmp) - 1); + tmp[sizeof(tmp) - 1] = '\0'; d1 = strchr(tmp, '-'); // we know the first dash exists d2 = strchr(d1 + 1, '-'); @@ -1994,9 +1995,7 @@ class ListBoxX : public ListBox { #if GTK_MAJOR_VERSION >= 2 GtkCellRenderer* pixbuf_renderer; #endif - int lineHeight; XPMSet xset; - bool unicodeMode; int desiredVisibleRows; unsigned int maxItemCharacters; unsigned int aveCharWidth; @@ -2004,8 +2003,9 @@ public: CallBackAction doubleClickAction; void *doubleClickActionData; - ListBoxX() : list(0), pixhash(NULL), desiredVisibleRows(5), maxItemCharacters(0), - doubleClickAction(NULL), doubleClickActionData(NULL) { + ListBoxX() : list(0), pixhash(NULL), + desiredVisibleRows(5), maxItemCharacters(0), + aveCharWidth(1), doubleClickAction(NULL), doubleClickActionData(NULL) { #if GTK_MAJOR_VERSION < 2 current = 0; #endif diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index aec9e1b7a..6f318205d 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -156,8 +156,8 @@ class ScintillaGTK : public ScintillaBase { GdkRegion *rgnUpdate; // Private so ScintillaGTK objects can not be copied - ScintillaGTK(const ScintillaGTK &) : ScintillaBase() {} - ScintillaGTK &operator=(const ScintillaGTK &) { return * this; } + ScintillaGTK(const ScintillaGTK &); + ScintillaGTK &operator=(const ScintillaGTK &); public: ScintillaGTK(_ScintillaObject *sci_); -- cgit v1.2.3