kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=4d6ff056ef1e463498c0873cae6345e8262195c3

commit 4d6ff056ef1e463498c0873cae6345e8262195c3
Author: Kim Woelders <k...@woelders.dk>
Date:   Sat Mar 10 18:54:19 2018 +0100

    grab.c: Fix gcc8 warning
    
    grab.c: In function ‘__imlib_GrabDrawableToRGBA’:
    grab.c:543:32: error: cast between incompatible function types from ‘void 
(*)(Display *, XErrorEvent *)’ {aka ‘void (*)(struct _XDisplay *, struct 
<anonymous> *)’} to ‘int (*)(Display *, XErrorEvent *)’ {aka ‘int (*)(struct 
_XDisplay *, struct <anonymous> *)’} [-Werror=cast-function-type]
        prev_erh = XSetErrorHandler((XErrorHandler) Tmp_HandleXError);
                                    ^
---
 src/lib/grab.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/grab.c b/src/lib/grab.c
index b9b8ec8..a7a41bb 100644
--- a/src/lib/grab.c
+++ b/src/lib/grab.c
@@ -13,10 +13,11 @@
 static char         _x_err = 0;
 static DATA8        rtab[256], gtab[256], btab[256];
 
-static void
+static int
 Tmp_HandleXError(Display * d, XErrorEvent * ev)
 {
    _x_err = 1;
+   return 0;
 }
 
 void
@@ -540,7 +541,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data, int ox, int oy, 
int ow, int oh,
    if (grab)
       XGrabServer(d);
    XSync(d, False);
-   prev_erh = XSetErrorHandler((XErrorHandler) Tmp_HandleXError);
+   prev_erh = XSetErrorHandler(Tmp_HandleXError);
    _x_err = 0;
    /* lets see if its a pixmap or not */
    XGetWindowAttributes(d, p, &xatt);

-- 


Reply via email to