aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-06 10:02:03 +0100
committerSven Gothel <[email protected]>2015-03-06 10:02:03 +0100
commit27ebb38b9ffd3cc8f4ee3b97509b0f32ef2680aa (patch)
tree5a50541643e21ae1a3d49d65c405cdefa4b64569
parenteced1d4e45772a862d649e3cd7b500c6bc1643a1 (diff)
Bug 1135 - Cleanup: Fix native code Warning
-rw-r--r--src/jogl/native/EGLContext.c5
-rw-r--r--src/jogl/native/GLDebugMessageHandler.c8
-rw-r--r--src/nativewindow/native/x11/Xmisc.c6
-rw-r--r--src/nativewindow/native/x11/Xmisc.h26
-rw-r--r--src/newt/native/X11Display.c2
-rw-r--r--src/newt/native/X11RandR13.c4
-rw-r--r--src/newt/native/X11Window.c2
-rw-r--r--src/newt/native/bcm_vc_iv.c2
8 files changed, 41 insertions, 14 deletions
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 <dlfcn.h>
#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 <X11/extensions/xf86vmode.h>
-#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 <X11/Xlib.h>
#include <X11/Xutil.h>
+#if !defined(__sun_obsolete) && !defined(_HPUX)
+#include <X11/extensions/xf86vmode.h>
+#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 <X11/Xcursor/Xcursor.h>
-// #include <X11/XKBlib.h> // XKB disabled for now
+#include <X11/XKBlib.h>
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; i<noutput; i++) {
RROutput output = outputs[i];
XRROutputInfo * xrrOutputInfo = XRRGetOutputInfo (dpy, resources, output);
- fprintf(stderr, " Output[%d]: id %#lx, crtx 0x%X, name %s (%d), %lux%lu, ncrtc %d, nclone %d, nmode %d (preferred %d)\n",
+ fprintf(stderr, " Output[%d]: id %#lx, crtx 0x%lX, name %s (%d), %lux%lu, ncrtc %d, nclone %d, nmode %d (preferred %d)\n",
i, output, xrrOutputInfo->crtc, 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;