[MPlayer-cvslog] r36774 - in trunk/libvo: gl_common.c gl_common.h gl_compat.h vo_gl.c

Guillaume POIRIER poirierg at gmail.com
Wed Feb 5 14:21:57 CET 2014


Hello,

On Sat, Feb 1, 2014 at 4:13 PM, reimar <subversion at mplayerhq.hu> wrote:
> Author: reimar
> Date: Sat Feb  1 16:13:00 2014
> New Revision: 36774

> +static GLvoid *wrap_glMapBuffer(GLenum target, ptrdiff_t offset, ptrdiff_t range, unsigned flags) {


This change tiggers this kind of error at compile time:


make
cc -MMD -MP -D_ISOC99_SOURCE -I. -Iffmpeg -O2 -march=corei7-avx -pipe
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
-Ilibdvdread4 -mdynamic-no-pic -I/opt/local/include/ -fpie -DPIC
-I/opt/local/include/freetype2 -c -o libvo/gl_common.o
libvo/gl_common.c
In file included from libvo/gl_common.c:42:
libvo/gl_common.h:284:57: warning: type specifier missing, defaults to
'int' [-Wimplicit-int]
extern GLvoid* (GLAPIENTRY *mpglMapBufferRange)(GLenum, ptrdiff_t,
ptrdiff_t, unsigned);
                                                        ^~~~~~~~~
libvo/gl_common.h:284:68: warning: type specifier missing, defaults to
'int' [-Wimplicit-int]
extern GLvoid* (GLAPIENTRY *mpglMapBufferRange)(GLenum, ptrdiff_t,
ptrdiff_t, unsigned);
                                                                   ^~~~~~~~~
libvo/gl_common.h:284:68: error: redefinition of parameter 'ptrdiff_t'
libvo/gl_common.h:284:57: note: previous declaration is here
extern GLvoid* (GLAPIENTRY *mpglMapBufferRange)(GLenum, ptrdiff_t,
ptrdiff_t, unsigned);
                                                        ^
libvo/gl_common.c:103:50: warning: type specifier missing, defaults to
'int' [-Wimplicit-int]
GLvoid* (GLAPIENTRY *mpglMapBufferRange)(GLenum, ptrdiff_t, ptrdiff_t,
unsigned);
                                                 ^~~~~~~~~
libvo/gl_common.c:103:61: warning: type specifier missing, defaults to
'int' [-Wimplicit-int]
GLvoid* (GLAPIENTRY *mpglMapBufferRange)(GLenum, ptrdiff_t, ptrdiff_t,
unsigned);
                                                            ^~~~~~~~~
libvo/gl_common.c:103:61: error: redefinition of parameter 'ptrdiff_t'
libvo/gl_common.c:103:50: note: previous declaration is here
GLvoid* (GLAPIENTRY *mpglMapBufferRange)(GLenum, ptrdiff_t, ptrdiff_t,
unsigned);
                                                 ^
libvo/gl_common.c:552:48: error: unknown type name 'ptrdiff_t'
static GLvoid *wrap_glMapBuffer(GLenum target, ptrdiff_t offset,
ptrdiff_t range, unsigned flags) {
                                               ^
libvo/gl_common.c:552:66: error: unknown type name 'ptrdiff_t'
static GLvoid *wrap_glMapBuffer(GLenum target, ptrdiff_t offset,
ptrdiff_t range, unsigned flags) {
                                                                 ^
libvo/gl_common.c:578:34: warning: passing 'char [12]' to parameter of
type 'const GLubyte *' (aka 'const unsigned char *') converts between
pointers to integer types with different sign [-Wpointer-sign]
  mpglGetString = getProcAddress("glGetString");
                                 ^~~~~~~~~~~~~
libvo/gl_common.c:1770:15: warning: initializing 'const char *' with
an expression of type 'const GLubyte *' (aka 'const unsigned char *')
converts between pointers to integer types with different sign
[-Wpointer-sign]
  const char *extensions = mpglGetString(GL_EXTENSIONS);
              ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libvo/gl_common.c:1771:15: warning: initializing 'const char *' with
an expression of type 'const GLubyte *' (aka 'const unsigned char *')
converts between pointers to integer types with different sign
[-Wpointer-sign]
  const char *vendor     = mpglGetString(GL_VENDOR);
              ^            ~~~~~~~~~~~~~~~~~~~~~~~~
libvo/gl_common.c:2731:24: warning: incompatible pointer types
assigning to 'void (*)(struct MPGLContext *)' from 'void (void)'
[-Wincompatible-pointer-types]
    ctx->swapGlBuffers = vo_osx_swap_buffers;
                       ^ ~~~~~~~~~~~~~~~~~~~
libvo/gl_common.c:2800:11: warning: 7 enumeration values not handled
in switch: 'GLTYPE_AUTO', 'GLTYPE_W32', 'GLTYPE_X11'... [-Wswitch]
  switch (ctx->type) {
          ^
9 warnings and 4 errors generated.



I have fixed this error by adding an include of "stddef.h", like so:

Index: libvo/gl_common.h
===================================================================
--- libvo/gl_common.h   (revision 36788)
+++ libvo/gl_common.h   (working copy)
@@ -47,6 +47,7 @@
 #ifdef CONFIG_GL_OSX
 #include "osx_common.h"
 #include <OpenGL/gl.h>
+#include <stddef.h>
 #elif defined(CONFIG_GL_EGL_ANDROID)
 #include <EGL/egl.h>
 #include <GLES/gl.h>



As I'm certain that you have not committed somthing that didn't
compile, do you know if stddef.h may only be necessary for OSX, or
should it be included in all configs?


Cheers,


Guillaume


More information about the MPlayer-cvslog mailing list