summaryrefslogtreecommitdiff
path: root/progs/xdemos
diff options
context:
space:
mode:
Diffstat (limited to 'progs/xdemos')
-rw-r--r--progs/xdemos/Makefile3
-rw-r--r--progs/xdemos/corender.c3
-rw-r--r--progs/xdemos/glxinfo.c6
-rw-r--r--progs/xdemos/glxpbdemo.c1
-rw-r--r--progs/xdemos/offset.c1
-rw-r--r--progs/xdemos/pbdemo.c1
-rw-r--r--progs/xdemos/pbinfo.c1
-rw-r--r--progs/xdemos/sharedtex_mt.c8
8 files changed, 16 insertions, 8 deletions
diff --git a/progs/xdemos/Makefile b/progs/xdemos/Makefile
index 53e1c54ef3..77f667978c 100644
--- a/progs/xdemos/Makefile
+++ b/progs/xdemos/Makefile
@@ -8,6 +8,9 @@ INCDIR = $(TOP)/include
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
+# Add X11 and pthread libs to satisfy GNU gold.
+APP_LIB_DEPS += -lX11 -lpthread
+
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS)
PROGS = \
diff --git a/progs/xdemos/corender.c b/progs/xdemos/corender.c
index f2b8145e52..8c70535482 100644
--- a/progs/xdemos/corender.c
+++ b/progs/xdemos/corender.c
@@ -55,6 +55,7 @@ setup_ipc(void)
printf("Waiting for connection from another 'corender'\n");
Sock = AcceptConnection(k);
+ assert(Sock != -1);
printf("Got connection, sending windowID\n");
@@ -186,7 +187,7 @@ redraw(Display *dpy)
* Without this glClear(), depth buffer for the second process
* is pretty much broken.
*/
- //glClear(GL_DEPTH_BUFFER_BIT);
+ /*glClear(GL_DEPTH_BUFFER_BIT);*/
glPushMatrix();
glTranslatef(1, 0, 0);
diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c
index 445d3ea94b..b182a3091d 100644
--- a/progs/xdemos/glxinfo.c
+++ b/progs/xdemos/glxinfo.c
@@ -427,8 +427,6 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
int nConfigs;
if (!visinfo)
- configs = glXChooseFBConfig(dpy, scrnum, fbAttribSingle, &nConfigs);
- if (!visinfo)
configs = glXChooseFBConfig(dpy, scrnum, fbAttribDouble, &nConfigs);
if (configs) {
@@ -964,8 +962,10 @@ print_fbconfig_info(Display *dpy, int scrnum, InfoMode mode)
/* get list of all fbconfigs on this screen */
fbconfigs = glXGetFBConfigs(dpy, scrnum, &numFBConfigs);
- if (numFBConfigs == 0)
+ if (numFBConfigs == 0) {
+ XFree(fbconfigs);
return;
+ }
printf("%d GLXFBConfigs:\n", numFBConfigs);
if (mode == Normal)
diff --git a/progs/xdemos/glxpbdemo.c b/progs/xdemos/glxpbdemo.c
index 91fd30dcaa..ecf318ec6a 100644
--- a/progs/xdemos/glxpbdemo.c
+++ b/progs/xdemos/glxpbdemo.c
@@ -106,6 +106,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
if (0 == nConfigs || !fbConfigs) {
printf("Error: glxChooseFBConfig failed\n");
+ XFree(fbConfigs);
XCloseDisplay(dpy);
return 0;
}
diff --git a/progs/xdemos/offset.c b/progs/xdemos/offset.c
index 6c5abf383b..314a4fcdd1 100644
--- a/progs/xdemos/offset.c
+++ b/progs/xdemos/offset.c
@@ -294,6 +294,7 @@ process_input(Display *dpy, Window win) {
default:
break;
}
+ break;
case ButtonPress:
prevx = event.xbutton.x;
prevy = event.xbutton.y;
diff --git a/progs/xdemos/pbdemo.c b/progs/xdemos/pbdemo.c
index 2573209336..277df72924 100644
--- a/progs/xdemos/pbdemo.c
+++ b/progs/xdemos/pbdemo.c
@@ -131,6 +131,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
fbConfigs = ChooseFBConfig(dpy, screen, fbAttribs[attempt], &nConfigs);
if (nConfigs==0 || !fbConfigs) {
printf("Note: glXChooseFBConfig(%s) failed\n", fbString[attempt]);
+ XFree(fbConfigs);
continue;
}
diff --git a/progs/xdemos/pbinfo.c b/progs/xdemos/pbinfo.c
index b43adf1bb7..edfa9c1f3b 100644
--- a/progs/xdemos/pbinfo.c
+++ b/progs/xdemos/pbinfo.c
@@ -27,6 +27,7 @@ PrintConfigs(Display *dpy, int screen, Bool horizFormat)
fbConfigs = GetAllFBConfigs(dpy, screen, &nConfigs);
if (!nConfigs || !fbConfigs) {
printf("Error: glxGetFBConfigs failed\n");
+ XFree(fbConfigs);
return;
}
diff --git a/progs/xdemos/sharedtex_mt.c b/progs/xdemos/sharedtex_mt.c
index 07c1bfcc38..f924448cc4 100644
--- a/progs/xdemos/sharedtex_mt.c
+++ b/progs/xdemos/sharedtex_mt.c
@@ -447,7 +447,7 @@ main(int argc, char *argv[])
const char *dpyName = XDisplayName(NULL);
pthread_t t0, t1, t2, t3;
struct thread_init_arg tia0, tia1, tia2, tia3;
- struct window *h0, *h1, *h2, *h3;
+ struct window *h0;
XInitThreads();
@@ -462,9 +462,9 @@ main(int argc, char *argv[])
/* four windows and contexts sharing display lists and texture objects */
h0 = AddWindow(gDpy, dpyName, 10, 10, gCtx);
- h1 = AddWindow(gDpy, dpyName, 330, 10, gCtx);
- h2 = AddWindow(gDpy, dpyName, 10, 350, gCtx);
- h3 = AddWindow(gDpy, dpyName, 330, 350, gCtx);
+ (void) AddWindow(gDpy, dpyName, 330, 10, gCtx);
+ (void) AddWindow(gDpy, dpyName, 10, 350, gCtx);
+ (void) AddWindow(gDpy, dpyName, 330, 350, gCtx);
if (!glXMakeCurrent(gDpy, h0->Win, gCtx)) {
Error(dpyName, "glXMakeCurrent failed for init thread.");