From 26fc93108ea86e56c4813a09867cbd71fa7be3b7 Mon Sep 17 00:00:00 2001 From: Brian Stafford Date: Thu, 22 Oct 2020 15:42:09 +0100 Subject: [PATCH] Silence gcc warnings caused by glib internals. --- pocplot.c | 6 ++++++ poctypes.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/pocplot.c b/pocplot.c index 281ba71..4238cb5 100644 --- a/pocplot.c +++ b/pocplot.c @@ -827,9 +827,12 @@ poc_plot_remove_dataset_internal (PocPlot *self, PocDataset *dataset) { PocAxis *axis; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" g_signal_handlers_disconnect_by_func (dataset, G_CALLBACK (poc_plot_notify_update), self); +#pragma GCC diagnostic pop if ((axis = poc_dataset_get_x_axis (dataset)) != NULL) poc_plot_remove_axis (self, axis); if ((axis = poc_dataset_get_y_axis (dataset)) != NULL) @@ -1002,9 +1005,12 @@ poc_plot_remove_axis (PocPlot *self, PocAxis *axis) if (poc_object_bag_remove (self->axes, G_OBJECT (axis))) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" g_signal_handlers_disconnect_by_func (axis, G_CALLBACK (poc_plot_notify_update), self); +#pragma GCC diagnostic pop if (axis == self->x_axis) { g_clear_object (&self->x_axis); diff --git a/poctypes.c b/poctypes.c index d715b0f..3fca351 100644 --- a/poctypes.c +++ b/poctypes.c @@ -48,7 +48,10 @@ poc_point_free (PocPoint *pt) g_slice_free (PocPoint, pt); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" G_DEFINE_BOXED_TYPE (PocPoint, poc_point, poc_point_copy, poc_point_free) +#pragma GCC diagnostic pop /* Point array {{{1 */ @@ -142,8 +145,11 @@ poc_point_array_set_size (PocPointArray *array, guint size) return (PocPointArray *) g_array_set_size ((GArray *) array, size); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" G_DEFINE_BOXED_TYPE (PocPointArray, poc_point_array, poc_point_array_ref, poc_point_array_unref) +#pragma GCC diagnostic pop /* Double array {{{1 */ @@ -231,8 +237,11 @@ poc_double_array_unref (PocDoubleArray *array) g_array_unref ((GArray *) array); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" G_DEFINE_BOXED_TYPE (PocDoubleArray, poc_double_array, poc_double_array_ref, poc_double_array_unref) +#pragma GCC diagnostic pop /* Enums {{{1 */