[gimp] libgimpwidgets: fix GimpChainButton init().



commit e85dd77ad1b33b783d88f87bfd302dbd38a3c859
Author: Jehan <jehan girinstud io>
Date:   Sat Nov 7 18:14:58 2020 +0100

    libgimpwidgets: fix GimpChainButton init().
    
    So the minor fix on commit 3e35fe4d80 was not so minor after all, and I
    should have looked more in details into its contents.
    
    GET_PRIVATE() macro uses the `priv` pointer value hence had to be called
    after gimp_chain_button_get_instance_private(). Thus the order was
    important; the initialization and assignment values were actually
    different. Simply let's get rid of the previous initialization of
    `private` (make it declaration-only) to avoid cppcheck to (wrongfully)
    complain about double variable assignment to the same value.

 libgimpwidgets/gimpchainbutton.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/libgimpwidgets/gimpchainbutton.c b/libgimpwidgets/gimpchainbutton.c
index c05224853d..dd7ace0c3f 100644
--- a/libgimpwidgets/gimpchainbutton.c
+++ b/libgimpwidgets/gimpchainbutton.c
@@ -192,10 +192,11 @@ gimp_chain_button_class_init (GimpChainButtonClass *klass)
 static void
 gimp_chain_button_init (GimpChainButton *button)
 {
-  GimpChainButtonPrivate *private = GET_PRIVATE (button);
+  GimpChainButtonPrivate *private;
 
   button->priv = gimp_chain_button_get_instance_private (button);
 
+  private           = GET_PRIVATE (button);
   private->position = GIMP_CHAIN_TOP;
   private->active   = FALSE;
   private->image    = gtk_image_new ();


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