[gegl] operations: Fix set but unused variables which gcc



commit ff51dba63fe110d8f323ad5907908ef9adedfa34
Author: �yvind Kolås <pippin gimp org>
Date:   Tue May 17 20:15:03 2011 +0100

    operations: Fix set but unused variables which gcc
    
    Most of these are actually valid warnings, thus in total line count reduction,
    yay!

 operations/affine/module.c        |    3 +++
 operations/common/buffer-source.c |    2 --
 operations/common/dropshadow.c    |    2 --
 operations/common/introspect.c    |    2 --
 operations/common/magick-load.c   |    2 --
 operations/common/mblur.c         |    2 --
 operations/common/open-buffer.c   |    2 --
 operations/common/raw-load.c      |    2 --
 operations/common/rectangle.c     |    2 --
 operations/common/unsharp-mask.c  |    2 --
 operations/external/png-load.c    |    2 --
 tools/img_cmp.c                   |    4 ++--
 tools/operation_reference.c       |    7 ++-----
 13 files changed, 7 insertions(+), 27 deletions(-)
---
diff --git a/operations/affine/module.c b/operations/affine/module.c
index bf4d028..d01fd66 100644
--- a/operations/affine/module.c
+++ b/operations/affine/module.c
@@ -60,5 +60,8 @@ gegl_module_register (GTypeModule *module)
   dummy = reflect_get_type ();
   dummy = transform_get_type ();
 
+  dummy ++; /* silence gcc, having it is required to avoid optimizing
+               away the _get_type calls themselves */
+
   return TRUE;
 }
diff --git a/operations/common/buffer-source.c b/operations/common/buffer-source.c
index 6b5b5fe..eb103b0 100644
--- a/operations/common/buffer-source.c
+++ b/operations/common/buffer-source.c
@@ -101,10 +101,8 @@ static void
 gegl_chant_class_init (GeglChantClass *klass)
 {
   GeglOperationClass       *operation_class;
-  GeglOperationSourceClass *source_class;
 
   operation_class = GEGL_OPERATION_CLASS (klass);
-  source_class    = GEGL_OPERATION_SOURCE_CLASS (klass);
 
   operation_class->process = process;
   operation_class->get_bounding_box = get_bounding_box;
diff --git a/operations/common/dropshadow.c b/operations/common/dropshadow.c
index aaad4ac..7c2e2fc 100644
--- a/operations/common/dropshadow.c
+++ b/operations/common/dropshadow.c
@@ -68,10 +68,8 @@ static void attach (GeglOperation *operation)
 static void
 gegl_chant_class_init (GeglChantClass *klass)
 {
-  GObjectClass       *object_class;
   GeglOperationClass *operation_class;
 
-  object_class    = G_OBJECT_CLASS (klass);
   operation_class = GEGL_OPERATION_CLASS (klass);
   operation_class->attach = attach;
 
diff --git a/operations/common/introspect.c b/operations/common/introspect.c
index 6b67d6b..ad39a4b 100644
--- a/operations/common/introspect.c
+++ b/operations/common/introspect.c
@@ -144,11 +144,9 @@ gegl_chant_class_init (GeglChantClass *klass)
 {
   GObjectClass             *object_class;
   GeglOperationClass       *operation_class;
-  GeglOperationSourceClass *source_class;
 
   object_class    = G_OBJECT_CLASS (klass);
   operation_class = GEGL_OPERATION_CLASS (klass);
-  source_class    = GEGL_OPERATION_SOURCE_CLASS (klass);
 
   object_class->dispose             = gegl_introspect_dispose;
 
diff --git a/operations/common/magick-load.c b/operations/common/magick-load.c
index 3121af0..c3caa22 100644
--- a/operations/common/magick-load.c
+++ b/operations/common/magick-load.c
@@ -116,11 +116,9 @@ static void
 gegl_chant_class_init (GeglChantClass *klass)
 {
   GeglOperationClass       *operation_class;
-  GeglOperationSourceClass *source_class;
   GObjectClass             *object_class;
 
   operation_class = GEGL_OPERATION_CLASS (klass);
-  source_class    = GEGL_OPERATION_SOURCE_CLASS (klass);
   object_class    = G_OBJECT_CLASS (klass);
 
   object_class->finalize = finalize;
diff --git a/operations/common/mblur.c b/operations/common/mblur.c
index fe5f709..3f4b774 100644
--- a/operations/common/mblur.c
+++ b/operations/common/mblur.c
@@ -63,11 +63,9 @@ process (GeglOperation       *operation,
          GeglBuffer          *output,
          const GeglRectangle *result)
 {
-  GeglOperationFilter *filter;
   GeglChantO          *o;
   Priv *p;
 
-  filter = GEGL_OPERATION_FILTER (operation);
   o   = GEGL_CHANT_PROPERTIES (operation);
   p = (Priv*)o->chant_data;
   if (p == NULL)
diff --git a/operations/common/open-buffer.c b/operations/common/open-buffer.c
index da40915..e75105a 100644
--- a/operations/common/open-buffer.c
+++ b/operations/common/open-buffer.c
@@ -114,10 +114,8 @@ static void
 gegl_chant_class_init (GeglChantClass *klass)
 {
   GeglOperationClass       *operation_class;
-  GeglOperationSourceClass *source_class;
 
   operation_class = GEGL_OPERATION_CLASS (klass);
-  source_class    = GEGL_OPERATION_SOURCE_CLASS (klass);
 
   G_OBJECT_CLASS (klass)->dispose = dispose;
 
diff --git a/operations/common/raw-load.c b/operations/common/raw-load.c
index e182f29..334a041 100644
--- a/operations/common/raw-load.c
+++ b/operations/common/raw-load.c
@@ -163,11 +163,9 @@ static void
 gegl_chant_class_init (GeglChantClass *klass)
 {
   GeglOperationClass       *operation_class;
-  GeglOperationSourceClass *source_class;
   GObjectClass             *object_class;
 
   operation_class = GEGL_OPERATION_CLASS (klass);
-  source_class    = GEGL_OPERATION_SOURCE_CLASS (klass);
   object_class    = G_OBJECT_CLASS (klass);
 
   object_class->finalize = finalize;
diff --git a/operations/common/rectangle.c b/operations/common/rectangle.c
index 36f0db2..64c4c14 100644
--- a/operations/common/rectangle.c
+++ b/operations/common/rectangle.c
@@ -120,10 +120,8 @@ prepare (GeglOperation *operation)
 static void
 gegl_chant_class_init (GeglChantClass *klass)
 {
-  GObjectClass       *object_class;
   GeglOperationClass *operation_class;
 
-  object_class    = G_OBJECT_CLASS (klass);
   operation_class = GEGL_OPERATION_CLASS (klass);
 
   operation_class->name        = "gegl:rectangle";
diff --git a/operations/common/unsharp-mask.c b/operations/common/unsharp-mask.c
index 412df9e..fa34e71 100644
--- a/operations/common/unsharp-mask.c
+++ b/operations/common/unsharp-mask.c
@@ -60,10 +60,8 @@ static void attach (GeglOperation *operation)
 static void
 gegl_chant_class_init (GeglChantClass *klass)
 {
-  GObjectClass       *object_class;
   GeglOperationClass *operation_class;
 
-  object_class    = G_OBJECT_CLASS (klass);
   operation_class = GEGL_OPERATION_CLASS (klass);
   operation_class->attach = attach;
 
diff --git a/operations/external/png-load.c b/operations/external/png-load.c
index 52aa1d8..2278a8c 100644
--- a/operations/external/png-load.c
+++ b/operations/external/png-load.c
@@ -81,7 +81,6 @@ gegl_buffer_import_png (GeglBuffer  *gegl_buffer,
                         gpointer     format)
 {
   gint           width;
-  gint           height;
   gint           bit_depth;
   gint           bpp;
   gint           number_of_passes=1;
@@ -144,7 +143,6 @@ gegl_buffer_import_png (GeglBuffer  *gegl_buffer,
                   &interlace_type,
                   NULL, NULL);
     width = w;
-    height = h;
     if (ret_width)
       *ret_width = w;
     if (ret_height)
diff --git a/tools/img_cmp.c b/tools/img_cmp.c
index e137ec9..d59ece0 100644
--- a/tools/img_cmp.c
+++ b/tools/img_cmp.c
@@ -157,11 +157,11 @@ main (gint    argc,
          if (max_diff > 1.5 &&
              !strstr (argv[2], "broken"))
            {
-             GeglNode *graph, *sink;
+             GeglNode *sink;
              gchar *debug_path = g_malloc (strlen (argv[2])+16);
              memcpy (debug_path, argv[2], strlen (argv[2])+1);
              memcpy (debug_path + strlen(argv[2])-4, "-diff.png", 11);
-             graph = gegl_graph (sink=gegl_node ("gegl:png-save",
+             gegl_graph (sink=gegl_node ("gegl:png-save",
                                  "path", debug_path, NULL,
                                  gegl_node ("gegl:buffer-source", "buffer", debug_buf, NULL)));
              gegl_node_process (sink);
diff --git a/tools/operation_reference.c b/tools/operation_reference.c
index 6b08528..b7f7998 100644
--- a/tools/operation_reference.c
+++ b/tools/operation_reference.c
@@ -245,17 +245,15 @@ static void category_menu_index (gpointer key,
   gchar    *category = key;
   GList    *operations = value;
   GList    *iter;
-  gboolean  comma;
 
   if (!strcmp (category, "hidden"))
     return;
-  for (iter=operations, comma=FALSE;iter;iter = g_list_next (iter))
+  for (iter=operations;iter;iter = g_list_next (iter))
     {
       GeglOperationClass *klass = iter->data;
       if (strstr (klass->categories, "hidden"))
         continue;
       g_print ("<li><a href='#op_%s'>%s</a></li>\n", klass->name, klass->name);
-      comma = TRUE;
     }
 }
 
@@ -266,7 +264,6 @@ main (gint    argc,
   GList      *operations;
   GList      *iter;
   GHashTable *categories = NULL;
-  gboolean    comma;
 
   gegl_init (&argc, &argv);
 
@@ -274,7 +271,7 @@ main (gint    argc,
 
   /* Collect categories */
   categories = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
-  for (iter=operations, comma=FALSE;iter;iter = g_list_next (iter))
+  for (iter=operations;iter;iter = g_list_next (iter))
     {
       GeglOperationClass *klass = iter->data;
       const gchar *ptr = klass->categories;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]