[libbluray-devel] Improved JNI (const char *) -> (char *) cast

npzacs git at videolan.org
Sun Jul 14 10:56:39 CEST 2013


libbluray | branch: master | npzacs <npzacs at gmail.com> | Sun Jul 14 11:28:36 2013 +0300| [dea1d28356e3bc9121eab12accd6680947d796ab] | committer: npzacs

Improved JNI (const char *) -> (char *) cast

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=dea1d28356e3bc9121eab12accd6680947d796ab
---

 src/libbluray/bdj/native/java_awt_BDFontMetrics.c |    5 +----
 src/libbluray/bdj/native/java_awt_BDGraphics.c    |    5 +----
 src/libbluray/bdj/native/org_videolan_Libbluray.c |    5 +----
 src/libbluray/bdj/native/org_videolan_Logger.c    |    5 +----
 4 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/libbluray/bdj/native/java_awt_BDFontMetrics.c b/src/libbluray/bdj/native/java_awt_BDFontMetrics.c
index 718cb9f..71165cc 100644
--- a/src/libbluray/bdj/native/java_awt_BDFontMetrics.c
+++ b/src/libbluray/bdj/native/java_awt_BDFontMetrics.c
@@ -214,11 +214,8 @@ Java_java_awt_BDFontMetrics_charsWidthN(JNIEnv * env, jobject obj, jlong ftFace,
 #endif /* HAVE_FT2 */
 }
 
-#define CC (char*)             /* cast a literal from (const char*) */
+#define CC (char*)(uintptr_t)  /* cast a literal from (const char*) */
 #define VC (void*)(uintptr_t)  /* cast function pointer to void* */
-#if defined __GNUC__
-#pragma GCC diagnostic ignored "-Wcast-qual"
-#endif
 
 BD_PRIVATE CPP_EXTERN const JNINativeMethod
 Java_java_awt_BDFontMetrics_methods[] =
diff --git a/src/libbluray/bdj/native/java_awt_BDGraphics.c b/src/libbluray/bdj/native/java_awt_BDGraphics.c
index 6ed889a..b6ed540 100644
--- a/src/libbluray/bdj/native/java_awt_BDGraphics.c
+++ b/src/libbluray/bdj/native/java_awt_BDGraphics.c
@@ -91,11 +91,8 @@ Java_java_awt_BDGraphics_drawStringN(JNIEnv * env, jobject obj, jlong ftFace, js
 #endif /* HAVE_FT2 */
 }
 
-#define CC (char*)             /* cast a literal from (const char*) */
+#define CC (char*)(uintptr_t)  /* cast a literal from (const char*) */
 #define VC (void*)(uintptr_t)  /* cast function pointer to void* */
-#if defined __GNUC__
-#pragma GCC diagnostic ignored "-Wcast-qual"
-#endif
 
 BD_PRIVATE CPP_EXTERN const JNINativeMethod
 Java_java_awt_BDGraphics_methods[] =
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index 3b8abc4..54bd11a 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -508,11 +508,8 @@ JNIEXPORT void JNICALL Java_org_videolan_Libbluray_updateGraphicN(JNIEnv * env,
     }
 }
 
-#define CC (char*)             /* cast a literal from (const char*) */
+#define CC (char*)(uintptr_t)  /* cast a literal from (const char*) */
 #define VC (void*)(uintptr_t)  /* cast function pointer to void* */
-#if defined __GNUC__
-#pragma GCC diagnostic ignored "-Wcast-qual"
-#endif
 
 BD_PRIVATE CPP_EXTERN const JNINativeMethod
 Java_org_videolan_Libbluray_methods[] =
diff --git a/src/libbluray/bdj/native/org_videolan_Logger.c b/src/libbluray/bdj/native/org_videolan_Logger.c
index 06a84e1..40f7e40 100644
--- a/src/libbluray/bdj/native/org_videolan_Logger.c
+++ b/src/libbluray/bdj/native/org_videolan_Logger.c
@@ -71,11 +71,8 @@ Java_org_videolan_Logger_logN(JNIEnv *env, jclass cls, jboolean error, jstring j
     (*env)->ReleaseStringUTFChars(env, string, msg);
 }
 
-#define CC (char*)             /* cast a literal from (const char*) */
+#define CC (char*)(uintptr_t)  /* cast a literal from (const char*) */
 #define VC (void*)(uintptr_t)  /* cast function pointer to void* */
-#if defined __GNUC__
-#pragma GCC diagnostic ignored "-Wcast-qual"
-#endif
 
 BD_PRIVATE CPP_EXTERN const JNINativeMethod
 Java_org_videolan_Logger_methods[] =



More information about the libbluray-devel mailing list