From 8b41422c77ed01b647c9f38926d56c2bd1e90ec6 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 3 Mar 2015 11:56:31 -0500 Subject: [PATCH] playback/player: android: Cast pointers to gintptr to simplify code --- playback/player/android/jni/player.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/playback/player/android/jni/player.c b/playback/player/android/jni/player.c index 50978d90b3..2597db447f 100644 --- a/playback/player/android/jni/player.c +++ b/playback/player/android/jni/player.c @@ -30,17 +30,8 @@ GST_DEBUG_CATEGORY_STATIC (debug_category); #define GST_CAT_DEFAULT debug_category -/* - * These macros provide a way to store the native pointer to Player, which might be 32 or 64 bits, into - * a jlong, which is always 64 bits, without warnings. - */ -#if GLIB_SIZEOF_VOID_P == 8 -# define GET_CUSTOM_DATA(env, thiz, fieldID) (Player *)(*env)->GetLongField (env, thiz, fieldID) -# define SET_CUSTOM_DATA(env, thiz, fieldID, data) (*env)->SetLongField (env, thiz, fieldID, (jlong)data) -#else -# define GET_CUSTOM_DATA(env, thiz, fieldID) (Player *)(jint)(*env)->GetLongField (env, thiz, fieldID) -# define SET_CUSTOM_DATA(env, thiz, fieldID, data) (*env)->SetLongField (env, thiz, fieldID, (jlong)(jint)data) -#endif +#define GET_CUSTOM_DATA(env, thiz, fieldID) (Player *)(gintptr)(*env)->GetLongField (env, thiz, fieldID) +#define SET_CUSTOM_DATA(env, thiz, fieldID, data) (*env)->SetLongField (env, thiz, fieldID, (jlong)(gintptr)data) typedef struct _Player {