summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Britten <britten@dilbert.caris.priv>2010-06-10 08:47:15 -0300
committerMurray Cumming <murrayc@murrayc.com>2010-09-02 13:23:54 +0200
commit78f426135e7015b5567d9867907c673222e30258 (patch)
treed21d078423b9b3854d3e1a3baf2645304dbb90cc
parent60bc5376e20b33d62c8ca6252677d481a5985045 (diff)
2010-06-10 Ian Britten <britten@caris.com>
Cleanup of most -Weffc++ warnings (Continuation of previous commit) Bug #28246 * cairomm/fontface.h (FontFace::FontFace): * cairomm/path.h (Path::Path): * cairomm/pattern.h (Pattern::Pattern): * cairomm/scaledfont.h (ScaledFont::ScaledFont): * cairomm/surface.h (Surface::Surface): Declare a private copy constructor and assignment operator in order to explicitly prevent objects from being copied by value. That was never valid, and not disallowing it seems to have been merely an oversight. * cairomm/fontoptions.cc: * cairomm/scaledfont.cc: Initialize member(s) in initialization list. * cairomm/scaledfont.h: Declared ~ScaledFont() virtual
-rw-r--r--ChangeLog18
-rw-r--r--cairomm/fontface.h4
-rw-r--r--cairomm/fontoptions.cc1
-rw-r--r--cairomm/path.h4
-rw-r--r--cairomm/pattern.h4
-rw-r--r--cairomm/scaledfont.cc2
-rw-r--r--cairomm/scaledfont.h6
-rw-r--r--cairomm/surface.h4
8 files changed, 42 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e66fe1e..6a9dd28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2010-06-10 Ian Britten <britten@caris.com>
+
+ Cleanup of most -Weffc++ warnings. Bug #28246.
+
+ * cairomm/fontface.h (FontFace::FontFace):
+ * cairomm/path.h (Path::Path):
+ * cairomm/pattern.h (Pattern::Pattern):
+ * cairomm/scaledfont.h (ScaledFont::ScaledFont):
+ * cairomm/surface.h (Surface::Surface): Declare a private copy
+ constructor and assignment operator in order to explicitly prevent
+ objects from being copied by value. That was never valid, and not
+ disallowing it seems to have been merely an oversight.
+
+ * cairomm/fontoptions.cc:
+ * cairomm/scaledfont.cc: Initialize member(s) in initialization list.
+
+ * cairomm/scaledfont.h: Declared ~ScaledFont() virtual
+
1.9.1:
2010-07-06 Murray Cumming <murrayc@murrayc.com>
diff --git a/cairomm/fontface.h b/cairomm/fontface.h
index cbd0813..c7d2e83 100644
--- a/cairomm/fontface.h
+++ b/cairomm/fontface.h
@@ -93,6 +93,10 @@ public:
protected:
cobject* m_cobject;
+
+private:
+ FontFace(const FontFace&);
+ FontFace& operator=(const FontFace&);
};
diff --git a/cairomm/fontoptions.cc b/cairomm/fontoptions.cc
index fc5ebbb..2ba339d 100644
--- a/cairomm/fontoptions.cc
+++ b/cairomm/fontoptions.cc
@@ -41,6 +41,7 @@ FontOptions::FontOptions(cairo_font_options_t* cobject, bool take_ownership)
}
FontOptions::FontOptions(const FontOptions& src)
+: m_cobject(0)
{
//Reference-counting, instead of copying by value:
if(!src.m_cobject)
diff --git a/cairomm/path.h b/cairomm/path.h
index f5f7480..28d843f 100644
--- a/cairomm/path.h
+++ b/cairomm/path.h
@@ -63,6 +63,10 @@ public:
protected:
cobject* m_cobject;
+
+private:
+ Path(const Path&);
+ Path& operator=(const Path&);
};
} // namespace Cairo
diff --git a/cairomm/pattern.h b/cairomm/pattern.h
index bb30d8a..28df65e 100644
--- a/cairomm/pattern.h
+++ b/cairomm/pattern.h
@@ -82,6 +82,10 @@ protected:
Pattern();
cobject* m_cobject;
+
+private:
+ Pattern(const Pattern&);
+ Pattern& operator=(const Pattern&);
};
class SolidPattern : public Pattern
diff --git a/cairomm/scaledfont.cc b/cairomm/scaledfont.cc
index 5a616fc..46ce491 100644
--- a/cairomm/scaledfont.cc
+++ b/cairomm/scaledfont.cc
@@ -24,6 +24,7 @@ namespace Cairo
{
ScaledFont::ScaledFont(cobject* cobj, bool has_reference)
+: m_cobject(0)
{
if(has_reference)
m_cobject = cobj;
@@ -33,6 +34,7 @@ ScaledFont::ScaledFont(cobject* cobj, bool has_reference)
ScaledFont::ScaledFont(const RefPtr<FontFace>& font_face, const cairo_matrix_t& font_matrix,
const cairo_matrix_t& ctm, const FontOptions& options)
+: m_cobject(0)
{
m_cobject =
cairo_scaled_font_create(font_face->cobj(),
diff --git a/cairomm/scaledfont.h b/cairomm/scaledfont.h
index 921aaad..b5c8f08 100644
--- a/cairomm/scaledfont.h
+++ b/cairomm/scaledfont.h
@@ -65,7 +65,7 @@ public:
*/
explicit ScaledFont(cobject* cobj, bool has_reference = false);
- ~ScaledFont();
+ virtual ~ScaledFont();
/** Creates a ScaledFont object from a font face and matrices that describe
* the size of the font and the environment in which it will be used.
@@ -227,6 +227,10 @@ protected:
const cairo_matrix_t& ctm, const FontOptions& options = FontOptions());
/** The underlying C cairo object that is wrapped by this ScaledFont */
cobject* m_cobject;
+
+private:
+ ScaledFont(const ScaledFont&);
+ ScaledFont& operator=(const ScaledFont&);
};
#ifdef CAIRO_HAS_FT_FONT
diff --git a/cairomm/surface.h b/cairomm/surface.h
index 9d6f4a5..c5b234b 100644
--- a/cairomm/surface.h
+++ b/cairomm/surface.h
@@ -302,6 +302,10 @@ protected:
/** The underlying C cairo surface type that is wrapped by this Surface
*/
cobject* m_cobject;
+
+private:
+ Surface(const Surface&);
+ Surface& operator=(const Surface&);
};
/** @example image-surface.cc