diff options
author | Ian Britten <britten@dilbert.caris.priv> | 2010-06-10 08:47:15 -0300 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2010-11-03 09:03:55 +0100 |
commit | 781f37bef4907a693931cc53845095d427e0da86 (patch) | |
tree | f16d6f10f8e18a7516a49a096f79e84758a85681 | |
parent | 5411621aefa03d5f380a954bfe3790dfaf7cf2b0 (diff) |
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
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | cairomm/fontface.h | 4 | ||||
-rw-r--r-- | cairomm/fontoptions.cc | 1 | ||||
-rw-r--r-- | cairomm/path.h | 4 | ||||
-rw-r--r-- | cairomm/pattern.h | 4 | ||||
-rw-r--r-- | cairomm/scaledfont.cc | 2 | ||||
-rw-r--r-- | cairomm/scaledfont.h | 6 | ||||
-rw-r--r-- | cairomm/surface.h | 4 |
8 files changed, 42 insertions, 1 deletions
@@ -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 + 2010-06-07 Daniel Elstner <danielk@openismus.com> Do not unnecessarily cast booleans to pointers 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 |