[gtkmm] SpinButton: Pass signal_input double&, not double*
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] SpinButton: Pass signal_input double&, not double*
- Date: Mon, 5 Jun 2017 07:43:30 +0000 (UTC)
commit ce4066bd9cb3c1ef8276661e8fe06fa4d1f7cdf3
Author: Daniel Boles <dboles src gnome org>
Date: Sat Jun 3 10:48:09 2017 +0100
SpinButton: Pass signal_input double&, not double*
The double* argument is to store the converted value from the text in
the SpinButton, so there is always a target to write to. Therefore, to
correctly use C++ style, this should use a reference and not a pointer.
https://bugzilla.gnome.org/show_bug.cgi?id=783136
gtk/src/spinbutton.hg | 2 +-
tools/m4/convert_gtk.m4 | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/src/spinbutton.hg b/gtk/src/spinbutton.hg
index 48db534..803c506 100644
--- a/gtk/src/spinbutton.hg
+++ b/gtk/src/spinbutton.hg
@@ -96,7 +96,7 @@ public:
*/
enum { INPUT_ERROR = -1 };
- _WRAP_SIGNAL(int input(double* new_value), "input")
+ _WRAP_SIGNAL(int input(double& new_value), "input")
_WRAP_SIGNAL(bool output(), "output")
_WRAP_SIGNAL(void wrapped(), "wrapped")
_WRAP_SIGNAL(void value_changed(), "value_changed")
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 18dcbc0..6fc4341 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -20,6 +20,8 @@ include(convert_glib.m4)
#
# Basic Types
+_CONVERSION(`gdouble*',`double&',`*($3)')
+
_CONVERSION(`time_t&',`time_t*',`&($3)')
_CONVERSION(`time_t',`std::time_t',`$3')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]