From 5ecdb97be8bd04778c267116b59fe79967288bed Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Tue, 25 Dec 2012 22:47:32 -0600 Subject: Make comparison operators private and undeclared to avoid invalid conversions to pointers. --- poppler-glib/src/action.hg | 42 ++++++++++++++++++++++++++++++++++ poppler-glib/src/annot_callout_line.hg | 21 +++++++++++++++++ poppler-glib/src/color.hg | 21 +++++++++++++++++ poppler-glib/src/fonts_iter.hg | 21 +++++++++++++++++ poppler-glib/src/index_iter.hg | 21 +++++++++++++++++ poppler-glib/src/layers_iter.hg | 21 +++++++++++++++++ poppler-glib/src/page_transition.hg | 21 +++++++++++++++++ 7 files changed, 168 insertions(+) diff --git a/poppler-glib/src/action.hg b/poppler-glib/src/action.hg index b38f2a3..e9a7dd9 100644 --- a/poppler-glib/src/action.hg +++ b/poppler-glib/src/action.hg @@ -78,6 +78,27 @@ class Dest * @return true, if the Dest is valid */ inline operator BoolExpr() const { return gobj() ? GINT_TO_POINTER(1) : 0; } + + private: + /** Relational operators are deleted to prevent invalid conversion + * to const void*. + */ + bool operator<(const Dest& src) const; + + /// See operator<(). + bool operator<=(const Dest& src) const; + + /// See operator<(). + bool operator>(const Dest& src) const; + + /// See operator<(). + bool operator>=(const Dest& src) const; + + /// See operator<(). + bool operator==(const Dest& src) const; + + /// See operator<(). + bool operator!=(const Dest& src) const; }; /** Poppler::ActionLayer - Layer actions @@ -174,6 +195,27 @@ class Action * @endcode */ inline operator BoolExpr() const { return gobj() ? GINT_TO_POINTER(1) : 0; } + + private: + /** Relational operators are deleted to prevent invalid conversion + * to const void*. + */ + bool operator<(const Action& src) const; + + /// See operator<(). + bool operator<=(const Action& src) const; + + /// See operator<(). + bool operator>(const Action& src) const; + + /// See operator<(). + bool operator>=(const Action& src) const; + + /// See operator<(). + bool operator==(const Action& src) const; + + /// See operator<(). + bool operator!=(const Action& src) const; }; } // namespace Poppler diff --git a/poppler-glib/src/annot_callout_line.hg b/poppler-glib/src/annot_callout_line.hg index d4655b8..9c332c8 100644 --- a/poppler-glib/src/annot_callout_line.hg +++ b/poppler-glib/src/annot_callout_line.hg @@ -57,6 +57,27 @@ class AnnotCalloutLine * @endcode */ inline operator BoolExpr() const { return gobj() ? GINT_TO_POINTER(1) : 0; } + + private: + /** Relational operators are deleted to prevent invalid conversion + * to const void*. + */ + bool operator<(const AnnotCalloutLine& src) const; + + /// See operator<(). + bool operator<=(const AnnotCalloutLine& src) const; + + /// See operator<(). + bool operator>(const AnnotCalloutLine& src) const; + + /// See operator<(). + bool operator>=(const AnnotCalloutLine& src) const; + + /// See operator<(). + bool operator==(const AnnotCalloutLine& src) const; + + /// See operator<(). + bool operator!=(const AnnotCalloutLine& src) const; }; } // namespace Poppler diff --git a/poppler-glib/src/color.hg b/poppler-glib/src/color.hg index e27de17..0aba995 100644 --- a/poppler-glib/src/color.hg +++ b/poppler-glib/src/color.hg @@ -52,6 +52,27 @@ class Color * @endcode */ inline operator BoolExpr() const { return gobj() ? GINT_TO_POINTER(1) : 0; } + + private: + /** Relational operators are deleted to prevent invalid conversion + * to const void*. + */ + bool operator<(const Color& src) const; + + /// See operator<(). + bool operator<=(const Color& src) const; + + /// See operator<(). + bool operator>(const Color& src) const; + + /// See operator<(). + bool operator>=(const Color& src) const; + + /// See operator<(). + bool operator==(const Color& src) const; + + /// See operator<(). + bool operator!=(const Color& src) const; }; } // namespace Poppler diff --git a/poppler-glib/src/fonts_iter.hg b/poppler-glib/src/fonts_iter.hg index 7ca44e4..124ef17 100644 --- a/poppler-glib/src/fonts_iter.hg +++ b/poppler-glib/src/fonts_iter.hg @@ -54,6 +54,27 @@ class FontsIter * @endcode */ inline operator BoolExpr() const { return gobj() ? GINT_TO_POINTER(1) : 0; } + + private: + /** Relational operators are deleted to prevent invalid conversion + * to const void*. + */ + bool operator<(const FontsIter& src) const; + + /// See operator<(). + bool operator<=(const FontsIter& src) const; + + /// See operator<(). + bool operator>(const FontsIter& src) const; + + /// See operator<(). + bool operator>=(const FontsIter& src) const; + + /// See operator<(). + bool operator==(const FontsIter& src) const; + + /// See operator<(). + bool operator!=(const FontsIter& src) const; }; } // namespace Poppler diff --git a/poppler-glib/src/index_iter.hg b/poppler-glib/src/index_iter.hg index c513d5b..086c805 100644 --- a/poppler-glib/src/index_iter.hg +++ b/poppler-glib/src/index_iter.hg @@ -74,6 +74,27 @@ class IndexIter * @endcode */ inline operator BoolExpr() const { return gobj() ? GINT_TO_POINTER(1) : 0; } + + private: + /** Relational operators are deleted to prevent invalid conversion + * to const void*. + */ + bool operator<(const IndexIter& src) const; + + /// See operator<(). + bool operator<=(const IndexIter& src) const; + + /// See operator<(). + bool operator>(const IndexIter& src) const; + + /// See operator<(). + bool operator>=(const IndexIter& src) const; + + /// See operator<(). + bool operator==(const IndexIter& src) const; + + /// See operator<(). + bool operator!=(const IndexIter& src) const; }; } // namespace Poppler diff --git a/poppler-glib/src/layers_iter.hg b/poppler-glib/src/layers_iter.hg index 64df78f..bc44be0 100644 --- a/poppler-glib/src/layers_iter.hg +++ b/poppler-glib/src/layers_iter.hg @@ -48,6 +48,27 @@ class LayersIter * @endcode */ inline operator BoolExpr() const { return gobj() ? GINT_TO_POINTER(1) : 0; } + + private: + /** Relational operators are deleted to prevent invalid conversion + * to const void*. + */ + bool operator<(const LayersIter& src) const; + + /// See operator<(). + bool operator<=(const LayersIter& src) const; + + /// See operator<(). + bool operator>(const LayersIter& src) const; + + /// See operator<(). + bool operator>=(const LayersIter& src) const; + + /// See operator<(). + bool operator==(const LayersIter& src) const; + + /// See operator<(). + bool operator!=(const LayersIter& src) const; }; } // namespace Poppler diff --git a/poppler-glib/src/page_transition.hg b/poppler-glib/src/page_transition.hg index a0ea852..5d62d32 100644 --- a/poppler-glib/src/page_transition.hg +++ b/poppler-glib/src/page_transition.hg @@ -62,6 +62,27 @@ class PageTransition * @endcode */ inline operator BoolExpr() const { return gobj() ? GINT_TO_POINTER(1) : 0; } + + private: + /** Relational operators are deleted to prevent invalid conversion + * to const void*. + */ + bool operator<(const PageTransition& src) const; + + /// See operator<(). + bool operator<=(const PageTransition& src) const; + + /// See operator<(). + bool operator>(const PageTransition& src) const; + + /// See operator<(). + bool operator>=(const PageTransition& src) const; + + /// See operator<(). + bool operator==(const PageTransition& src) const; + + /// See operator<(). + bool operator!=(const PageTransition& src) const; }; } // namespace Poppler -- cgit v1.2.3