[gimp/gimp-2-10] plug-ins: fix abs() on long int.



commit 164fa3494fae75095a755baf032509d71932e248
Author: Jehan <jehan girinstud io>
Date:   Mon Apr 13 23:18:19 2020 +0200

    plug-ins: fix abs() on long int.
    
    Fixes the following bug:
    
    > warning: absolute value function ‘abs’ given an argument of type
    > ‘glong’ {aka ‘long int’} but has parameter of type ‘int’ which may
    > cause truncation of value [-Wabsolute-value]
    
    (cherry picked from commit fddaa77218d29c676496341ac8472ae03233085e)

 plug-ins/common/sample-colorize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/plug-ins/common/sample-colorize.c b/plug-ins/common/sample-colorize.c
index 6ad78a86cf..bae918b7f7 100644
--- a/plug-ins/common/sample-colorize.c
+++ b/plug-ins/common/sample-colorize.c
@@ -1884,7 +1884,7 @@ color_error (guchar ref_red, guchar ref_green, guchar ref_blue,
   cmp_h = (3 * cmp_red + 6 * cmp_green + cmp_blue) / 10;
   ref_h = (3 * ref_red + 6 * ref_green + ref_blue) / 10;
 
-  fs = abs (ref_h - cmp_h);
+  fs = labs (ref_h - cmp_h);
   ff = fs * fs;
 
   /* 2. add Red Color differences */


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