[gegl] gegl: drop internal gegl_clear_pointer and use g_clear_pointer directly
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl: drop internal gegl_clear_pointer and use g_clear_pointer directly
- Date: Mon, 24 Sep 2018 15:00:14 +0000 (UTC)
commit d3be2b44ad023c8d9e0a7ce3b316ba313dedd9fd
Author: Øyvind Kolås <pippin gimp org>
Date: Mon Sep 24 16:59:08 2018 +0200
gegl: drop internal gegl_clear_pointer and use g_clear_pointer directly
The warnings were due to excessive casting in the call invoking g_clear_pointer
previously.
gegl/gegl-utils.h | 8 --------
gegl/module/geglmodule.c | 2 +-
gegl/process/gegl-eval-manager.c | 2 +-
gegl/process/gegl-processor.c | 6 +++---
4 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/gegl/gegl-utils.h b/gegl/gegl-utils.h
index 91317188d..a4d65c0cb 100644
--- a/gegl/gegl-utils.h
+++ b/gegl/gegl-utils.h
@@ -348,14 +348,6 @@ GeglNode *gegl_node_new_from_serialized (const gchar *chaindata,
const gchar *path_root);
-#define gegl_clear_pointer(ptr, dfun) \
- do { \
- if (*ptr) { \
- dfun(*ptr);\
- *ptr = NULL;\
- } \
- } while(0)
-
G_END_DECLS
#endif /* __GEGL_UTILS_H__ */
diff --git a/gegl/module/geglmodule.c b/gegl/module/geglmodule.c
index 73a37fc0a..27f8462ce 100644
--- a/gegl/module/geglmodule.c
+++ b/gegl/module/geglmodule.c
@@ -98,7 +98,7 @@ gegl_module_finalize (GObject *object)
{
GeglModule *module = GEGL_MODULE (object);
- gegl_clear_pointer (&module->info, gegl_module_info_free);
+ g_clear_pointer (&module->info, gegl_module_info_free);
g_free (module->last_module_error);
g_free (module->filename);
diff --git a/gegl/process/gegl-eval-manager.c b/gegl/process/gegl-eval-manager.c
index 45305da06..6934ced4e 100644
--- a/gegl/process/gegl-eval-manager.c
+++ b/gegl/process/gegl-eval-manager.c
@@ -59,7 +59,7 @@ gegl_eval_manager_finalize (GObject *self_object)
GeglEvalManager *self = GEGL_EVAL_MANAGER (self_object);
g_free (self->pad_name);
- gegl_clear_pointer (&self->traversal, gegl_graph_free);
+ g_clear_pointer (&self->traversal, gegl_graph_free);
g_signal_handlers_disconnect_by_data (self->node, self);
diff --git a/gegl/process/gegl-processor.c b/gegl/process/gegl-processor.c
index 0778181a0..fc52606d3 100644
--- a/gegl/process/gegl-processor.c
+++ b/gegl/process/gegl-processor.c
@@ -161,14 +161,14 @@ gegl_processor_finalize (GObject *self_object)
{
GeglProcessor *processor = GEGL_PROCESSOR (self_object);
- gegl_clear_pointer (&processor->context, gegl_operation_context_destroy);
+ g_clear_pointer (&processor->context, gegl_operation_context_destroy);
g_clear_object (&processor->node);
g_clear_object (&processor->real_node);
g_clear_object (&processor->input);
- gegl_clear_pointer (&processor->queued_region, gegl_region_destroy);
- gegl_clear_pointer (&processor->valid_region, gegl_region_destroy);
+ g_clear_pointer (&processor->queued_region, gegl_region_destroy);
+ g_clear_pointer (&processor->valid_region, gegl_region_destroy);
G_OBJECT_CLASS (gegl_processor_parent_class)->finalize (self_object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]