From 27ebb38b9ffd3cc8f4ee3b97509b0f32ef2680aa Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 6 Mar 2015 10:02:03 +0100 Subject: Bug 1135 - Cleanup: Fix native code Warning --- src/jogl/native/EGLContext.c | 5 +++-- src/jogl/native/GLDebugMessageHandler.c | 8 ++++---- src/nativewindow/native/x11/Xmisc.c | 6 +++--- src/nativewindow/native/x11/Xmisc.h | 26 ++++++++++++++++++++++++++ src/newt/native/X11Display.c | 2 +- src/newt/native/X11RandR13.c | 4 ++-- src/newt/native/X11Window.c | 2 +- src/newt/native/bcm_vc_iv.c | 2 +- 8 files changed, 41 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/jogl/native/EGLContext.c b/src/jogl/native/EGLContext.c index 7bf60b850..fac0670e6 100644 --- a/src/jogl/native/EGLContext.c +++ b/src/jogl/native/EGLContext.c @@ -16,10 +16,11 @@ */ JNIEXPORT jlong JNICALL Java_jogamp_opengl_egl_EGLContext_dispatch_1eglGetProcAddress0__Ljava_lang_String_2J(JNIEnv *env, jclass _unused, jstring procname, jlong procAddress) { - typedef __EGLFuncPtr (EGLAPIENTRY*_local_PFNEGLGETPROCADDRESSPROC)(const char * procname); + typedef void (* EGLAPIENTRY _local_EGLFuncPtr)(void); + typedef _local_EGLFuncPtr (EGLAPIENTRY*_local_PFNEGLGETPROCADDRESSPROC)(const char * procname); _local_PFNEGLGETPROCADDRESSPROC ptr_eglGetProcAddress; const char* _strchars_procname = NULL; - __EGLFuncPtr _res; + _local_EGLFuncPtr _res; if ( NULL != procname ) { _strchars_procname = (*env)->GetStringUTFChars(env, procname, (jboolean*)NULL); if ( NULL == _strchars_procname ) { diff --git a/src/jogl/native/GLDebugMessageHandler.c b/src/jogl/native/GLDebugMessageHandler.c index 0aa7a01e7..5c18b94b1 100644 --- a/src/jogl/native/GLDebugMessageHandler.c +++ b/src/jogl/native/GLDebugMessageHandler.c @@ -21,11 +21,11 @@ static jmethodID glDebugMessageARB = NULL; // int source, int type, int id, int severity, String msg static jmethodID glDebugMessageAMD = NULL; // int id, int category, int severity, String msg -typedef void (APIENTRY* _local_PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam); -typedef void (APIENTRY* _local_GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +typedef void (APIENTRY* _local_GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY* _local_PFNGLDEBUGMESSAGECALLBACKARBPROC) (_local_GLDEBUGPROCARB callback, const void *userParam); -typedef void (APIENTRY* _local_PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, const GLvoid *userParam); -typedef void (APIENTRY* _local_GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +typedef void (APIENTRY* _local_GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); +typedef void (APIENTRY* _local_PFNGLDEBUGMESSAGECALLBACKAMDPROC) (_local_GLDEBUGPROCAMD callback, void *userParam); /* * Class: jogamp_opengl_GLDebugMessageHandler diff --git a/src/nativewindow/native/x11/Xmisc.c b/src/nativewindow/native/x11/Xmisc.c index a2e744cd8..efb4620ba 100644 --- a/src/nativewindow/native/x11/Xmisc.c +++ b/src/nativewindow/native/x11/Xmisc.c @@ -52,12 +52,12 @@ #include #undef __USE_GNU +#include "Xmisc.h" + /* Current versions of Solaris don't expose the XF86 extensions, although with the recent transition to Xorg this will probably happen in an upcoming release */ -#if !defined(__sun_obsolete) && !defined(_HPUX) -#include -#else +#if defined(__sun_obsolete) || defined(_HPUX) /* Need to provide stubs for these */ Bool XF86VidModeGetGammaRampSize( Display *display, diff --git a/src/nativewindow/native/x11/Xmisc.h b/src/nativewindow/native/x11/Xmisc.h index 91f2ac5d9..d8868f802 100644 --- a/src/nativewindow/native/x11/Xmisc.h +++ b/src/nativewindow/native/x11/Xmisc.h @@ -39,4 +39,30 @@ #include #include +#if !defined(__sun_obsolete) && !defined(_HPUX) +#include +#else +Bool XF86VidModeGetGammaRampSize( + Display* /* dpy */, + int /* screen */, + int* /* size */ +); +Bool XF86VidModeGetGammaRamp( + Display* /* dpy */, + int /* screen */, + int /* size */, + unsigned short* /* red array */, + unsigned short* /* green array */, + unsigned short* /* blue array */ +); +Bool XF86VidModeSetGammaRamp( + Display* /* dpy */, + int /* screen */, + int /* size */, + unsigned short* /* red array */, + unsigned short* /* green array */, + unsigned short* /* blue array */ +); +#endif /* defined(__sun_obsolete) || defined(_HPUX) */ + #endif /* Xmisc_h */ diff --git a/src/newt/native/X11Display.c b/src/newt/native/X11Display.c index b62a9b234..60daf1af2 100644 --- a/src/newt/native/X11Display.c +++ b/src/newt/native/X11Display.c @@ -30,7 +30,7 @@ #include -// #include // XKB disabled for now +#include jclass X11NewtWindowClazz = NULL; jmethodID insetsChangedID = NULL; diff --git a/src/newt/native/X11RandR13.c b/src/newt/native/X11RandR13.c index 5eacbf216..1d721efcb 100644 --- a/src/newt/native/X11RandR13.c +++ b/src/newt/native/X11RandR13.c @@ -26,7 +26,7 @@ * or implied, of JogAmp Community. */ -#include "X11Common.h" +#include "X11Screen.h" /* * Class: jogamp_newt_driver_x11_RandR13 @@ -67,7 +67,7 @@ static void dumpOutputs(const char *prefix, Display *dpy, XRRScreenResources *re for(i=0; icrtc, SAFE_STRING(xrrOutputInfo->name), xrrOutputInfo->nameLen, xrrOutputInfo->mm_width, xrrOutputInfo->mm_height, xrrOutputInfo->ncrtc, xrrOutputInfo->nclone, xrrOutputInfo->nmode, xrrOutputInfo->npreferred); diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c index 2cc66c78d..43506c6a6 100644 --- a/src/newt/native/X11Window.c +++ b/src/newt/native/X11Window.c @@ -489,7 +489,7 @@ static Bool WaitForUnmapNotify( Display *dpy, XEvent *event, XPointer arg ) { } static void NewtWindows_setPosSize(Display *dpy, Window w, jint x, jint y, jint width, jint height) { - if(width>0 && height>0 || x>=0 && y>=0) { // resize/position if requested + if( ( width>0 && height>0 ) || ( x>=0 && y>=0 ) ) { // resize/position if requested XWindowChanges xwc; int flags = CWX | CWY; diff --git a/src/newt/native/bcm_vc_iv.c b/src/newt/native/bcm_vc_iv.c index ee59f0aa6..6b1ee3aaf 100644 --- a/src/newt/native/bcm_vc_iv.c +++ b/src/newt/native/bcm_vc_iv.c @@ -357,7 +357,7 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_bcm_vc_iv_WindowDriver_CreateWin VC_RECT_T src_rect; if( 0 == display ) { - return; + return 0; } dst_rect.x = x; dst_rect.y = y; -- cgit v1.2.3