[cairo-commit] src/cairo-misc.c

Bryce Harrington bryce at kemper.freedesktop.org
Wed Jan 24 03:26:15 UTC 2018


 src/cairo-misc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit bc335a741f2d69b57e5a0d39c471ef14a4a70df4
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Tue Jan 23 19:14:25 2018 -0800

    Fix two type casting warnings in get_C_locale()
    
    cairo-misc.c:806:43: warning: passing argument 1 of ‘_cairo_atomic_ptr_get’ from incompatible pointer type
         C = (locale_t) _cairo_atomic_ptr_get (&C_locale);
                                               ^
    
    cairo-misc.c:811:45: warning: passing argument 1 of ‘_cairo_atomic_ptr_cmpxchg_impl’ from incompatible pointer type
             if (!_cairo_atomic_ptr_cmpxchg (&C_locale, NULL, C)) {
                                                 ^
    
    Routines are expecting a void** so cast.

diff --git a/src/cairo-misc.c b/src/cairo-misc.c
index cf0d6d160..ecd866a64 100644
--- a/src/cairo-misc.c
+++ b/src/cairo-misc.c
@@ -803,12 +803,12 @@ get_C_locale (void)
     locale_t C;
 
 retry:
-    C = (locale_t) _cairo_atomic_ptr_get (&C_locale);
+    C = (locale_t) _cairo_atomic_ptr_get ((void **) &C_locale);
 
     if (unlikely (!C)) {
         C = newlocale (LC_ALL_MASK, "C", NULL);
 
-        if (!_cairo_atomic_ptr_cmpxchg (&C_locale, NULL, C)) {
+        if (!_cairo_atomic_ptr_cmpxchg ((void **) &C_locale, NULL, C)) {
             freelocale (C_locale);
             goto retry;
         }


More information about the cairo-commit mailing list