2 commits - util/cairo-script

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 17 15:57:08 UTC 2024


 util/cairo-script/cairo-script-scanner.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b3d578ec2ff97450cccdf9275c503fc0afa7cc80
Merge: 3e12dfda3 1528c96da
Author: Uli Schlachter <psychon at znc.in>
Date:   Wed Apr 17 15:57:04 2024 +0000

    Merge branch 'fix-warning' into 'master'
    
    Fix implicit conversion warning
    
    See merge request cairo/cairo!542

commit 1528c96da6af99a992406877bab62ef8c4043843
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sat Feb 17 20:36:53 2024 +1030

    Fix implicit conversion warning
    
    GCC 12.2 reports the following warning:
    
    [3/16] Compiling C object util/cairo-script/libcairo-script-interpreter.so.2.11801.1.p/cairo-script-scanner.c.o
    ../util/cairo-script/cairo-script-scanner.c:1562:38: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion]
        if (real >= INT32_MIN && real <= INT32_MAX && (int) real == real)
                                      ~~ ^~~~~~~~~
    /usr/include/stdint.h:123:22: note: expanded from macro 'INT32_MAX'
                                     ^~~~~~~~~~

diff --git a/util/cairo-script/cairo-script-scanner.c b/util/cairo-script/cairo-script-scanner.c
index fe6512dd9..a69ae5f5a 100644
--- a/util/cairo-script/cairo-script-scanner.c
+++ b/util/cairo-script/cairo-script-scanner.c
@@ -1559,7 +1559,7 @@ _translate_real (csi_t *ctx,
 {
     uint8_t hdr;
 
-    if (real >= INT32_MIN && real <= INT32_MAX && (int) real == real)
+    if ((double)real >= INT32_MIN && (double)real <= INT32_MAX && (int) real == real)
 	return _translate_integer (ctx, real, closure);
 
 #if WORDS_BIGENDIAN


More information about the cairo-commit mailing list