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 10 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 <epoxy/egl.h>
#include "egl_common.h"
/**
* 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);
EGLint major, minor;
EGLDisplay *edpy;
bool ok;
if (!dpy)
errx(77, "couldn't open display\n");
EGLDisplay *edpy = eglGetDisplay(dpy);
edpy = eglGetDisplay(dpy);
if (!edpy)
errx(1, "Couldn't get EGL display for X11 Display.\n");
bool ok = eglInitialize(edpy, &major, &minor);
ok = eglInitialize(edpy, &major, &minor);
if (!ok)
errx(1, "eglInitialize() failed\n");

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

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

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

@ -134,15 +134,9 @@ int
main(int argc, char **argv)
{
bool pass = true;
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");
XVisualInfo *visinfo = get_glx_visual(dpy);
Window win = get_glx_window(dpy, visinfo, false);
GLXFBConfig config = get_fbconfig_for_visinfo(dpy, visinfo);
XVisualInfo *visinfo;
Window win;
GLXFBConfig config;
static const int attribs[] = {
GLX_CONTEXT_PROFILE_MASK_ARB,
GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
@ -152,8 +146,17 @@ main(int argc, char **argv)
2,
None
};
GLXContext ctx = glXCreateContextAttribsARB(dpy, config, NULL, True,
attribs);
GLXContext ctx;
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)
errx(77, "glXCreateContext failed");

Loading…
Cancel
Save