Fix compiler warnings in the tests.

I didn't have CWARNFLAGS in the Makefile.am, so lots of things that
would generate warnings had crept in.
macos/v1.5.9
Eric Anholt 11 years ago
parent 7c660c5c7a
commit 36847f88a7
  1. 7
      test/egl_common.c
  2. 2
      test/glx_common.c
  3. 2
      test/glx_common.h
  4. 3
      test/glx_glxgetprocaddress_nocontext.c
  5. 25
      test/glx_public_api_core.c

@ -23,6 +23,7 @@
#include <err.h> #include <err.h>
#include <epoxy/egl.h> #include <epoxy/egl.h>
#include "egl_common.h"
/** /**
* Do whatever it takes to get us an EGL display for the system. * Do whatever it takes to get us an EGL display for the system.
@ -34,15 +35,17 @@ get_egl_display_or_skip(void)
{ {
Display *dpy = XOpenDisplay(NULL); Display *dpy = XOpenDisplay(NULL);
EGLint major, minor; EGLint major, minor;
EGLDisplay *edpy;
bool ok;
if (!dpy) if (!dpy)
errx(77, "couldn't open display\n"); errx(77, "couldn't open display\n");
EGLDisplay *edpy = eglGetDisplay(dpy); edpy = eglGetDisplay(dpy);
if (!edpy) if (!edpy)
errx(1, "Couldn't get EGL display for X11 Display.\n"); errx(1, "Couldn't get EGL display for X11 Display.\n");
bool ok = eglInitialize(edpy, &major, &minor); ok = eglInitialize(edpy, &major, &minor);
if (!ok) if (!ok)
errx(1, "eglInitialize() failed\n"); errx(1, "eglInitialize() failed\n");

@ -24,7 +24,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include "epoxy/glx.h" #include "glx_common.h"
Display * Display *
get_display_or_skip(void) get_display_or_skip(void)

@ -26,7 +26,7 @@
Display * Display *
get_display_or_skip(void); get_display_or_skip(void);
GLXContext void
make_glx_context_current_or_skip(Display *dpy); make_glx_context_current_or_skip(Display *dpy);
GLXFBConfig GLXFBConfig

@ -43,12 +43,13 @@ int
main(int argc, char **argv) main(int argc, char **argv)
{ {
bool pass = true; bool pass = true;
void *func;
dpy = get_display_or_skip(); dpy = get_display_or_skip();
if (epoxy_glx_version(dpy, 0) < 14) if (epoxy_glx_version(dpy, 0) < 14)
errx(77, "GLX version 1.4 required for glXGetProcAddress().\n"); errx(77, "GLX version 1.4 required for glXGetProcAddress().\n");
void *func = glXGetProcAddress((const GLubyte *)"glGetString"); func = glXGetProcAddress((const GLubyte *)"glGetString");
if (!func) if (!func)
errx(1, "glXGetProcAddress() returned NULL\n"); errx(1, "glXGetProcAddress() returned NULL\n");

@ -134,15 +134,9 @@ int
main(int argc, char **argv) main(int argc, char **argv)
{ {
bool pass = true; bool pass = true;
XVisualInfo *visinfo;
dpy = get_display_or_skip(); Window win;
GLXFBConfig config;
if (!epoxy_has_glx_extension(dpy, 0, "GLX_ARB_create_context_profile"))
errx(77, "Test requires GLX_ARB_create_context_profile");
XVisualInfo *visinfo = get_glx_visual(dpy);
Window win = get_glx_window(dpy, visinfo, false);
GLXFBConfig config = get_fbconfig_for_visinfo(dpy, visinfo);
static const int attribs[] = { static const int attribs[] = {
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_PROFILE_MASK_ARB,
GLX_CONTEXT_CORE_PROFILE_BIT_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
@ -152,8 +146,17 @@ main(int argc, char **argv)
2, 2,
None None
}; };
GLXContext ctx = glXCreateContextAttribsARB(dpy, config, NULL, True, GLXContext ctx;
attribs);
dpy = get_display_or_skip();
if (!epoxy_has_glx_extension(dpy, 0, "GLX_ARB_create_context_profile"))
errx(77, "Test requires GLX_ARB_create_context_profile");
visinfo = get_glx_visual(dpy);
win = get_glx_window(dpy, visinfo, false);
config = get_fbconfig_for_visinfo(dpy, visinfo);
ctx = glXCreateContextAttribsARB(dpy, config, NULL, True, attribs);
if (ctx == None) if (ctx == None)
errx(77, "glXCreateContext failed"); errx(77, "glXCreateContext failed");

Loading…
Cancel
Save