[gimp] app: remove the int return value from gimp_palette_mru_add()



commit bf6e396f28eb9eb2304c5b9e5233c073624beb0d
Author: Michael Natterer <mitch gimp org>
Date:   Sat Nov 29 13:38:12 2014 +0100

    app: remove the int return value from gimp_palette_mru_add()
    
    It's not needed any longer and was confusing anyway.

 app/core/gimppalettemru.c |   17 ++++-------------
 app/core/gimppalettemru.h |    2 +-
 2 files changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/app/core/gimppalettemru.c b/app/core/gimppalettemru.c
index a991af1..300c296 100644
--- a/app/core/gimppalettemru.c
+++ b/app/core/gimppalettemru.c
@@ -185,22 +185,19 @@ gimp_palette_mru_save (GimpPaletteMru *mru,
   gimp_config_writer_finish (writer, "end of colorrc", NULL);
 }
 
-gint
+void
 gimp_palette_mru_add (GimpPaletteMru *mru,
                       const GimpRGB  *color)
 {
   GimpPalette      *palette;
   GimpPaletteEntry *found = NULL;
   GList            *list;
-  gint              max_changed;
 
-  g_return_val_if_fail (GIMP_IS_PALETTE_MRU (mru), 0);
-  g_return_val_if_fail (color != NULL, 0);
+  g_return_if_fail (GIMP_IS_PALETTE_MRU (mru));
+  g_return_if_fail (color != NULL);
 
   palette = GIMP_PALETTE (mru);
 
-  max_changed = gimp_palette_get_n_colors (palette);
-
   /*  is the added color already there?  */
   for (list = gimp_palette_get_colors (palette);
        list;
@@ -244,13 +241,7 @@ gimp_palette_mru_add (GimpPaletteMru *mru,
  doit:
 
   if (found)
-    {
-      max_changed = found->position;
-
-      gimp_palette_delete_entry (palette, found);
-    }
+    gimp_palette_delete_entry (palette, found);
 
   found = gimp_palette_add_entry (palette, 0, _("History Color"), color);
-
-  return max_changed;
 }
diff --git a/app/core/gimppalettemru.h b/app/core/gimppalettemru.h
index 9864a27..b7bdc56 100644
--- a/app/core/gimppalettemru.h
+++ b/app/core/gimppalettemru.h
@@ -55,7 +55,7 @@ void       gimp_palette_mru_load     (GimpPaletteMru *mru,
 void       gimp_palette_mru_save     (GimpPaletteMru *mru,
                                       GFile          *file);
 
-gint       gimp_palette_mru_add      (GimpPaletteMru *mru,
+void       gimp_palette_mru_add      (GimpPaletteMru *mru,
                                       const GimpRGB  *color);
 
 


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