summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-11-27 16:54:21 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-11-27 16:54:21 -0800
commit8a2bb8793eed1c7f690be5c00772b2a64b9632fd (patch)
treea7ebf02fe6ff3c37602e8e90b17984a26986175f
parent781dbe7d723e9fe5a0e028dcb5a0fafeb59629e3 (diff)
Fix sparse warnings (type mismatches in function pointers, int as pointer)
-rw-r--r--src/XShape.c4
-rw-r--r--src/XTestExt1.c2
-rw-r--r--src/extutil.c8
-rw-r--r--src/globals.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/XShape.c b/src/XShape.c
index 29a7f83..6bae29a 100644
--- a/src/XShape.c
+++ b/src/XShape.c
@@ -461,7 +461,7 @@ XRectangle *XShapeGetRectangles (
}
*count = rep.nrects;
*ordering = rep.ordering;
- rects = 0;
+ rects = NULL;
if (*count) {
xrects = (xRectangle *) Xmalloc (*count * sizeof (xRectangle));
rects = (XRectangle *) Xmalloc (*count * sizeof (XRectangle));
@@ -471,7 +471,7 @@ XRectangle *XShapeGetRectangles (
if (rects)
Xfree (rects);
_XEatData (dpy, *count * sizeof (xRectangle));
- rects = 0;
+ rects = NULL;
*count = 0;
} else {
_XRead (dpy, (char *) xrects, *count * sizeof (xRectangle));
diff --git a/src/XTestExt1.c b/src/XTestExt1.c
index 28a733e..e7dce92 100644
--- a/src/XTestExt1.c
+++ b/src/XTestExt1.c
@@ -1200,7 +1200,7 @@ int ack_flag)
/*
* points to XTestIdentifyMyEvent
*/
- Bool (*func_ptr)();
+ Bool (*func_ptr)(Display *, XEvent *, XPointer);
/*
* write the input actions to the server
diff --git a/src/extutil.c b/src/extutil.c
index d96b17f..730649a 100644
--- a/src/extutil.c
+++ b/src/extutil.c
@@ -248,11 +248,11 @@ static int _default_exterror (Display *dpy, char *ext_name, char *reason)
* requested extension is referenced. This should eventually move into Xlib.
*/
-extern int (*_XExtensionErrorFunction)();
+extern int (*_XExtensionErrorFunction)(Display*, char *, char * );
-int (*XSetExtensionErrorHandler(int (*handler)(Display*, char *, char * )))()
+int (*XSetExtensionErrorHandler(int (*handler)(Display*, char *, char * )))(Display*, char *, char * )
{
- int (*oldhandler)() = _XExtensionErrorFunction;
+ int (*oldhandler)(Display*, char *, char * ) = _XExtensionErrorFunction;
_XExtensionErrorFunction = (handler ? handler :
_default_exterror);
@@ -265,7 +265,7 @@ int (*XSetExtensionErrorHandler(int (*handler)(Display*, char *, char * )))()
*/
int XMissingExtension (Display *dpy, _Xconst char *ext_name)
{
- int (*func)() = (_XExtensionErrorFunction ?
+ int (*func)(Display*, char *, char *) = (_XExtensionErrorFunction ?
_XExtensionErrorFunction : _default_exterror);
if (!ext_name) ext_name = X_EXTENSION_UNKNOWN;
diff --git a/src/globals.c b/src/globals.c
index 0cd5d26..120909a 100644
--- a/src/globals.c
+++ b/src/globals.c
@@ -75,7 +75,7 @@ from The Open Group.
/*
* Error handlers; used to be in XlibInt.c
*/
-typedef int (*funcptr)();
+typedef int (*funcptr)(Display*, char *, char *);
ZEROINIT (funcptr, _XExtensionErrorFunction, NULL);
/*