Add explicit casts to make clang support easier - see #755

This commit is contained in:
md_5 2014-02-02 10:15:14 +11:00
parent edce7f7c3d
commit a0cc5d84be
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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