Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
Adds minimal improvements to build.sh, better cast in JNI
Browse files Browse the repository at this point in the history
Make output of find go to stderr, add set -e at the start of build.sh script and changes a (jlong) for a reinterpret_cast<jlong> in JNI code

Signed-off-by: ncordon <nacho.cordon.castillo@gmail.com>
  • Loading branch information
ncordon committed Oct 3, 2019
1 parent 3f9babb commit 3cf96a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# --native: compiles the native code, with appropriate flags for each system
# -all: compiles both the native code and the Scala code, in that order

set -e

PROTO_DIR="src/main/proto"
SDK_MAJOR="v3"
SDK_VERSION="${SDK_MAJOR}.1.0"
Expand Down Expand Up @@ -84,7 +86,7 @@ function getSDKFiles {
# Checks that the library has been downloaded correctly
function checkLibuastDownload {
set -e
find src/main/resources
find src/main/resources 1>&2
nm src/main/resources/libuast/libuast${LIBUAST_FMT} | grep -c UastDecode > /dev/null || exit -2
nm src/main/resources/libuast/libuast${LIBUAST_FMT} | wc -l > /dev/null || exit -2
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/native/org_bblfsh_client_v2_libuast_Libuast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ JNIEXPORT jobject JNICALL Java_org_bblfsh_client_v2_Context_nativeEncode(
JNIEXPORT jlong JNICALL
Java_org_bblfsh_client_v2_Context_00024_create(JNIEnv *env, jobject self) {
Context *c = new Context();
return (jlong) c;
return reinterpret_cast<jlong>(c);
}

JNIEXPORT void JNICALL Java_org_bblfsh_client_v2_Context_dispose(JNIEnv *env,
Expand Down

0 comments on commit 3cf96a9

Please sign in to comment.