aboutsummaryrefslogtreecommitdiffstats
path: root/java-c-jni
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-02-17 21:15:37 +0100
committerMattias Andrée <maandree@operamail.com>2013-02-17 21:15:37 +0100
commit819760193644a3543d63c3530f18552def3494cf (patch)
tree28d3323bf01b2626b49281e4802f8158ba1f820f /java-c-jni
parentadd jni .so to makefile (diff)
downloadsha3sum-819760193644a3543d63c3530f18552def3494cf.tar.gz
sha3sum-819760193644a3543d63c3530f18552def3494cf.tar.bz2
sha3sum-819760193644a3543d63c3530f18552def3494cf.tar.xz
fix jni warnings
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--java-c-jni/SHA3.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/java-c-jni/SHA3.c b/java-c-jni/SHA3.c
index 50bc20c..9e93f01 100644
--- a/java-c-jni/SHA3.c
+++ b/java-c-jni/SHA3.c
@@ -28,7 +28,7 @@
#define null 0
-#define byte char
+#define byte jbyte
#define boolean long
#define true 1
#define false 0
@@ -409,7 +409,7 @@ inline byte* pad10star1(byte* msg, long len, long r, long* outlen)
}
else
{
- char* M;
+ byte* M;
long N;
len = (nrf + 1) << 3;
len = ((len - (len % r) + (r - 8)) >> 3) + 1;
@@ -696,10 +696,12 @@ JNIEXPORT void JNICALL Java_SHA3_update(JNIEnv* env, jclass class, jbyteArray ms
JNIEXPORT jbyteArray JNICALL Java_SHA3_digest(JNIEnv* env, jclass class, jbyteArray msg, jint msglen)
{
+ byte* rcn;
+ jbyteArray rcj;
(void) class;
- byte* rcn = digest((*env)->GetByteArrayElements(env, msg, 0), msglen);
- jbyteArray rcj = (*env)->NewByteArray(env, (n + 7) >> 3);
+ rcn = digest((*env)->GetByteArrayElements(env, msg, 0), msglen);
+ rcj = (*env)->NewByteArray(env, (n + 7) >> 3);
(*env)->SetByteArrayRegion(env, rcj, 0, (n + 7) >> 3, rcn);
return rcj;
}