summaryrefslogtreecommitdiff
path: root/src/xcb_util.c
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2006-09-15 00:39:51 -0700
committerJamey Sharp <jamey@minilop.net>2006-09-21 15:17:18 -0700
commit0aa96bfc7abe18889cd85bfaa05b05d53e572bb1 (patch)
tree65a41c93dd681cd21203a8b7ac48d53e0501537f /src/xcb_util.c
parentac17ae62fe1a3a29991e36e35eeee838ac4acb00 (diff)
Convert connection functions to return error objects.
Diffstat (limited to 'src/xcb_util.c')
-rw-r--r--src/xcb_util.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xcb_util.c b/src/xcb_util.c
index 3bdcd36..d93353b 100644
--- a/src/xcb_util.c
+++ b/src/xcb_util.c
@@ -45,6 +45,8 @@
#include "xcbext.h"
#include "xcbint.h"
+static const int error_connection = 1;
+
int XCBPopcount(CARD32 mask)
{
unsigned long y;
@@ -212,11 +214,11 @@ XCBConnection *XCBConnect(const char *displayname, int *screenp)
XCBAuthInfo auth;
if(!XCBParseDisplay(displayname, &host, &display, screenp))
- return 0;
+ return (XCBConnection *) &error_connection;
fd = _xcb_open(host, display);
free(host);
if(fd == -1)
- return 0;
+ return (XCBConnection *) &error_connection;
_xcb_get_auth_info(fd, &auth);
c = XCBConnectToFD(fd, &auth);
@@ -231,11 +233,11 @@ XCBConnection *XCBConnectToDisplayWithAuthInfo(const char *displayname, XCBAuthI
char *host;
if(!XCBParseDisplay(displayname, &host, &display, screenp))
- return 0;
+ return (XCBConnection *) &error_connection;
fd = _xcb_open(host, display);
free(host);
if(fd == -1)
- return 0;
+ return (XCBConnection *) &error_connection;
return XCBConnectToFD(fd, auth);
}