diff options
author | Sven Gothel <[email protected]> | 2023-11-28 12:08:55 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-11-28 12:08:55 +0100 |
commit | 1aa6f3080953eb4b3a4018b805a014c95dfce4dd (patch) | |
tree | 1d0035f9d1d9afd78d4234fd7dd5ccc14ffb4c86 /src/native | |
parent | 072c55ca78d57ce6cee44a83a78cffe1559f2b81 (diff) |
Bug 1475: Minor revision of orig patch-set
- Implement ALC.alcIsDoubleNullTerminatedString() in Java w/ our existing functionality,
drop JNI function
- JoalVersion.devicesToString(..) revert to original API
dropping boolean params
- C: Drop using stdbool.h, earmarked as obsolete in std
Diffstat (limited to 'src/native')
-rw-r--r-- | src/native/almisc.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/native/almisc.c b/src/native/almisc.c index 06fa794..22689b6 100644 --- a/src/native/almisc.c +++ b/src/native/almisc.c @@ -10,12 +10,9 @@ #endif #include "efx.h" #include <string.h> -#include <stdbool.h> extern int strlen_alc(ALCdevice *device, int param, const char* str); -extern bool alc_is_double_null_terminated_string(ALCdevice *device, int param); - /* Java->C glue code: * Java package: jogamp.openal.ALImpl * Java method: long dispatch_alGetProcAddressStatic(java.lang.String fname) @@ -53,22 +50,13 @@ Java_jogamp_openal_ALCImpl_dispatch_1alcGetStringImpl1(JNIEnv *env, jobject _unu LPALCGETSTRING ptr_alcGetString; ALCdevice * _device_ptr = NULL; const ALCchar * _res; - if ( NULL != device ) { - _device_ptr = (ALCdevice *) (((char*) (*env)->GetDirectBufferAddress(env, device)) + 0); - } + if ( NULL != device ) { + _device_ptr = (ALCdevice *) (((char*) (*env)->GetDirectBufferAddress(env, device)) + 0); + } ptr_alcGetString = (LPALCGETSTRING) (intptr_t) procAddress; assert(ptr_alcGetString != NULL); _res = (* ptr_alcGetString) ((ALCdevice *) _device_ptr, (ALCenum) param); if (NULL == _res) return NULL; - return (*env)->NewDirectByteBuffer(env, _res, strlen_alc(_device_ptr, param, _res)); + return (*env)->NewDirectByteBuffer(env, (void*)_res, strlen_alc(_device_ptr, param, _res)); } -JNIEXPORT jboolean JNICALL -Java_jogamp_openal_ALCImpl_dispatch_1alcIsDoubleNullTerminatedString(JNIEnv *env, jobject _unused, jobject device, jint param) { - ALCdevice * _device_ptr = NULL; - const ALCchar * _res; - if ( NULL != device ) { - _device_ptr = (ALCdevice *) (((char*) (*env)->GetDirectBufferAddress(env, device)) + 0); - } - return (jboolean) alc_is_double_null_terminated_string((ALCdevice *) _device_ptr, (ALCenum) param); -} |