Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix declaration of env parameter in fromjstring/tojstring functions. #44

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/native/org_gnu_readline_Readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ static size_t bufLength = 0;

static char* word_break_buffer = NULL;

static char* fromjstring(const JNIEnv *env, jstring value);
static jstring tojstring(const JNIEnv *env, const char* value);
static char* fromjstring(JNIEnv const *env, jstring value);
static jstring tojstring(JNIEnv const *env, const char* value);

static int allocBuffer(size_t n);

Expand Down Expand Up @@ -776,7 +776,7 @@ JNIEXPORT jstring JNICALL
/* Convert jstring to c-string */
/* -------------------------------------------------------------------------- */

char* fromjstring(const JNIEnv *env, jstring value) {
char* fromjstring(JNIEnv const *env, jstring value) {
const jclass jstringClass = (*env)->GetObjectClass(env, value);
const jmethodID getBytesMethodId = (*env)->GetMethodID(env, jstringClass, "getBytes", "()[B");

Expand Down Expand Up @@ -822,7 +822,7 @@ char* fromjstring(const JNIEnv *env, jstring value) {
/* Convert c-string to j-string */
/* -------------------------------------------------------------------------- */

jstring tojstring(const JNIEnv *env, const char* value) {
jstring tojstring(JNIEnv const *env, const char* value) {
const jclass jstringClass = (*env)->FindClass(env,"java/lang/String");
const jmethodID constructorMethodId = (*env)->GetMethodID(env, jstringClass, "<init>", "([B)V");

Expand Down