mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +01:00
Add explicit casts to make clang support easier - see #755
This commit is contained in:
parent
edce7f7c3d
commit
a0cc5d84be
@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
gcc -shared -fPIC -O3 -Werror -I/usr/lib/jvm/default-java/include/ src/main/c/NativeCipherImpl.c -o src/main/resources/native-cipher.so -lcrypto
|
||||
gcc -shared -fPIC -O3 -Werror -I$JAVA_HOME/include/ src/main/c/NativeCipherImpl.c -o src/main/resources/native-cipher.so -lcrypto
|
||||
|
@ -11,7 +11,7 @@ jlong Java_net_md_15_bungee_NativeCipherImpl_init
|
||||
AES_KEY *aes_key = malloc(sizeof(AES_KEY));
|
||||
|
||||
jboolean isKeyCopy;
|
||||
BYTE *key_bytes = (*env)->GetByteArrayElements(env, key, &isKeyCopy);
|
||||
BYTE *key_bytes = (BYTE*)(*env)->GetByteArrayElements(env, key, &isKeyCopy);
|
||||
int key_length = (*env)->GetArrayLength(env, key) * 8; // in bits
|
||||
|
||||
AES_set_encrypt_key(key_bytes, key_length, aes_key);
|
||||
@ -37,7 +37,7 @@ void Java_net_md_15_bungee_NativeCipherImpl_cipher
|
||||
BYTE *output = (BYTE*) out;
|
||||
|
||||
jboolean isCopy;
|
||||
BYTE *iv_bytes = (*env)->GetByteArrayElements(env, iv, &isCopy);
|
||||
BYTE *iv_bytes = (BYTE*)(*env)->GetByteArrayElements(env, iv, &isCopy);
|
||||
|
||||
AES_cfb8_encrypt(
|
||||
input, // input buffer
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user