[gtkmm] Use std::size_t and std::ptrdiff_t.
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Use std::size_t and std::ptrdiff_t.
- Date: Thu, 13 Sep 2012 16:41:12 +0000 (UTC)
commit 7aa63e068811dd853cbe51fbcc63688b0f9706df
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Thu Sep 13 17:04:41 2012 +0200
Use std::size_t and std::ptrdiff_t.
* demos/gtk-demo/example_stockbrowser.cc:
* gtk/gtkmm/radiobuttongroup.h: Use std::size_t instead of ::size_t.
* gtk/src/treeiter.hg:
* gtk/src/treepath.hg: Use std::ptrdiff_t instead of ::ptrdiff_t.
Only the std versions are required to be declared in <cstddef>.
ChangeLog | 10 ++++++++++
demos/gtk-demo/example_stockbrowser.cc | 2 +-
gtk/gtkmm/radiobuttongroup.h | 4 ++--
gtk/src/treeiter.hg | 7 +++++--
gtk/src/treepath.hg | 7 +++++--
5 files changed, 23 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a4ca137..e3bb4a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-09-13 Kjell Ahlstedt <kjell ahlstedt bredband net>
+
+ Use std::size_t and std::ptrdiff_t.
+
+ * demos/gtk-demo/example_stockbrowser.cc:
+ * gtk/gtkmm/radiobuttongroup.h: Use std::size_t instead of ::size_t.
+ * gtk/src/treeiter.hg:
+ * gtk/src/treepath.hg: Use std::ptrdiff_t instead of ::ptrdiff_t.
+ Only the std versions are required to be declared in <cstddef>.
+
2012-09-01 Murray Cumming <murrayc murrayc com>
Added LevelBar .defs.
diff --git a/demos/gtk-demo/example_stockbrowser.cc b/demos/gtk-demo/example_stockbrowser.cc
index bd59903..01b5745 100644
--- a/demos/gtk-demo/example_stockbrowser.cc
+++ b/demos/gtk-demo/example_stockbrowser.cc
@@ -173,7 +173,7 @@ Glib::RefPtr<Gtk::TreeModel> Example_StockBrowser::create_model()
Glib::ustring Example_StockBrowser::id_to_symbol(const Gtk::StockID& stockid)
{
static const char prefix[] = "gtk-";
- const size_t prefix_length = sizeof(prefix) - 1;
+ const std::size_t prefix_length = sizeof(prefix) - 1;
const Glib::ustring id = stockid.get_string();
Glib::ustring::const_iterator id_pos = id.begin();
diff --git a/gtk/gtkmm/radiobuttongroup.h b/gtk/gtkmm/radiobuttongroup.h
index 29be253..2c0ed1a 100644
--- a/gtk/gtkmm/radiobuttongroup.h
+++ b/gtk/gtkmm/radiobuttongroup.h
@@ -21,7 +21,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <glibmm/object.h> //For RefPtr<> and size_t
+#include <glibmm/object.h> //For Glib::RefPtr<> and std::size_t
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C"
@@ -69,7 +69,7 @@ protected:
void add(const Glib::RefPtr<RadioAction>& item);
void add(RadioToolButton& item);
- void* operator new(size_t); // not implemented
+ void* operator new(std::size_t); // not implemented
GSList* group_;
};
diff --git a/gtk/src/treeiter.hg b/gtk/src/treeiter.hg
index 1a58a97..2c21f9e 100644
--- a/gtk/src/treeiter.hg
+++ b/gtk/src/treeiter.hg
@@ -21,6 +21,9 @@ _DEFS(gtkmm,gtk)
#include <gtkmm/treemodelcolumn.h>
#include <iterator>
#include <gtk/gtk.h> /* for GtkTreeIter */
+#ifdef GLIBMM_HAVE_SUN_REVERSE_ITERATOR
+#include <cstddef> /* for std::ptrdiff_t */
+#endif
namespace Gtk
{
@@ -339,7 +342,7 @@ public:
typedef std::reverse_iterator<iterator> reverse_iterator;
#else
typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
- int, int&, int*, ptrdiff_t> reverse_iterator;
+ int, int&, int*, std::ptrdiff_t> reverse_iterator;
#endif
typedef Gtk::TreeIter const_iterator; //TODO: Make it a real const_iterator.
@@ -348,7 +351,7 @@ public:
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
#else
typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
- int, const int&, const int*, ptrdiff_t> const_reverse_iterator;
+ int, const int&, const int*, std::ptrdiff_t> const_reverse_iterator;
#endif
iterator begin();
diff --git a/gtk/src/treepath.hg b/gtk/src/treepath.hg
index 677701e..452d314 100644
--- a/gtk/src/treepath.hg
+++ b/gtk/src/treepath.hg
@@ -24,6 +24,9 @@ _DEFS(gtkmm,gtk)
#include <gtkmm/treemodel.h>
#include <gtkmm/selectiondata.h>
+#ifdef GLIBMM_HAVE_SUN_REVERSE_ITERATOR
+#include <cstddef> /* for std::ptrdiff_t */
+#endif
namespace Gtk
{
@@ -64,10 +67,10 @@ public:
#else
typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
- int, int&, int*, ptrdiff_t> reverse_iterator;
+ int, int&, int*, std::ptrdiff_t> reverse_iterator;
typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
- int, const int&, const int*, ptrdiff_t> const_reverse_iterator;
+ int, const int&, const int*, std::ptrdiff_t> const_reverse_iterator;
#endif /* GLIBMM_HAVE_SUN_REVERSE_ITERATOR */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]