| 1 | From e45e11238036e06c8fe78bea1691b256ca41837b Mon Sep 17 00:00:00 2001
|
| 2 | From: Steve Langasek <[email protected]>
|
| 3 | Date: Tue, 7 Jan 2014 13:55:28 +0100
|
| 4 | Subject: [PATCH] fix prototypes of signal callbacks in the test suite
|
| 5 |
|
| 6 | The signal callbacks are defined to take pointers as their arguments, but the
|
| 7 | callbacks found in testsuite/gtk/builder.c are passing a GParamSpec by value
|
| 8 | as the second argument. This confuses and angers the compiler on ppc64el,
|
| 9 | resulting in segfaults after return from the function due to stack-smashing
|
| 10 | by the (completely-unused) argument.
|
| 11 |
|
| 12 | https://bugzilla.gnome.org/show_bug.cgi?id=721700
|
| 13 | ---
|
| 14 |
|
| 15 | This is a backport to v2.24.33 of upstream commit:
|
| 16 |
|
| 17 | https://gitlab.gnome.org/GNOME/gtk/-/commit/256561db2f0b34e01047f8882b3e0cb8c6d9dbab
|
| 18 |
|
| 19 | gtk/tests/builder.c | 16 ++++++++--------
|
| 20 | 1 file changed, 8 insertions(+), 8 deletions(-)
|
| 21 |
|
| 22 | diff --git a/gtk/tests/builder.c b/gtk/tests/builder.c
|
| 23 | index 8529dacc2f6e..23d5096062fa 100644
|
| 24 | |
| 25 | |
| 26 | @@ -132,7 +132,7 @@ static int object = 0;
|
| 27 | static int object_after = 0;
|
| 28 |
|
| 29 | void /* exported for GtkBuilder */
|
| 30 | -signal_normal (GtkWindow *window, GParamSpec spec)
|
| 31 | +signal_normal (GtkWindow *window, GParamSpec *spec)
|
| 32 | {
|
| 33 | g_assert (GTK_IS_WINDOW (window));
|
| 34 | g_assert (normal == 0);
|
| 35 | @@ -142,7 +142,7 @@ signal_normal (GtkWindow *window, GParamSpec spec)
|
| 36 | }
|
| 37 |
|
| 38 | void /* exported for GtkBuilder */
|
| 39 | -signal_after (GtkWindow *window, GParamSpec spec)
|
| 40 | +signal_after (GtkWindow *window, GParamSpec *spec)
|
| 41 | {
|
| 42 | g_assert (GTK_IS_WINDOW (window));
|
| 43 | g_assert (normal == 1);
|
| 44 | @@ -152,7 +152,7 @@ signal_after (GtkWindow *window, GParamSpec spec)
|
| 45 | }
|
| 46 |
|
| 47 | void /* exported for GtkBuilder */
|
| 48 | -signal_object (GtkButton *button, GParamSpec spec)
|
| 49 | +signal_object (GtkButton *button, GParamSpec *spec)
|
| 50 | {
|
| 51 | g_assert (GTK_IS_BUTTON (button));
|
| 52 | g_assert (object == 0);
|
| 53 | @@ -162,7 +162,7 @@ signal_object (GtkButton *button, GParamSpec spec)
|
| 54 | }
|
| 55 |
|
| 56 | void /* exported for GtkBuilder */
|
| 57 | -signal_object_after (GtkButton *button, GParamSpec spec)
|
| 58 | +signal_object_after (GtkButton *button, GParamSpec *spec)
|
| 59 | {
|
| 60 | g_assert (GTK_IS_BUTTON (button));
|
| 61 | g_assert (object == 1);
|
| 62 | @@ -172,28 +172,28 @@ signal_object_after (GtkButton *button, GParamSpec spec)
|
| 63 | }
|
| 64 |
|
| 65 | void /* exported for GtkBuilder */
|
| 66 | -signal_first (GtkButton *button, GParamSpec spec)
|
| 67 | +signal_first (GtkButton *button, GParamSpec *spec)
|
| 68 | {
|
| 69 | g_assert (normal == 0);
|
| 70 | normal = 10;
|
| 71 | }
|
| 72 |
|
| 73 | void /* exported for GtkBuilder */
|
| 74 | -signal_second (GtkButton *button, GParamSpec spec)
|
| 75 | +signal_second (GtkButton *button, GParamSpec *spec)
|
| 76 | {
|
| 77 | g_assert (normal == 10);
|
| 78 | normal = 20;
|
| 79 | }
|
| 80 |
|
| 81 | void /* exported for GtkBuilder */
|
| 82 | -signal_extra (GtkButton *button, GParamSpec spec)
|
| 83 | +signal_extra (GtkButton *button, GParamSpec *spec)
|
| 84 | {
|
| 85 | g_assert (normal == 20);
|
| 86 | normal = 30;
|
| 87 | }
|
| 88 |
|
| 89 | void /* exported for GtkBuilder */
|
| 90 | -signal_extra2 (GtkButton *button, GParamSpec spec)
|
| 91 | +signal_extra2 (GtkButton *button, GParamSpec *spec)
|
| 92 | {
|
| 93 | g_assert (normal == 30);
|
| 94 | normal = 40;
|