Forráskód Böngészése

Address two native-code codesmells

MeFisto94 4 éve
szülő
commit
38a225cf8e

+ 1 - 1
jme3-android-native/src/native/jme_decode/com_jme3_audio_plugins_NativeVorbisFile.c

@@ -298,7 +298,7 @@ JNIEXPORT void JNICALL Java_com_jme3_audio_plugins_NativeVorbisFile_readFully
     wrapper->env = env;
     
     char err[512];
-    void* byteBufferPtr = (*env)->GetDirectBufferAddress(env, buf);
+    byte* byteBufferPtr = (byte*)(*env)->GetDirectBufferAddress(env, buf);
     jlong byteBufferCap = (*env)->GetDirectBufferCapacity(env, buf);
     
     int offset     = 0;

+ 3 - 6
jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidALC.c

@@ -74,14 +74,11 @@ static void CloseAL()
 
 static ALCdevice* GetALCDevice()
 {
-    ALCdevice *device;
-    ALCcontext *ctx;
+    ALCcontext *ctx = alcGetCurrentContext();
 
-    ctx = alcGetCurrentContext();
-    
-    if (ctx != NULL) 
+    if (ctx != NULL)
     {
-        device = alcGetContextsDevice(ctx);
+        ALCdevice *device = alcGetContextsDevice(ctx);
         
         if (device != NULL)
         {