From f1c440626e48ed8e544c438b6e0fcb178d654596 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 19 Dec 2016 14:38:35 +0100 Subject: [PATCH] cosmetics --- NEWS | 3 ++- src/bindings/java/jmsg_file.cpp | 16 +++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index abaf4cc81c..1935985c21 100644 --- a/NEWS +++ b/NEWS @@ -6,11 +6,12 @@ __ _____ _ __ ___(_) ___ _ __ |___ / / | || | The Chrismas Pi Release. - * Documentation completely reorganized and improved + * Documentation reorganized and improved * S4U interface further rising, toward SimGrid 4 - Routing code rewritten for readability - Virtual Machines almost changed into a plugin + - MSG, SimDag, MPI interfaces mostly unchanged _ _____ _ _____ __ _____ _ __ ___(_) ___ _ __ |___ / / |___ / \ \ / / _ \ '__/ __| |/ _ \| '_ \ |_ \ | | |_ \ diff --git a/src/bindings/java/jmsg_file.cpp b/src/bindings/java/jmsg_file.cpp index 98e7f9408a..dff4b348e7 100644 --- a/src/bindings/java/jmsg_file.cpp +++ b/src/bindings/java/jmsg_file.cpp @@ -10,37 +10,35 @@ #include "jxbt_utilities.h" void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd) { - env->SetLongField(jfile, jfile_field_bind, (intptr_t)fd); + env->SetLongField(jfile, jfile_field_bind, reinterpret_cast(fd)); } msg_file_t jfile_get_native(JNIEnv *env, jobject jfile) { - return (msg_file_t)(intptr_t)env->GetLongField(jfile, jfile_field_bind); + return reinterpret_cast(static_cast(env->GetLongField(jfile, jfile_field_bind))); } JNIEXPORT void JNICALL Java_org_simgrid_msg_File_nativeInit(JNIEnv *env, jclass cls) { jclass class_File = env->FindClass("org/simgrid/msg/File"); jfile_field_bind = jxbt_get_jfield(env , class_File, "bind", "J"); - xbt_assert((jfile_field_bind != nullptr), "Can't find \"bind\" field in File class."); + xbt_assert((jfile_field_bind != nullptr), "Can't find 'bind' field in File class."); } JNIEXPORT void JNICALL Java_org_simgrid_msg_File_open(JNIEnv *env, jobject jfile, jobject jpath) { const char *path = env->GetStringUTFChars((jstring) jpath, 0); - msg_file_t file; - - file = MSG_file_open(path, nullptr); + msg_file_t file = MSG_file_open(path, nullptr); jfile_bind(env, jfile, file); - env->ReleaseStringUTFChars((jstring) jpath, path); + env->ReleaseStringUTFChars(static_cast(jpath), path); } JNIEXPORT jlong JNICALL Java_org_simgrid_msg_File_read(JNIEnv *env, jobject jfile, jlong jsize) { msg_file_t file = jfile_get_native(env, jfile); - return (jlong)MSG_file_read(file, static_cast(jsize)); + return static_cast(MSG_file_read(file, static_cast(jsize))); } JNIEXPORT jlong JNICALL Java_org_simgrid_msg_File_write(JNIEnv *env, jobject jfile, jlong jsize) { msg_file_t file = jfile_get_native(env, jfile); - return (jlong)MSG_file_write(file, static_cast(jsize)); + return static_cast(MSG_file_write(file, static_cast(jsize))); } JNIEXPORT void JNICALL Java_org_simgrid_msg_File_seek(JNIEnv *env, jobject jfile, jlong offset, jlong origin) { -- 2.20.1